@pxp-nd/flow 1.0.26 → 1.0.27

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.
@@ -50,9 +50,15 @@ class FlowInstance extends core_1.Controller {
50
50
  flowInstanceIdProcessing = flowInstance.flowInstanceId;
51
51
  const node = await Node_1.default.findOne({ where: { actionId: flowInstance.actionId, flowId: flowInstance.flowId } });
52
52
  const CNodeInstance = new NodeInstance_1.default('flow-nd', NodeInstance_2.default);
53
- await CNodeInstance.RecursiveInstance({ node, flowInstance });
54
- flowInstance.status = 'processed';
55
- await manager.save(flowInstance);
53
+ try {
54
+ await CNodeInstance.RecursiveInstance({ node, flowInstance });
55
+ await manager.update(FlowInstance_1.default, { flowInstanceId: flowInstance.flowInstanceId }, { status: 'processed' });
56
+ }
57
+ catch (error) {
58
+ console.log(error);
59
+ await manager.update(FlowInstance_1.default, { flowInstanceId: flowInstance.flowInstanceId }, { status: 'error' });
60
+ }
61
+ await manager.update(FlowInstance_1.default, { flowInstanceId: flowInstance.flowInstanceId }, { status: 'processed' });
56
62
  }
57
63
  }
58
64
  catch (error) {
@@ -131,7 +131,14 @@ let NodeInstance = class NodeInstance extends core_1.Controller {
131
131
  // todo if in some transaction there is an error we need to put in some log to error and not try only some times
132
132
  for (const nodeConnection of nodeConnectionList) { // todo create transaction for own node
133
133
  const nodeRes = await core_1.__(Node_1.default.findOne(nodeConnection.nodeIdChild));
134
- await this.RecursiveInstance({ node: nodeRes, flowInstance, resultFromOrigin });
134
+ try {
135
+ await this.RecursiveInstance({ node: nodeRes, flowInstance, resultFromOrigin });
136
+ }
137
+ catch (error) {
138
+ await manager.update(NodeInstance_1.default, nodeInstance.nodeInstanceId, {
139
+ status: 'ERROR',
140
+ });
141
+ }
135
142
  }
136
143
  //update status from wait to executed
137
144
  await core_1.__(manager.update(NodeInstance_1.default, nodeInstance.nodeInstanceId, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pxp-nd/flow",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "Workflow module for pxp-nd framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",