@pxp-nd/flow 1.0.25 → 1.0.26
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/README.md +1 -1
- package/dist/controllers/Action.d.ts +20 -20
- package/dist/controllers/Action.js +82 -82
- package/dist/controllers/ActionType.d.ts +17 -17
- package/dist/controllers/ActionType.js +28 -28
- package/dist/controllers/Event.d.ts +17 -17
- package/dist/controllers/Event.js +28 -28
- package/dist/controllers/FieldMap.d.ts +17 -17
- package/dist/controllers/FieldMap.js +28 -28
- package/dist/controllers/Flow.d.ts +24 -24
- package/dist/controllers/Flow.js +116 -116
- package/dist/controllers/FlowInstance.d.ts +20 -20
- package/dist/controllers/FlowInstance.js +78 -78
- package/dist/controllers/Node.d.ts +23 -23
- package/dist/controllers/Node.js +273 -273
- package/dist/controllers/NodeInstance.d.ts +21 -21
- package/dist/controllers/NodeInstance.js +165 -165
- package/dist/controllers/OriginName.d.ts +17 -17
- package/dist/controllers/OriginName.js +28 -28
- package/dist/controllers/index.d.ts +11 -11
- package/dist/controllers/index.js +25 -25
- package/dist/entity/Action.d.ts +20 -20
- package/dist/entity/Action.js +85 -85
- package/dist/entity/ActionType.d.ts +16 -16
- package/dist/entity/ActionType.js +71 -71
- package/dist/entity/Event.d.ts +9 -9
- package/dist/entity/Event.js +44 -44
- package/dist/entity/FieldMap.d.ts +11 -11
- package/dist/entity/FieldMap.js +52 -52
- package/dist/entity/Flow.d.ts +14 -14
- package/dist/entity/Flow.js +60 -60
- package/dist/entity/FlowInstance.d.ts +16 -16
- package/dist/entity/FlowInstance.js +69 -69
- package/dist/entity/Node.d.ts +23 -23
- package/dist/entity/Node.js +93 -93
- package/dist/entity/NodeConnection.d.ts +10 -10
- package/dist/entity/NodeConnection.js +49 -49
- package/dist/entity/NodeInstance.d.ts +13 -13
- package/dist/entity/NodeInstance.js +58 -58
- package/dist/entity/OriginName.d.ts +9 -9
- package/dist/entity/OriginName.js +43 -43
- package/dist/entity/index.d.ts +23 -23
- package/dist/entity/index.js +27 -27
- package/dist/index.d.ts +3 -3
- package/dist/index.js +15 -15
- package/dist/subscribers/Event.d.ts +21 -21
- package/dist/subscribers/Event.js +83 -83
- package/dist/subscribers/index.d.ts +3 -3
- package/dist/subscribers/index.js +6 -6
- package/package.json +45 -45
- package/tsconfig.json +29 -29
|
@@ -1,165 +1,165 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Kplian 2021
|
|
4
|
-
*
|
|
5
|
-
* MIT
|
|
6
|
-
*
|
|
7
|
-
* NodeInstance Controller
|
|
8
|
-
*
|
|
9
|
-
* @summary Member Controller
|
|
10
|
-
* @author Favio Figueroa
|
|
11
|
-
* Jaime Rivera
|
|
12
|
-
*
|
|
13
|
-
* Created at : 2021-07-08 12:55:38
|
|
14
|
-
* Last modified :
|
|
15
|
-
*/
|
|
16
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
17
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
19
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
20
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
|
-
};
|
|
22
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
23
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const typeorm_1 = require("typeorm");
|
|
30
|
-
const moment_1 = __importDefault(require("moment"));
|
|
31
|
-
const core_1 = require("@pxp-nd/core");
|
|
32
|
-
const NodeConnection_1 = __importDefault(require("../entity/NodeConnection"));
|
|
33
|
-
const NodeInstance_1 = __importDefault(require("../entity/NodeInstance"));
|
|
34
|
-
const Node_1 = __importDefault(require("../entity/Node"));
|
|
35
|
-
const axios_1 = __importDefault(require("axios"));
|
|
36
|
-
const ActionType_1 = __importDefault(require("../entity/ActionType"));
|
|
37
|
-
const Action_1 = __importDefault(require("../entity/Action"));
|
|
38
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
39
|
-
const FlowInstance_1 = __importDefault(require("../entity/FlowInstance"));
|
|
40
|
-
//TODO replace this flow-nd need tobe independent library
|
|
41
|
-
const common_1 = require("@pxp-nd/common");
|
|
42
|
-
let NodeInstance = class NodeInstance extends core_1.Controller {
|
|
43
|
-
async RecursiveInstance(params) {
|
|
44
|
-
//https://lodash.com/docs/4.17.15#template
|
|
45
|
-
lodash_1.default.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
|
|
46
|
-
//todo after this we need to get the json variables and execute the view and conditions configured in the database
|
|
47
|
-
const { node, flowInstance, eventNode } = params;
|
|
48
|
-
const executeView = `select * from ${flowInstance.originName} where ${flowInstance.originKey} = ${flowInstance.dataId}`;
|
|
49
|
-
const resExecuteView = await core_1.__(typeorm_1.getManager().query(executeView));
|
|
50
|
-
const resultFromOrigin = resExecuteView[0];
|
|
51
|
-
let mergeJson = {};
|
|
52
|
-
const { actionConfigJson, action: { configJsonTemplate, actionType: { schemaJson } } } = node;
|
|
53
|
-
if (configJsonTemplate !== '' || actionConfigJson !== '') {
|
|
54
|
-
const actionConfigJsonObject = actionConfigJson && JSON.parse(lodash_1.default.template(actionConfigJson)(resultFromOrigin));
|
|
55
|
-
const configJsonTemplateObject = configJsonTemplate && JSON.parse(lodash_1.default.template(configJsonTemplate)(resultFromOrigin));
|
|
56
|
-
mergeJson = {
|
|
57
|
-
...(configJsonTemplateObject || {}),
|
|
58
|
-
...(actionConfigJsonObject || {}),
|
|
59
|
-
__resultFromOrigin: resultFromOrigin
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
let nodeInstance = new NodeInstance_1.default();
|
|
63
|
-
nodeInstance.flowInstanceId = flowInstance.flowInstanceId;
|
|
64
|
-
// @ts-ignore
|
|
65
|
-
nodeInstance.nodeId = node.nodeId;
|
|
66
|
-
nodeInstance.runTime = new Date();
|
|
67
|
-
if (node.action.actionType.isDelay === 'Y') {
|
|
68
|
-
const delay = node.delay;
|
|
69
|
-
const typeDelay = node.typeDelay;
|
|
70
|
-
nodeInstance.schedule = moment_1.default().add(delay, typeDelay).toDate();
|
|
71
|
-
nodeInstance.status = 'WAIT';
|
|
72
|
-
await typeorm_1.getManager().save(NodeInstance_1.default, nodeInstance);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
if (node.action.actionType.controller) {
|
|
76
|
-
const data = '';
|
|
77
|
-
const config = {
|
|
78
|
-
method: 'post',
|
|
79
|
-
url: `http://localhost:${process.env.PORT}/api/${node.action.actionType.controller}`,
|
|
80
|
-
headers: {
|
|
81
|
-
'Authorization': '' + process.env.TOKEN_PXP_ND + '',
|
|
82
|
-
'Content-Type': 'application/json'
|
|
83
|
-
},
|
|
84
|
-
data: mergeJson
|
|
85
|
-
};
|
|
86
|
-
// @ts-ignore
|
|
87
|
-
const resControllerAxios = await core_1.__(axios_1.default(config));
|
|
88
|
-
}
|
|
89
|
-
await typeorm_1.getManager().save(NodeInstance_1.default, nodeInstance);
|
|
90
|
-
// @ts-ignore
|
|
91
|
-
const nodeConnectionList = await core_1.__(NodeConnection_1.default.find({ where: { nodeIdMaster: node.nodeId } }));
|
|
92
|
-
for (const nodeConnection of nodeConnectionList) {
|
|
93
|
-
const condition = lodash_1.default.template(nodeConnection.condition)(resultFromOrigin);
|
|
94
|
-
const evalCondition = eval(condition);
|
|
95
|
-
if (evalCondition) {
|
|
96
|
-
const nodeRes = await core_1.__(Node_1.default.findOne(nodeConnection.nodeIdChild));
|
|
97
|
-
await this.RecursiveInstance({ node: nodeRes, flowInstance, resultFromOrigin });
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return {};
|
|
102
|
-
}
|
|
103
|
-
async ProcessDelay(params, manager) {
|
|
104
|
-
const flag = await common_1.GlobalData.findOne({ data: 'wf_processing_delay_nodes_flag' });
|
|
105
|
-
if (flag) {
|
|
106
|
-
if (flag.value == 'true') {
|
|
107
|
-
throw new core_1.PxpError(400, 'Already processing pending flows');
|
|
108
|
-
}
|
|
109
|
-
flag.value = 'true';
|
|
110
|
-
await typeorm_1.getManager().save(flag);
|
|
111
|
-
let nodeInstanceIdProcessing = -1;
|
|
112
|
-
try {
|
|
113
|
-
const maxNodes = await common_1.GlobalData.findOne({ data: 'wf_max_concurrent_delay_process' });
|
|
114
|
-
const nodeInstanceDelayData = await core_1.__(manager.createQueryBuilder(NodeInstance_1.default, 'ni')
|
|
115
|
-
.innerJoin(Node_1.default, 'n', 'n.nodeId = ni.nodeId')
|
|
116
|
-
.innerJoin(Action_1.default, 'a', 'a.actionId = n.actionId')
|
|
117
|
-
.innerJoin(ActionType_1.default, 'at', 'at.actionTypeId = a.actionTypeId')
|
|
118
|
-
.where("at.isDelay = 'Y' ")
|
|
119
|
-
.andWhere('ni.schedule <= :start ', { start: new Date() })
|
|
120
|
-
.andWhere("ni.status = 'WAIT' ")
|
|
121
|
-
.limit((maxNodes && maxNodes.value))
|
|
122
|
-
.getMany());
|
|
123
|
-
for (const nodeInstance of nodeInstanceDelayData) {
|
|
124
|
-
//update status from wait to executing
|
|
125
|
-
await core_1.__(manager.update(NodeInstance_1.default, nodeInstance.nodeInstanceId, {
|
|
126
|
-
status: 'EXECUTING',
|
|
127
|
-
}));
|
|
128
|
-
const nodeConnectionList = await core_1.__(NodeConnection_1.default.find({ where: { nodeIdMaster: nodeInstance.nodeId } }));
|
|
129
|
-
const flowInstance = await core_1.__(FlowInstance_1.default.findOne(nodeInstance.flowInstanceId));
|
|
130
|
-
const resultFromOrigin = JSON.parse(flowInstance.resultFromOrigen);
|
|
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
|
-
for (const nodeConnection of nodeConnectionList) { // todo create transaction for own node
|
|
133
|
-
const nodeRes = await core_1.__(Node_1.default.findOne(nodeConnection.nodeIdChild));
|
|
134
|
-
await this.RecursiveInstance({ node: nodeRes, flowInstance, resultFromOrigin });
|
|
135
|
-
}
|
|
136
|
-
//update status from wait to executed
|
|
137
|
-
await core_1.__(manager.update(NodeInstance_1.default, nodeInstance.nodeInstanceId, {
|
|
138
|
-
status: 'EXECUTED',
|
|
139
|
-
}));
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
catch (error) {
|
|
143
|
-
flag.value = 'false';
|
|
144
|
-
await typeorm_1.getManager().save(flag);
|
|
145
|
-
throw new core_1.PxpError(400, 'Error processing node: ' + nodeInstanceIdProcessing);
|
|
146
|
-
}
|
|
147
|
-
flag.value = 'false';
|
|
148
|
-
await typeorm_1.getManager().save(flag);
|
|
149
|
-
}
|
|
150
|
-
return { success: true };
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
__decorate([
|
|
154
|
-
core_1.Post(),
|
|
155
|
-
core_1.DbSettings('Orm'),
|
|
156
|
-
core_1.ReadOnly(false),
|
|
157
|
-
core_1.Log(true),
|
|
158
|
-
__metadata("design:type", Function),
|
|
159
|
-
__metadata("design:paramtypes", [Object, typeorm_1.EntityManager]),
|
|
160
|
-
__metadata("design:returntype", Promise)
|
|
161
|
-
], NodeInstance.prototype, "ProcessDelay", null);
|
|
162
|
-
NodeInstance = __decorate([
|
|
163
|
-
core_1.Model('flow-nd/NodeInstance')
|
|
164
|
-
], NodeInstance);
|
|
165
|
-
exports.default = NodeInstance;
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Kplian 2021
|
|
4
|
+
*
|
|
5
|
+
* MIT
|
|
6
|
+
*
|
|
7
|
+
* NodeInstance Controller
|
|
8
|
+
*
|
|
9
|
+
* @summary Member Controller
|
|
10
|
+
* @author Favio Figueroa
|
|
11
|
+
* Jaime Rivera
|
|
12
|
+
*
|
|
13
|
+
* Created at : 2021-07-08 12:55:38
|
|
14
|
+
* Last modified :
|
|
15
|
+
*/
|
|
16
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
17
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
19
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
20
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
|
+
};
|
|
22
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
23
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const typeorm_1 = require("typeorm");
|
|
30
|
+
const moment_1 = __importDefault(require("moment"));
|
|
31
|
+
const core_1 = require("@pxp-nd/core");
|
|
32
|
+
const NodeConnection_1 = __importDefault(require("../entity/NodeConnection"));
|
|
33
|
+
const NodeInstance_1 = __importDefault(require("../entity/NodeInstance"));
|
|
34
|
+
const Node_1 = __importDefault(require("../entity/Node"));
|
|
35
|
+
const axios_1 = __importDefault(require("axios"));
|
|
36
|
+
const ActionType_1 = __importDefault(require("../entity/ActionType"));
|
|
37
|
+
const Action_1 = __importDefault(require("../entity/Action"));
|
|
38
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
39
|
+
const FlowInstance_1 = __importDefault(require("../entity/FlowInstance"));
|
|
40
|
+
//TODO replace this flow-nd need tobe independent library
|
|
41
|
+
const common_1 = require("@pxp-nd/common");
|
|
42
|
+
let NodeInstance = class NodeInstance extends core_1.Controller {
|
|
43
|
+
async RecursiveInstance(params) {
|
|
44
|
+
//https://lodash.com/docs/4.17.15#template
|
|
45
|
+
lodash_1.default.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
|
|
46
|
+
//todo after this we need to get the json variables and execute the view and conditions configured in the database
|
|
47
|
+
const { node, flowInstance, eventNode } = params;
|
|
48
|
+
const executeView = `select * from ${flowInstance.originName} where ${flowInstance.originKey} = ${flowInstance.dataId}`;
|
|
49
|
+
const resExecuteView = await core_1.__(typeorm_1.getManager().query(executeView));
|
|
50
|
+
const resultFromOrigin = resExecuteView[0];
|
|
51
|
+
let mergeJson = {};
|
|
52
|
+
const { actionConfigJson, action: { configJsonTemplate, actionType: { schemaJson } } } = node;
|
|
53
|
+
if (configJsonTemplate !== '' || actionConfigJson !== '') {
|
|
54
|
+
const actionConfigJsonObject = actionConfigJson && JSON.parse(lodash_1.default.template(actionConfigJson)(resultFromOrigin));
|
|
55
|
+
const configJsonTemplateObject = configJsonTemplate && JSON.parse(lodash_1.default.template(configJsonTemplate)(resultFromOrigin));
|
|
56
|
+
mergeJson = {
|
|
57
|
+
...(configJsonTemplateObject || {}),
|
|
58
|
+
...(actionConfigJsonObject || {}),
|
|
59
|
+
__resultFromOrigin: resultFromOrigin
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
let nodeInstance = new NodeInstance_1.default();
|
|
63
|
+
nodeInstance.flowInstanceId = flowInstance.flowInstanceId;
|
|
64
|
+
// @ts-ignore
|
|
65
|
+
nodeInstance.nodeId = node.nodeId;
|
|
66
|
+
nodeInstance.runTime = new Date();
|
|
67
|
+
if (node.action.actionType.isDelay === 'Y') {
|
|
68
|
+
const delay = node.delay;
|
|
69
|
+
const typeDelay = node.typeDelay;
|
|
70
|
+
nodeInstance.schedule = moment_1.default().add(delay, typeDelay).toDate();
|
|
71
|
+
nodeInstance.status = 'WAIT';
|
|
72
|
+
await typeorm_1.getManager().save(NodeInstance_1.default, nodeInstance);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
if (node.action.actionType.controller) {
|
|
76
|
+
const data = '';
|
|
77
|
+
const config = {
|
|
78
|
+
method: 'post',
|
|
79
|
+
url: `http://localhost:${process.env.PORT}/api/${node.action.actionType.controller}`,
|
|
80
|
+
headers: {
|
|
81
|
+
'Authorization': '' + process.env.TOKEN_PXP_ND + '',
|
|
82
|
+
'Content-Type': 'application/json'
|
|
83
|
+
},
|
|
84
|
+
data: mergeJson
|
|
85
|
+
};
|
|
86
|
+
// @ts-ignore
|
|
87
|
+
const resControllerAxios = await core_1.__(axios_1.default(config));
|
|
88
|
+
}
|
|
89
|
+
await typeorm_1.getManager().save(NodeInstance_1.default, nodeInstance);
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
const nodeConnectionList = await core_1.__(NodeConnection_1.default.find({ where: { nodeIdMaster: node.nodeId } }));
|
|
92
|
+
for (const nodeConnection of nodeConnectionList) {
|
|
93
|
+
const condition = lodash_1.default.template(nodeConnection.condition)(resultFromOrigin);
|
|
94
|
+
const evalCondition = eval(condition);
|
|
95
|
+
if (evalCondition) {
|
|
96
|
+
const nodeRes = await core_1.__(Node_1.default.findOne(nodeConnection.nodeIdChild));
|
|
97
|
+
await this.RecursiveInstance({ node: nodeRes, flowInstance, resultFromOrigin });
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return {};
|
|
102
|
+
}
|
|
103
|
+
async ProcessDelay(params, manager) {
|
|
104
|
+
const flag = await common_1.GlobalData.findOne({ data: 'wf_processing_delay_nodes_flag' });
|
|
105
|
+
if (flag) {
|
|
106
|
+
if (flag.value == 'true') {
|
|
107
|
+
throw new core_1.PxpError(400, 'Already processing pending flows');
|
|
108
|
+
}
|
|
109
|
+
flag.value = 'true';
|
|
110
|
+
await typeorm_1.getManager().save(flag);
|
|
111
|
+
let nodeInstanceIdProcessing = -1;
|
|
112
|
+
try {
|
|
113
|
+
const maxNodes = await common_1.GlobalData.findOne({ data: 'wf_max_concurrent_delay_process' });
|
|
114
|
+
const nodeInstanceDelayData = await core_1.__(manager.createQueryBuilder(NodeInstance_1.default, 'ni')
|
|
115
|
+
.innerJoin(Node_1.default, 'n', 'n.nodeId = ni.nodeId')
|
|
116
|
+
.innerJoin(Action_1.default, 'a', 'a.actionId = n.actionId')
|
|
117
|
+
.innerJoin(ActionType_1.default, 'at', 'at.actionTypeId = a.actionTypeId')
|
|
118
|
+
.where("at.isDelay = 'Y' ")
|
|
119
|
+
.andWhere('ni.schedule <= :start ', { start: new Date() })
|
|
120
|
+
.andWhere("ni.status = 'WAIT' ")
|
|
121
|
+
.limit((maxNodes && maxNodes.value))
|
|
122
|
+
.getMany());
|
|
123
|
+
for (const nodeInstance of nodeInstanceDelayData) {
|
|
124
|
+
//update status from wait to executing
|
|
125
|
+
await core_1.__(manager.update(NodeInstance_1.default, nodeInstance.nodeInstanceId, {
|
|
126
|
+
status: 'EXECUTING',
|
|
127
|
+
}));
|
|
128
|
+
const nodeConnectionList = await core_1.__(NodeConnection_1.default.find({ where: { nodeIdMaster: nodeInstance.nodeId } }));
|
|
129
|
+
const flowInstance = await core_1.__(FlowInstance_1.default.findOne(nodeInstance.flowInstanceId));
|
|
130
|
+
const resultFromOrigin = JSON.parse(flowInstance.resultFromOrigen);
|
|
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
|
+
for (const nodeConnection of nodeConnectionList) { // todo create transaction for own node
|
|
133
|
+
const nodeRes = await core_1.__(Node_1.default.findOne(nodeConnection.nodeIdChild));
|
|
134
|
+
await this.RecursiveInstance({ node: nodeRes, flowInstance, resultFromOrigin });
|
|
135
|
+
}
|
|
136
|
+
//update status from wait to executed
|
|
137
|
+
await core_1.__(manager.update(NodeInstance_1.default, nodeInstance.nodeInstanceId, {
|
|
138
|
+
status: 'EXECUTED',
|
|
139
|
+
}));
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
flag.value = 'false';
|
|
144
|
+
await typeorm_1.getManager().save(flag);
|
|
145
|
+
throw new core_1.PxpError(400, 'Error processing node: ' + nodeInstanceIdProcessing);
|
|
146
|
+
}
|
|
147
|
+
flag.value = 'false';
|
|
148
|
+
await typeorm_1.getManager().save(flag);
|
|
149
|
+
}
|
|
150
|
+
return { success: true };
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
__decorate([
|
|
154
|
+
core_1.Post(),
|
|
155
|
+
core_1.DbSettings('Orm'),
|
|
156
|
+
core_1.ReadOnly(false),
|
|
157
|
+
core_1.Log(true),
|
|
158
|
+
__metadata("design:type", Function),
|
|
159
|
+
__metadata("design:paramtypes", [Object, typeorm_1.EntityManager]),
|
|
160
|
+
__metadata("design:returntype", Promise)
|
|
161
|
+
], NodeInstance.prototype, "ProcessDelay", null);
|
|
162
|
+
NodeInstance = __decorate([
|
|
163
|
+
core_1.Model('flow-nd/NodeInstance')
|
|
164
|
+
], NodeInstance);
|
|
165
|
+
exports.default = NodeInstance;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Effex 2021
|
|
3
|
-
*
|
|
4
|
-
* MIT
|
|
5
|
-
*
|
|
6
|
-
* Member Controller
|
|
7
|
-
*
|
|
8
|
-
* @summary Member Controller
|
|
9
|
-
* @author Favio Figueroa
|
|
10
|
-
*
|
|
11
|
-
* Created at : 2021-07-08 12:55:38
|
|
12
|
-
* Last modified :
|
|
13
|
-
*/
|
|
14
|
-
import { Controller } from '@pxp-nd/core';
|
|
15
|
-
declare class OriginName extends Controller {
|
|
16
|
-
}
|
|
17
|
-
export default OriginName;
|
|
1
|
+
/**
|
|
2
|
+
* Effex 2021
|
|
3
|
+
*
|
|
4
|
+
* MIT
|
|
5
|
+
*
|
|
6
|
+
* Member Controller
|
|
7
|
+
*
|
|
8
|
+
* @summary Member Controller
|
|
9
|
+
* @author Favio Figueroa
|
|
10
|
+
*
|
|
11
|
+
* Created at : 2021-07-08 12:55:38
|
|
12
|
+
* Last modified :
|
|
13
|
+
*/
|
|
14
|
+
import { Controller } from '@pxp-nd/core';
|
|
15
|
+
declare class OriginName extends Controller {
|
|
16
|
+
}
|
|
17
|
+
export default OriginName;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Effex 2021
|
|
4
|
-
*
|
|
5
|
-
* MIT
|
|
6
|
-
*
|
|
7
|
-
* Member Controller
|
|
8
|
-
*
|
|
9
|
-
* @summary Member Controller
|
|
10
|
-
* @author Favio Figueroa
|
|
11
|
-
*
|
|
12
|
-
* Created at : 2021-07-08 12:55:38
|
|
13
|
-
* Last modified :
|
|
14
|
-
*/
|
|
15
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
16
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
18
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
19
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
20
|
-
};
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
const core_1 = require("@pxp-nd/core");
|
|
23
|
-
let OriginName = class OriginName extends core_1.Controller {
|
|
24
|
-
};
|
|
25
|
-
OriginName = __decorate([
|
|
26
|
-
core_1.Model('flow-nd/OriginName')
|
|
27
|
-
], OriginName);
|
|
28
|
-
exports.default = OriginName;
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Effex 2021
|
|
4
|
+
*
|
|
5
|
+
* MIT
|
|
6
|
+
*
|
|
7
|
+
* Member Controller
|
|
8
|
+
*
|
|
9
|
+
* @summary Member Controller
|
|
10
|
+
* @author Favio Figueroa
|
|
11
|
+
*
|
|
12
|
+
* Created at : 2021-07-08 12:55:38
|
|
13
|
+
* Last modified :
|
|
14
|
+
*/
|
|
15
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
16
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
18
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
19
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
const core_1 = require("@pxp-nd/core");
|
|
23
|
+
let OriginName = class OriginName extends core_1.Controller {
|
|
24
|
+
};
|
|
25
|
+
OriginName = __decorate([
|
|
26
|
+
core_1.Model('flow-nd/OriginName')
|
|
27
|
+
], OriginName);
|
|
28
|
+
exports.default = OriginName;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import ActionController from './Action';
|
|
2
|
-
import ActionTypeController from './ActionType';
|
|
3
|
-
import EventController from './Event';
|
|
4
|
-
import FieldMapController from './FieldMap';
|
|
5
|
-
import FlowController from './Flow';
|
|
6
|
-
import FlowInstanceController from './FlowInstance';
|
|
7
|
-
import NodeController from './Node';
|
|
8
|
-
import NodeInstanceController from './NodeInstance';
|
|
9
|
-
import OriginNameController from './OriginName';
|
|
10
|
-
export { ActionController, ActionTypeController, EventController, FieldMapController, FlowController, FlowInstanceController, NodeController, NodeInstanceController, OriginNameController };
|
|
11
|
-
export declare const controllers: (typeof ActionTypeController)[];
|
|
1
|
+
import ActionController from './Action';
|
|
2
|
+
import ActionTypeController from './ActionType';
|
|
3
|
+
import EventController from './Event';
|
|
4
|
+
import FieldMapController from './FieldMap';
|
|
5
|
+
import FlowController from './Flow';
|
|
6
|
+
import FlowInstanceController from './FlowInstance';
|
|
7
|
+
import NodeController from './Node';
|
|
8
|
+
import NodeInstanceController from './NodeInstance';
|
|
9
|
+
import OriginNameController from './OriginName';
|
|
10
|
+
export { ActionController, ActionTypeController, EventController, FieldMapController, FlowController, FlowInstanceController, NodeController, NodeInstanceController, OriginNameController };
|
|
11
|
+
export declare const controllers: (typeof ActionTypeController)[];
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.controllers = exports.OriginNameController = exports.NodeInstanceController = exports.NodeController = exports.FlowInstanceController = exports.FlowController = exports.FieldMapController = exports.EventController = exports.ActionTypeController = exports.ActionController = void 0;
|
|
7
|
-
const Action_1 = __importDefault(require("./Action"));
|
|
8
|
-
exports.ActionController = Action_1.default;
|
|
9
|
-
const ActionType_1 = __importDefault(require("./ActionType"));
|
|
10
|
-
exports.ActionTypeController = ActionType_1.default;
|
|
11
|
-
const Event_1 = __importDefault(require("./Event"));
|
|
12
|
-
exports.EventController = Event_1.default;
|
|
13
|
-
const FieldMap_1 = __importDefault(require("./FieldMap"));
|
|
14
|
-
exports.FieldMapController = FieldMap_1.default;
|
|
15
|
-
const Flow_1 = __importDefault(require("./Flow"));
|
|
16
|
-
exports.FlowController = Flow_1.default;
|
|
17
|
-
const FlowInstance_1 = __importDefault(require("./FlowInstance"));
|
|
18
|
-
exports.FlowInstanceController = FlowInstance_1.default;
|
|
19
|
-
const Node_1 = __importDefault(require("./Node"));
|
|
20
|
-
exports.NodeController = Node_1.default;
|
|
21
|
-
const NodeInstance_1 = __importDefault(require("./NodeInstance"));
|
|
22
|
-
exports.NodeInstanceController = NodeInstance_1.default;
|
|
23
|
-
const OriginName_1 = __importDefault(require("./OriginName"));
|
|
24
|
-
exports.OriginNameController = OriginName_1.default;
|
|
25
|
-
exports.controllers = [Action_1.default, ActionType_1.default, Event_1.default, FieldMap_1.default, Flow_1.default, FlowInstance_1.default, Node_1.default, NodeInstance_1.default, OriginName_1.default];
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.controllers = exports.OriginNameController = exports.NodeInstanceController = exports.NodeController = exports.FlowInstanceController = exports.FlowController = exports.FieldMapController = exports.EventController = exports.ActionTypeController = exports.ActionController = void 0;
|
|
7
|
+
const Action_1 = __importDefault(require("./Action"));
|
|
8
|
+
exports.ActionController = Action_1.default;
|
|
9
|
+
const ActionType_1 = __importDefault(require("./ActionType"));
|
|
10
|
+
exports.ActionTypeController = ActionType_1.default;
|
|
11
|
+
const Event_1 = __importDefault(require("./Event"));
|
|
12
|
+
exports.EventController = Event_1.default;
|
|
13
|
+
const FieldMap_1 = __importDefault(require("./FieldMap"));
|
|
14
|
+
exports.FieldMapController = FieldMap_1.default;
|
|
15
|
+
const Flow_1 = __importDefault(require("./Flow"));
|
|
16
|
+
exports.FlowController = Flow_1.default;
|
|
17
|
+
const FlowInstance_1 = __importDefault(require("./FlowInstance"));
|
|
18
|
+
exports.FlowInstanceController = FlowInstance_1.default;
|
|
19
|
+
const Node_1 = __importDefault(require("./Node"));
|
|
20
|
+
exports.NodeController = Node_1.default;
|
|
21
|
+
const NodeInstance_1 = __importDefault(require("./NodeInstance"));
|
|
22
|
+
exports.NodeInstanceController = NodeInstance_1.default;
|
|
23
|
+
const OriginName_1 = __importDefault(require("./OriginName"));
|
|
24
|
+
exports.OriginNameController = OriginName_1.default;
|
|
25
|
+
exports.controllers = [Action_1.default, ActionType_1.default, Event_1.default, FieldMap_1.default, Flow_1.default, FlowInstance_1.default, Node_1.default, NodeInstance_1.default, OriginName_1.default];
|
package/dist/entity/Action.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import ActionType from './ActionType';
|
|
2
|
-
import Node from './Node';
|
|
3
|
-
import { PxpEntity } from '@pxp-nd/common';
|
|
4
|
-
export default class Action extends PxpEntity {
|
|
5
|
-
actionId: number;
|
|
6
|
-
actionTypeId: number;
|
|
7
|
-
code: string;
|
|
8
|
-
name: string;
|
|
9
|
-
description: string;
|
|
10
|
-
originName: string;
|
|
11
|
-
originKey: string;
|
|
12
|
-
controllerFunction: string;
|
|
13
|
-
configJsonTemplate: string;
|
|
14
|
-
eventConfig: string;
|
|
15
|
-
hidden: string;
|
|
16
|
-
schemaJson: string;
|
|
17
|
-
actionType: ActionType;
|
|
18
|
-
nodes: Node[];
|
|
19
|
-
eventNodes: Node[];
|
|
20
|
-
}
|
|
1
|
+
import ActionType from './ActionType';
|
|
2
|
+
import Node from './Node';
|
|
3
|
+
import { PxpEntity } from '@pxp-nd/common';
|
|
4
|
+
export default class Action extends PxpEntity {
|
|
5
|
+
actionId: number;
|
|
6
|
+
actionTypeId: number;
|
|
7
|
+
code: string;
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
originName: string;
|
|
11
|
+
originKey: string;
|
|
12
|
+
controllerFunction: string;
|
|
13
|
+
configJsonTemplate: string;
|
|
14
|
+
eventConfig: string;
|
|
15
|
+
hidden: string;
|
|
16
|
+
schemaJson: string;
|
|
17
|
+
actionType: ActionType;
|
|
18
|
+
nodes: Node[];
|
|
19
|
+
eventNodes: Node[];
|
|
20
|
+
}
|