@pxp-nd/flow 1.0.58 → 1.0.60
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/FlowInstance.d.ts +2 -0
- package/dist/controllers/FlowInstance.js +66 -2
- package/dist/controllers/NodeInstance.d.ts +1 -1
- package/dist/controllers/NodeInstance.js +65 -55
- package/dist/entity/Event.d.ts +1 -0
- package/dist/entity/Event.js +4 -0
- package/dist/entity/FlowLog.d.ts +7 -0
- package/{.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/OriginName.js → dist/entity/FlowLog.js} +13 -21
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/package.json +1 -1
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/README.md +0 -1
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/Action.d.ts +0 -20
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/Action.js +0 -82
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/ActionType.d.ts +0 -17
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/ActionType.js +0 -28
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/Event.d.ts +0 -17
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/Event.js +0 -28
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/FieldMap.d.ts +0 -17
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/FieldMap.js +0 -28
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/Flow.d.ts +0 -24
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/Flow.js +0 -116
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/FlowInstance.d.ts +0 -20
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/FlowInstance.js +0 -78
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/Node.d.ts +0 -23
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/Node.js +0 -273
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/NodeInstance.d.ts +0 -21
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/NodeInstance.js +0 -165
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/OriginName.d.ts +0 -17
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/OriginName.js +0 -28
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/index.d.ts +0 -11
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/index.js +0 -25
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/Action.d.ts +0 -20
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/Action.js +0 -85
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/ActionType.d.ts +0 -16
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/ActionType.js +0 -71
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/Event.d.ts +0 -9
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/Event.js +0 -44
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/FieldMap.d.ts +0 -11
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/FieldMap.js +0 -52
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/Flow.d.ts +0 -14
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/Flow.js +0 -60
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/FlowInstance.d.ts +0 -16
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/FlowInstance.js +0 -69
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/Node.d.ts +0 -23
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/Node.js +0 -93
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/NodeConnection.d.ts +0 -10
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/NodeConnection.js +0 -49
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/NodeInstance.d.ts +0 -13
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/NodeInstance.js +0 -58
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/OriginName.d.ts +0 -9
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/index.d.ts +0 -23
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/index.js +0 -27
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/index.d.ts +0 -3
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/index.js +0 -15
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/subscribers/Event.d.ts +0 -21
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/subscribers/Event.js +0 -83
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/subscribers/index.d.ts +0 -3
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/subscribers/index.js +0 -6
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/package.json +0 -39
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/tsconfig.json +0 -29
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/yalc.sig +0 -1
- package/.yalc/@pxp-nd/flow/README.md +0 -1
- package/.yalc/@pxp-nd/flow/dist/controllers/Action.d.ts +0 -20
- package/.yalc/@pxp-nd/flow/dist/controllers/Action.js +0 -82
- package/.yalc/@pxp-nd/flow/dist/controllers/ActionType.d.ts +0 -17
- package/.yalc/@pxp-nd/flow/dist/controllers/ActionType.js +0 -28
- package/.yalc/@pxp-nd/flow/dist/controllers/Event.d.ts +0 -17
- package/.yalc/@pxp-nd/flow/dist/controllers/Event.js +0 -28
- package/.yalc/@pxp-nd/flow/dist/controllers/FieldMap.d.ts +0 -17
- package/.yalc/@pxp-nd/flow/dist/controllers/FieldMap.js +0 -28
- package/.yalc/@pxp-nd/flow/dist/controllers/Flow.d.ts +0 -33
- package/.yalc/@pxp-nd/flow/dist/controllers/Flow.js +0 -469
- package/.yalc/@pxp-nd/flow/dist/controllers/FlowInstance.d.ts +0 -20
- package/.yalc/@pxp-nd/flow/dist/controllers/FlowInstance.js +0 -84
- package/.yalc/@pxp-nd/flow/dist/controllers/Node.d.ts +0 -23
- package/.yalc/@pxp-nd/flow/dist/controllers/Node.js +0 -273
- package/.yalc/@pxp-nd/flow/dist/controllers/NodeInstance.d.ts +0 -21
- package/.yalc/@pxp-nd/flow/dist/controllers/NodeInstance.js +0 -191
- package/.yalc/@pxp-nd/flow/dist/controllers/OriginName.d.ts +0 -17
- package/.yalc/@pxp-nd/flow/dist/controllers/OriginName.js +0 -28
- package/.yalc/@pxp-nd/flow/dist/controllers/index.d.ts +0 -11
- package/.yalc/@pxp-nd/flow/dist/controllers/index.js +0 -25
- package/.yalc/@pxp-nd/flow/dist/entity/Action.d.ts +0 -20
- package/.yalc/@pxp-nd/flow/dist/entity/Action.js +0 -85
- package/.yalc/@pxp-nd/flow/dist/entity/ActionType.d.ts +0 -16
- package/.yalc/@pxp-nd/flow/dist/entity/ActionType.js +0 -71
- package/.yalc/@pxp-nd/flow/dist/entity/Event.d.ts +0 -9
- package/.yalc/@pxp-nd/flow/dist/entity/Event.js +0 -44
- package/.yalc/@pxp-nd/flow/dist/entity/FieldMap.d.ts +0 -11
- package/.yalc/@pxp-nd/flow/dist/entity/FieldMap.js +0 -52
- package/.yalc/@pxp-nd/flow/dist/entity/Flow.d.ts +0 -14
- package/.yalc/@pxp-nd/flow/dist/entity/Flow.js +0 -60
- package/.yalc/@pxp-nd/flow/dist/entity/FlowInstance.d.ts +0 -16
- package/.yalc/@pxp-nd/flow/dist/entity/FlowInstance.js +0 -69
- package/.yalc/@pxp-nd/flow/dist/entity/Node.d.ts +0 -23
- package/.yalc/@pxp-nd/flow/dist/entity/Node.js +0 -93
- package/.yalc/@pxp-nd/flow/dist/entity/NodeConnection.d.ts +0 -10
- package/.yalc/@pxp-nd/flow/dist/entity/NodeConnection.js +0 -49
- package/.yalc/@pxp-nd/flow/dist/entity/NodeInstance.d.ts +0 -13
- package/.yalc/@pxp-nd/flow/dist/entity/NodeInstance.js +0 -58
- package/.yalc/@pxp-nd/flow/dist/entity/OriginName.d.ts +0 -9
- package/.yalc/@pxp-nd/flow/dist/entity/OriginName.js +0 -43
- package/.yalc/@pxp-nd/flow/dist/entity/index.d.ts +0 -23
- package/.yalc/@pxp-nd/flow/dist/entity/index.js +0 -27
- package/.yalc/@pxp-nd/flow/dist/index.d.ts +0 -3
- package/.yalc/@pxp-nd/flow/dist/index.js +0 -19
- package/.yalc/@pxp-nd/flow/dist/subscribers/Event.d.ts +0 -21
- package/.yalc/@pxp-nd/flow/dist/subscribers/Event.js +0 -84
- package/.yalc/@pxp-nd/flow/dist/subscribers/index.d.ts +0 -3
- package/.yalc/@pxp-nd/flow/dist/subscribers/index.js +0 -6
- package/.yalc/@pxp-nd/flow/package.json +0 -39
- package/.yalc/@pxp-nd/flow/tsconfig.json +0 -29
- package/.yalc/@pxp-nd/flow/yalc.lock +0 -9
- package/.yalc/@pxp-nd/flow/yalc.sig +0 -1
- package/dist/subscribers/Event.d.ts +0 -21
- package/dist/subscribers/Event.js +0 -84
- package/dist/subscribers/index.d.ts +0 -3
- package/dist/subscribers/index.js +0 -6
- package/yalc.lock +0 -9
|
@@ -16,5 +16,7 @@ import { EntityManager } from 'typeorm';
|
|
|
16
16
|
import { Controller } from '@pxp-nd/core';
|
|
17
17
|
declare class FlowInstance extends Controller {
|
|
18
18
|
processPending(params: Record<string, any>, manager: EntityManager): Promise<unknown>;
|
|
19
|
+
eventProcesss(manager: EntityManager): Promise<void>;
|
|
20
|
+
checkConditions(viewData: Record<string, any>, flowId: number, actionId: number): Promise<boolean>;
|
|
19
21
|
}
|
|
20
22
|
export default FlowInstance;
|
|
@@ -33,6 +33,10 @@ const common_1 = require("@pxp-nd/common");
|
|
|
33
33
|
const NodeInstance_1 = __importDefault(require("./NodeInstance"));
|
|
34
34
|
const NodeInstance_2 = __importDefault(require("../entity/NodeInstance"));
|
|
35
35
|
const Node_1 = __importDefault(require("../entity/Node"));
|
|
36
|
+
const Event_1 = __importDefault(require("../entity/Event"));
|
|
37
|
+
const Flow_1 = __importDefault(require("../entity/Flow"));
|
|
38
|
+
const Action_1 = __importDefault(require("../entity/Action"));
|
|
39
|
+
const FlowLog_1 = __importDefault(require("../entity/FlowLog"));
|
|
36
40
|
class FlowInstance extends core_1.Controller {
|
|
37
41
|
async processPending(params, manager) {
|
|
38
42
|
const flag = await common_1.GlobalData.findOne({ data: 'wf_processing_pending_flows_flag' });
|
|
@@ -44,14 +48,15 @@ class FlowInstance extends core_1.Controller {
|
|
|
44
48
|
let flowInstanceIdProcessing = -1;
|
|
45
49
|
await (0, typeorm_1.getManager)().save(flag);
|
|
46
50
|
try {
|
|
51
|
+
await this.eventProcesss(manager);
|
|
47
52
|
const maxFlows = await common_1.GlobalData.findOne({ data: 'wf_max_concurrent_flows_process' });
|
|
48
|
-
const flowInstances = await FlowInstance_1.default
|
|
53
|
+
const flowInstances = await manager.find(FlowInstance_1.default, { take: (maxFlows && maxFlows.value), where: [{ status: 'pending' }], order: { flowInstanceId: "ASC" } });
|
|
49
54
|
for (const flowInstance of flowInstances) {
|
|
50
55
|
flowInstanceIdProcessing = flowInstance.flowInstanceId;
|
|
51
56
|
const node = await Node_1.default.findOne({ where: { actionId: flowInstance.actionId, flowId: flowInstance.flowId } });
|
|
52
57
|
const CNodeInstance = new NodeInstance_1.default('flow-nd', NodeInstance_2.default);
|
|
53
58
|
try {
|
|
54
|
-
await CNodeInstance.RecursiveInstance({ node, flowInstance });
|
|
59
|
+
await CNodeInstance.RecursiveInstance({ node, flowInstance }, manager);
|
|
55
60
|
await manager.update(FlowInstance_1.default, { flowInstanceId: flowInstance.flowInstanceId }, { status: 'processed' });
|
|
56
61
|
}
|
|
57
62
|
catch (error) {
|
|
@@ -64,6 +69,11 @@ class FlowInstance extends core_1.Controller {
|
|
|
64
69
|
catch (error) {
|
|
65
70
|
flag.value = 'false';
|
|
66
71
|
await (0, typeorm_1.getManager)().save(flag);
|
|
72
|
+
const log = new FlowLog_1.default();
|
|
73
|
+
log.errorCustomMessage = `Error executing ${flowInstanceIdProcessing} in FlowInstance-> processPending `;
|
|
74
|
+
log.errorMessage = error.message;
|
|
75
|
+
log.stackTrace = error.stack || '';
|
|
76
|
+
(0, typeorm_1.getManager)().save(log);
|
|
67
77
|
throw new core_1.PxpError(400, 'Error processing flow: ' + flowInstanceIdProcessing);
|
|
68
78
|
}
|
|
69
79
|
flag.value = 'false';
|
|
@@ -71,6 +81,60 @@ class FlowInstance extends core_1.Controller {
|
|
|
71
81
|
}
|
|
72
82
|
return { success: true };
|
|
73
83
|
}
|
|
84
|
+
async eventProcesss(manager) {
|
|
85
|
+
const pendingEvents = await Event_1.default.find({ status: 'pending' });
|
|
86
|
+
for (const newEvent of pendingEvents) {
|
|
87
|
+
const node = await (0, core_1.__)(Node_1.default.find({ where: { actionId: newEvent.actionId, isActive: 1 } }));
|
|
88
|
+
newEvent.status = 'processed';
|
|
89
|
+
await (0, typeorm_1.getManager)().save(newEvent);
|
|
90
|
+
try {
|
|
91
|
+
for (const n of node) {
|
|
92
|
+
//get data of view
|
|
93
|
+
const { action: { originName, originKey }, } = n;
|
|
94
|
+
const executeView = `select * from ${originName} where ${originKey} = ${newEvent.dataId}`;
|
|
95
|
+
const resExecuteView = await (0, typeorm_1.getManager)().query(executeView);
|
|
96
|
+
const flow = await (0, core_1.__)(Flow_1.default.findOne({ where: { flowId: n.flowId, isActive: 1, status: 'on' } }));
|
|
97
|
+
if (flow && flow.vendorId == resExecuteView[0].vendor_id &&
|
|
98
|
+
(await this.checkConditions(resExecuteView[0], n.flowId, newEvent.actionId))) {
|
|
99
|
+
//now check all conditions
|
|
100
|
+
let flowInstance = new FlowInstance_1.default();
|
|
101
|
+
flowInstance.flowId = n.flowId;
|
|
102
|
+
flowInstance.dataId = newEvent.dataId;
|
|
103
|
+
flowInstance.originName = originName;
|
|
104
|
+
flowInstance.originKey = originKey;
|
|
105
|
+
flowInstance.actionId = newEvent.actionId;
|
|
106
|
+
flowInstance.status = "pending";
|
|
107
|
+
flowInstance = await manager.save(FlowInstance_1.default, flowInstance);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
const log = new FlowLog_1.default();
|
|
113
|
+
log.errorCustomMessage = `Error processing event ${newEvent.eventId} in FlowInstance-> eventProcesss `;
|
|
114
|
+
log.errorMessage = error.message;
|
|
115
|
+
log.stackTrace = error.stack || '';
|
|
116
|
+
(0, typeorm_1.getManager)().save(log);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
async checkConditions(viewData, flowId, actionId) {
|
|
121
|
+
const action = await Action_1.default.findOne(actionId);
|
|
122
|
+
const node = await Node_1.default.findOne({ where: { actionId, flowId, isActive: 1 } });
|
|
123
|
+
let res = true;
|
|
124
|
+
if (node && action.eventConfig && node.actionConfigJson) {
|
|
125
|
+
const eventConfig = JSON.parse(action.eventConfig);
|
|
126
|
+
const actionConfigJson = JSON.parse(node.actionConfigJson);
|
|
127
|
+
if (eventConfig.filters) {
|
|
128
|
+
eventConfig.filters.forEach((filter) => {
|
|
129
|
+
if (actionConfigJson[filter.nodeField] &&
|
|
130
|
+
viewData[filter.originField] != actionConfigJson[filter.nodeField]) {
|
|
131
|
+
res = false;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return res;
|
|
137
|
+
}
|
|
74
138
|
}
|
|
75
139
|
__decorate([
|
|
76
140
|
(0, core_1.Post)(),
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import { EntityManager } from "typeorm";
|
|
16
16
|
import { Controller } from "@pxp-nd/core";
|
|
17
17
|
declare class NodeInstance extends Controller {
|
|
18
|
-
RecursiveInstance(params: Record<string, any
|
|
18
|
+
RecursiveInstance(params: Record<string, any>, manager: EntityManager): Promise<unknown>;
|
|
19
19
|
ProcessDelay(params: Record<string, any>, manager: EntityManager): Promise<unknown>;
|
|
20
20
|
}
|
|
21
21
|
export default NodeInstance;
|
|
@@ -32,6 +32,7 @@ const core_1 = require("@pxp-nd/core");
|
|
|
32
32
|
const NodeConnection_1 = __importDefault(require("../entity/NodeConnection"));
|
|
33
33
|
const NodeInstance_1 = __importDefault(require("../entity/NodeInstance"));
|
|
34
34
|
const Node_1 = __importDefault(require("../entity/Node"));
|
|
35
|
+
const FlowLog_1 = __importDefault(require("../entity/FlowLog"));
|
|
35
36
|
const axios_1 = __importDefault(require("axios"));
|
|
36
37
|
const ActionType_1 = __importDefault(require("../entity/ActionType"));
|
|
37
38
|
const Action_1 = __importDefault(require("../entity/Action"));
|
|
@@ -40,70 +41,79 @@ const FlowInstance_1 = __importDefault(require("../entity/FlowInstance"));
|
|
|
40
41
|
//TODO replace this flow-nd need tobe independent library
|
|
41
42
|
const common_1 = require("@pxp-nd/common");
|
|
42
43
|
let NodeInstance = class NodeInstance extends core_1.Controller {
|
|
43
|
-
async RecursiveInstance(params) {
|
|
44
|
+
async RecursiveInstance(params, manager) {
|
|
44
45
|
//https://lodash.com/docs/4.17.15#template
|
|
45
46
|
lodash_1.default.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
|
|
46
47
|
//todo after this we need to get the json variables and execute the view and conditions configured in the database
|
|
47
48
|
const { node, flowInstance, eventNode } = params;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
let nodeInstance = new NodeInstance_1.default();
|
|
65
|
-
nodeInstance.flowInstanceId = flowInstance.flowInstanceId;
|
|
66
|
-
// @ts-ignore
|
|
67
|
-
nodeInstance.nodeId = node.nodeId;
|
|
68
|
-
nodeInstance.runTime = new Date();
|
|
69
|
-
if (node.action.actionType.isDelay === "Y") {
|
|
70
|
-
const delay = node.delay;
|
|
71
|
-
const typeDelay = node.typeDelay;
|
|
72
|
-
nodeInstance.schedule = (0, moment_1.default)().add(delay, typeDelay).toDate();
|
|
73
|
-
nodeInstance.status = "WAIT";
|
|
74
|
-
await (0, typeorm_1.getManager)().save(NodeInstance_1.default, nodeInstance);
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
if (node.action.actionType.controller) {
|
|
78
|
-
const data = "";
|
|
79
|
-
const config = {
|
|
80
|
-
method: "post",
|
|
81
|
-
url: `http://localhost:${process.env.PORT}/api/${node.action.actionType.controller}`,
|
|
82
|
-
headers: {
|
|
83
|
-
Authorization: "" + process.env.TOKEN_PXP_ND + "",
|
|
84
|
-
"Content-Type": "application/json",
|
|
85
|
-
},
|
|
86
|
-
data: mergeJson,
|
|
49
|
+
try {
|
|
50
|
+
const executeView = `select * from ${flowInstance.originName} where ${flowInstance.originKey} = ${flowInstance.dataId}`;
|
|
51
|
+
const resExecuteView = await (0, core_1.__)((0, typeorm_1.getManager)().query(executeView));
|
|
52
|
+
const resultFromOrigin = resExecuteView[0];
|
|
53
|
+
let mergeJson = {};
|
|
54
|
+
const { actionConfigJson, action: { configJsonTemplate, actionType: { schemaJson }, }, } = node;
|
|
55
|
+
if (configJsonTemplate !== "" || actionConfigJson !== "") {
|
|
56
|
+
const actionConfigJsonObject = actionConfigJson &&
|
|
57
|
+
JSON.parse(lodash_1.default.template(actionConfigJson)(resultFromOrigin));
|
|
58
|
+
const configJsonTemplateObject = configJsonTemplate &&
|
|
59
|
+
JSON.parse(lodash_1.default.template(configJsonTemplate)(resultFromOrigin));
|
|
60
|
+
mergeJson = {
|
|
61
|
+
...(configJsonTemplateObject || {}),
|
|
62
|
+
...(actionConfigJsonObject || {}),
|
|
63
|
+
__resultFromOrigin: resultFromOrigin,
|
|
87
64
|
};
|
|
88
|
-
// @ts-ignore
|
|
89
|
-
const resControllerAxios = await (0, core_1.__)((0, axios_1.default)(config));
|
|
90
65
|
}
|
|
91
|
-
|
|
66
|
+
let nodeInstance = new NodeInstance_1.default();
|
|
67
|
+
nodeInstance.flowInstanceId = flowInstance.flowInstanceId;
|
|
92
68
|
// @ts-ignore
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
69
|
+
nodeInstance.nodeId = node.nodeId;
|
|
70
|
+
nodeInstance.runTime = new Date();
|
|
71
|
+
if (node.action.actionType.isDelay === "Y") {
|
|
72
|
+
const delay = node.delay;
|
|
73
|
+
const typeDelay = node.typeDelay;
|
|
74
|
+
nodeInstance.schedule = (0, moment_1.default)().add(delay, typeDelay).toDate();
|
|
75
|
+
nodeInstance.status = "WAIT";
|
|
76
|
+
await manager.save(NodeInstance_1.default, nodeInstance);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
if (node.action.actionType.controller) {
|
|
80
|
+
const data = "";
|
|
81
|
+
const config = {
|
|
82
|
+
method: "post",
|
|
83
|
+
url: `http://localhost:${process.env.PORT}/api/${node.action.actionType.controller}`,
|
|
84
|
+
headers: {
|
|
85
|
+
Authorization: "" + process.env.TOKEN_PXP_ND + "",
|
|
86
|
+
"Content-Type": "application/json",
|
|
87
|
+
},
|
|
88
|
+
data: mergeJson,
|
|
89
|
+
};
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
const resControllerAxios = await (0, core_1.__)((0, axios_1.default)(config));
|
|
92
|
+
}
|
|
93
|
+
await manager.save(NodeInstance_1.default, nodeInstance);
|
|
94
|
+
// @ts-ignore
|
|
95
|
+
const nodeConnectionList = await (0, core_1.__)(NodeConnection_1.default.find({ where: { nodeIdMaster: node.nodeId } }));
|
|
96
|
+
for (const nodeConnection of nodeConnectionList) {
|
|
97
|
+
const condition = lodash_1.default.template(nodeConnection.condition)(resultFromOrigin);
|
|
98
|
+
const evalCondition = eval(condition);
|
|
99
|
+
if (evalCondition) {
|
|
100
|
+
const nodeRes = await (0, core_1.__)(Node_1.default.findOne(nodeConnection.nodeIdChild));
|
|
101
|
+
await this.RecursiveInstance({
|
|
102
|
+
node: nodeRes,
|
|
103
|
+
flowInstance,
|
|
104
|
+
resultFromOrigin,
|
|
105
|
+
}, manager);
|
|
106
|
+
}
|
|
104
107
|
}
|
|
105
108
|
}
|
|
106
109
|
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
const log = new FlowLog_1.default();
|
|
112
|
+
log.errorCustomMessage = `Error executing ${flowInstance.flowInstanceId} in NodeInstance-> RecursiveInstance `;
|
|
113
|
+
log.errorMessage = error.message;
|
|
114
|
+
log.stackTrace = error.stack || '';
|
|
115
|
+
(0, typeorm_1.getManager)().save(log);
|
|
116
|
+
}
|
|
107
117
|
return {};
|
|
108
118
|
}
|
|
109
119
|
async ProcessDelay(params, manager) {
|
|
@@ -150,7 +160,7 @@ let NodeInstance = class NodeInstance extends core_1.Controller {
|
|
|
150
160
|
node: nodeRes,
|
|
151
161
|
flowInstance,
|
|
152
162
|
resultFromOrigin,
|
|
153
|
-
});
|
|
163
|
+
}, manager);
|
|
154
164
|
//update status from wait to executed
|
|
155
165
|
await (0, core_1.__)(manager.update(NodeInstance_1.default, nodeInstance.nodeInstanceId, {
|
|
156
166
|
status: "EXECUTED",
|
package/dist/entity/Event.d.ts
CHANGED
package/dist/entity/Event.js
CHANGED
|
@@ -33,6 +33,10 @@ __decorate([
|
|
|
33
33
|
(0, typeorm_1.Column)({ name: 'data_id', type: 'int', nullable: false }),
|
|
34
34
|
__metadata("design:type", Number)
|
|
35
35
|
], Event.prototype, "dataId", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ name: 'status', type: 'varchar', length: 30, nullable: false, default: 'pending' }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], Event.prototype, "status", void 0);
|
|
36
40
|
__decorate([
|
|
37
41
|
(0, typeorm_1.ManyToOne)(() => Action_1.default, action => action.nodes),
|
|
38
42
|
(0, typeorm_1.JoinColumn)({ name: 'action_id' }),
|
package/{.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/OriginName.js → dist/entity/FlowLog.js}
RENAMED
|
@@ -8,36 +8,28 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
const typeorm_1 = require("typeorm");
|
|
16
|
-
const FieldMap_1 = __importDefault(require("./FieldMap"));
|
|
17
13
|
const common_1 = require("@pxp-nd/common");
|
|
18
|
-
let
|
|
14
|
+
let FlowLog = class FlowLog extends common_1.PxpEntity {
|
|
19
15
|
};
|
|
20
16
|
__decorate([
|
|
21
|
-
typeorm_1.PrimaryGeneratedColumn({ name: '
|
|
17
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({ name: 'flow_log_id' }),
|
|
22
18
|
__metadata("design:type", Number)
|
|
23
|
-
],
|
|
19
|
+
], FlowLog.prototype, "flowLogId", void 0);
|
|
24
20
|
__decorate([
|
|
25
|
-
typeorm_1.Column({ type: 'varchar', nullable: false, length:
|
|
21
|
+
(0, typeorm_1.Column)({ name: 'error_custom_message', type: 'varchar', nullable: false, length: 2000 }),
|
|
26
22
|
__metadata("design:type", String)
|
|
27
|
-
],
|
|
23
|
+
], FlowLog.prototype, "errorCustomMessage", void 0);
|
|
28
24
|
__decorate([
|
|
29
|
-
typeorm_1.Column({ type: '
|
|
25
|
+
(0, typeorm_1.Column)({ name: 'error_message', type: 'varchar', nullable: false, length: 2000 }),
|
|
30
26
|
__metadata("design:type", String)
|
|
31
|
-
],
|
|
27
|
+
], FlowLog.prototype, "errorMessage", void 0);
|
|
32
28
|
__decorate([
|
|
33
|
-
typeorm_1.Column({
|
|
29
|
+
(0, typeorm_1.Column)({ name: 'stack_trace', type: 'text', nullable: true }),
|
|
34
30
|
__metadata("design:type", String)
|
|
35
|
-
],
|
|
36
|
-
__decorate([
|
|
37
|
-
typeorm_1.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
OriginName = __decorate([
|
|
41
|
-
typeorm_1.Entity({ name: 'twf_origin_name' })
|
|
42
|
-
], OriginName);
|
|
43
|
-
exports.default = OriginName;
|
|
31
|
+
], FlowLog.prototype, "stackTrace", void 0);
|
|
32
|
+
FlowLog = __decorate([
|
|
33
|
+
(0, typeorm_1.Entity)({ name: 'twf_flow_log' })
|
|
34
|
+
], FlowLog);
|
|
35
|
+
exports.default = FlowLog;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -16,4 +16,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./entity"), exports);
|
|
18
18
|
__exportStar(require("./controllers"), exports);
|
|
19
|
-
__exportStar(require("./subscribers"), exports);
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# flow-nd
|
|
@@ -1,20 +0,0 @@
|
|
|
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 { EntityManager } from 'typeorm';
|
|
15
|
-
import { Controller } from '@pxp-nd/core';
|
|
16
|
-
declare class Action extends Controller {
|
|
17
|
-
getFieldMapByAction(params: Record<string, any>, manager: EntityManager): Promise<unknown>;
|
|
18
|
-
getActions(params: Record<string, any>, manager: EntityManager): Promise<unknown>;
|
|
19
|
-
}
|
|
20
|
-
export default Action;
|
|
@@ -1,82 +0,0 @@
|
|
|
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
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
22
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
23
|
-
};
|
|
24
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
const typeorm_1 = require("typeorm");
|
|
29
|
-
const core_1 = require("@pxp-nd/core");
|
|
30
|
-
const Action_1 = __importDefault(require("../entity/Action"));
|
|
31
|
-
const FieldMap_1 = __importDefault(require("../entity/FieldMap"));
|
|
32
|
-
const OriginName_1 = __importDefault(require("../entity/OriginName"));
|
|
33
|
-
let Action = class Action extends core_1.Controller {
|
|
34
|
-
async getFieldMapByAction(params, manager) {
|
|
35
|
-
const { originName } = params;
|
|
36
|
-
const fieldMapData = await core_1.__(manager.createQueryBuilder(FieldMap_1.default, 'fm')
|
|
37
|
-
.innerJoin(OriginName_1.default, 'on', 'on.originNameId = fm.originNameId')
|
|
38
|
-
.where("on.name = :n ", { n: originName })
|
|
39
|
-
.getMany());
|
|
40
|
-
return fieldMapData;
|
|
41
|
-
}
|
|
42
|
-
async getActions(params, manager) {
|
|
43
|
-
const { actionTypeName, actionId } = params;
|
|
44
|
-
/* const actionsData = await __(getManager().createQueryBuilder(ActionEntity, 'ae')
|
|
45
|
-
.innerJoin(ActionTypeEntity, 'ate', 'ae.actionTypeId = ate.actionTypeId')
|
|
46
|
-
.where(`ate.name = '${actionTypeName}' `)
|
|
47
|
-
.getMany()
|
|
48
|
-
);*/
|
|
49
|
-
const actionsFind = await Action_1.default.find({
|
|
50
|
-
relations: ['actionType'],
|
|
51
|
-
where: {
|
|
52
|
-
...(actionTypeName ? { actionType: {
|
|
53
|
-
name: actionTypeName
|
|
54
|
-
} } : {}),
|
|
55
|
-
...(actionId ? { actionId: actionId } : {}),
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
return { data: actionsFind };
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
__decorate([
|
|
62
|
-
core_1.Get(),
|
|
63
|
-
core_1.DbSettings('Orm'),
|
|
64
|
-
core_1.ReadOnly(false),
|
|
65
|
-
core_1.Log(true),
|
|
66
|
-
__metadata("design:type", Function),
|
|
67
|
-
__metadata("design:paramtypes", [Object, typeorm_1.EntityManager]),
|
|
68
|
-
__metadata("design:returntype", Promise)
|
|
69
|
-
], Action.prototype, "getFieldMapByAction", null);
|
|
70
|
-
__decorate([
|
|
71
|
-
core_1.Get(),
|
|
72
|
-
core_1.DbSettings('Orm'),
|
|
73
|
-
core_1.ReadOnly(true),
|
|
74
|
-
core_1.Log(true),
|
|
75
|
-
__metadata("design:type", Function),
|
|
76
|
-
__metadata("design:paramtypes", [Object, typeorm_1.EntityManager]),
|
|
77
|
-
__metadata("design:returntype", Promise)
|
|
78
|
-
], Action.prototype, "getActions", null);
|
|
79
|
-
Action = __decorate([
|
|
80
|
-
core_1.Model('flow-nd/Action')
|
|
81
|
-
], Action);
|
|
82
|
-
exports.default = Action;
|
|
@@ -1,17 +0,0 @@
|
|
|
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 ActionType extends Controller {
|
|
16
|
-
}
|
|
17
|
-
export default ActionType;
|
|
@@ -1,28 +0,0 @@
|
|
|
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 ActionType = class ActionType extends core_1.Controller {
|
|
24
|
-
};
|
|
25
|
-
ActionType = __decorate([
|
|
26
|
-
core_1.Model('flow-nd/ActionType')
|
|
27
|
-
], ActionType);
|
|
28
|
-
exports.default = ActionType;
|
|
@@ -1,17 +0,0 @@
|
|
|
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 Event extends Controller {
|
|
16
|
-
}
|
|
17
|
-
export default Event;
|
|
@@ -1,28 +0,0 @@
|
|
|
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 Event = class Event extends core_1.Controller {
|
|
24
|
-
};
|
|
25
|
-
Event = __decorate([
|
|
26
|
-
core_1.Model('flow-nd/Event')
|
|
27
|
-
], Event);
|
|
28
|
-
exports.default = Event;
|
|
@@ -1,17 +0,0 @@
|
|
|
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 FieldMap extends Controller {
|
|
16
|
-
}
|
|
17
|
-
export default FieldMap;
|
|
@@ -1,28 +0,0 @@
|
|
|
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 FieldMap = class FieldMap extends core_1.Controller {
|
|
24
|
-
};
|
|
25
|
-
FieldMap = __decorate([
|
|
26
|
-
core_1.Model('flow-nd/FieldMap')
|
|
27
|
-
], FieldMap);
|
|
28
|
-
exports.default = FieldMap;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Effex 2021
|
|
3
|
-
*
|
|
4
|
-
* MIT
|
|
5
|
-
*
|
|
6
|
-
* Flow Controller
|
|
7
|
-
*
|
|
8
|
-
* @summary Flow Controller
|
|
9
|
-
* @author Jaime Figueroa
|
|
10
|
-
*
|
|
11
|
-
* Created at : 2021-07-08 12:55:38
|
|
12
|
-
* Last modified :
|
|
13
|
-
*/
|
|
14
|
-
import { EntityManager } from 'typeorm';
|
|
15
|
-
import { Controller } from '@pxp-nd/core';
|
|
16
|
-
declare class Flow extends Controller {
|
|
17
|
-
get(params: Record<string, any>): Promise<unknown>;
|
|
18
|
-
copyNodeConnections(nodeId: number, newNodeId: number, newFlowId: number, manager: EntityManager): Promise<void>;
|
|
19
|
-
copyNode(node: Record<any, any>, newFlowId: number, manager: EntityManager): Promise<{
|
|
20
|
-
nodeId: any;
|
|
21
|
-
}>;
|
|
22
|
-
createFlowFromFlow(params: Record<string, any>, manager: EntityManager): Promise<unknown>;
|
|
23
|
-
}
|
|
24
|
-
export default Flow;
|