@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.
@@ -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 NodeInstance_1.default.find({ flowInstanceId, isActive: true });
752
- const nodeInstances = await (0, typeorm_1.getManager)().transaction(async (transactionalEntityManager) => {
753
- const queryBuilder = transactionalEntityManager.createQueryBuilder(NodeInstance_1.default, '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
- return queryBuilder.getMany();
761
- });
762
- if (totalNI.length > nodeInstances.length) {
763
- validFlowInstances.push(flowInstanceId);
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pxp-nd/flow",
3
- "version": "1.1.16",
3
+ "version": "1.1.17",
4
4
  "description": "Workflow module for pxp-nd framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",