@pxp-nd/flow 1.1.16 → 1.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/controllers/Flow.js +18 -15
- package/package.json +1 -1
package/dist/controllers/Flow.js
CHANGED
|
@@ -66,7 +66,6 @@ const Action_1 = __importDefault(require("../entity/Action"));
|
|
|
66
66
|
const NodeConnection_1 = __importDefault(require("../entity/NodeConnection"));
|
|
67
67
|
const Flow_1 = __importDefault(require("../entity/Flow"));
|
|
68
68
|
const FlowInstance_1 = __importDefault(require("../entity/FlowInstance"));
|
|
69
|
-
const NodeInstance_1 = __importDefault(require("../entity/NodeInstance"));
|
|
70
69
|
const Node_2 = __importDefault(require("./Node"));
|
|
71
70
|
const axios_1 = __importDefault(require("axios"));
|
|
72
71
|
//import {configFacebookStrategy} from "./passport-facebook";
|
|
@@ -747,21 +746,25 @@ let Flow = class Flow extends core_1.Controller {
|
|
|
747
746
|
validFlowInstances.push(flowInstance.flowInstanceId);
|
|
748
747
|
}
|
|
749
748
|
else {
|
|
749
|
+
/*Commented because scheduled nodes shouldn't be affected by stopping
|
|
750
750
|
let flowInstanceId = flowInstance.flowInstanceId;
|
|
751
|
-
const totalNI = await
|
|
752
|
-
const nodeInstances = await
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
751
|
+
const totalNI = await NodeInstanceModel.find({ flowInstanceId, isActive: true});
|
|
752
|
+
const nodeInstances = await getManager().transaction(async (transactionalEntityManager) => {
|
|
753
|
+
const queryBuilder: SelectQueryBuilder<NodeInstanceModel> = transactionalEntityManager.createQueryBuilder(NodeInstanceModel, 'node_instance');
|
|
754
|
+
queryBuilder
|
|
755
|
+
.where('node_instance.flowInstanceId = :flowInstanceId', { flowInstanceId })
|
|
756
|
+
.andWhere('((node_instance.status IS NULL AND (node_instance.schedule = :schedule OR node_instance.schedule IS NULL)) OR (node_instance.status = :status AND node_instance.schedule != :schedule AND node_instance.schedule IS NOT NULL))', {
|
|
757
|
+
status: 'executed',
|
|
758
|
+
schedule: '0000-00-00 00:00:00',
|
|
759
|
+
});
|
|
760
|
+
|
|
761
|
+
return queryBuilder.getMany();
|
|
762
|
+
});
|
|
763
|
+
|
|
764
|
+
|
|
765
|
+
if (totalNI.length > nodeInstances.length ) {
|
|
766
|
+
validFlowInstances.push(flowInstanceId);
|
|
767
|
+
}*/
|
|
765
768
|
}
|
|
766
769
|
}
|
|
767
770
|
if (validFlowInstances.length > 0) {
|