@pxp-nd/flow 1.0.83 → 1.0.85
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.d.ts +0 -1
- package/dist/controllers/Flow.js +6 -20
- package/dist/controllers/Node.js +3 -0
- package/dist/entity/Flow.d.ts +0 -1
- package/dist/entity/Flow.js +2 -15
- 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/OriginName.js +0 -43
- 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/yalc.lock +0 -9
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
* 01-Sep-2023 SP08SEP23 Rensi Arteaga add base flow list
|
|
18
18
|
* 16-Sep-2023 SP22SEP23 Mercedes Zambrana Change GET to POST in insertEventFlow
|
|
19
19
|
* 28-Sep-2023 SP06OCT23 Mercedes Zambrana Add Validation when change off status (validateFlow, deleteflow, saveFlow, saveflowName)
|
|
20
|
-
* 20-Feb-2024 SP01MAR24 Mercedes Zambrana Add in getFlowRender, insertEventFlow condition for at.name=PAGE
|
|
21
20
|
* ******************************************************************************
|
|
22
21
|
*/
|
|
23
22
|
import { EntityManager } from 'typeorm';
|
package/dist/controllers/Flow.js
CHANGED
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
* 01-Sep-2023 SP08SEP23 Rensi Arteaga add base flow list
|
|
19
19
|
* 16-Sep-2023 SP22SEP23 Mercedes Zambrana Change GET to POST in insertEventFlow
|
|
20
20
|
* 28-Sep-2023 SP06OCT23 Mercedes Zambrana Add Validation when change off status (validateFlow, deleteflow, saveFlow, saveflowName)
|
|
21
|
-
* 20-Feb-2024 SP01MAR24 Mercedes Zambrana Add in getFlowRender, insertEventFlow condition for at.name=PAGE
|
|
22
21
|
* ******************************************************************************
|
|
23
22
|
*/
|
|
24
23
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
@@ -107,7 +106,6 @@ let Flow = class Flow extends core_1.Controller {
|
|
|
107
106
|
// insert new node
|
|
108
107
|
const newNode = new Node_1.default();
|
|
109
108
|
const { nodeId, flowId, createdAt, modifiedAt, ...nodeToCopy } = node;
|
|
110
|
-
//for each node, get schema_json from action_type. So, if has templateId check in configGetDescValue the parameter storeId
|
|
111
109
|
Object.assign(newNode, { ...nodeToCopy, flowId: newFlowId });
|
|
112
110
|
const insertNewNode = await (0, core_1.__)(manager.save(Node_1.default, newNode));
|
|
113
111
|
if (isFirst) {
|
|
@@ -368,37 +366,25 @@ let Flow = class Flow extends core_1.Controller {
|
|
|
368
366
|
return { success: true, nodeId: newId };
|
|
369
367
|
}
|
|
370
368
|
async getFlowRender(params) {
|
|
371
|
-
var _a
|
|
369
|
+
var _a;
|
|
372
370
|
const flow = await (0, typeorm_1.getManager)().findOne(Flow_1.default, params.flowId);
|
|
373
371
|
const totalNodes = await (0, typeorm_1.getManager)()
|
|
374
372
|
.createQueryBuilder(Node_1.default, "n")
|
|
375
373
|
.select([
|
|
376
374
|
"n.nodeId",
|
|
377
|
-
"a.originName"
|
|
378
|
-
"a.actionId"
|
|
375
|
+
"a.originName"
|
|
379
376
|
])
|
|
380
377
|
.innerJoin("n.action", "a")
|
|
381
378
|
.where(`n.isActive = 1 and n.flowId = :flowId`, { flowId: params.flowId })
|
|
382
379
|
.getOne();
|
|
383
380
|
let cond = " and 0=0";
|
|
384
381
|
if (!totalNodes) {
|
|
385
|
-
cond = " and
|
|
382
|
+
cond = " and at.name= 'EVENT' ";
|
|
386
383
|
}
|
|
387
384
|
else {
|
|
388
385
|
const oName = (_a = totalNodes === null || totalNodes === void 0 ? void 0 : totalNodes.action) === null || _a === void 0 ? void 0 : _a.originName;
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
select at.name
|
|
392
|
-
from twf_action a
|
|
393
|
-
inner join twf_action_type at on at.action_type_id = a.action_type_id
|
|
394
|
-
where a.action_id = ${(_c = totalNodes === null || totalNodes === void 0 ? void 0 : totalNodes.action) === null || _c === void 0 ? void 0 : _c.actionId}
|
|
395
|
-
`);
|
|
396
|
-
if (actionTypePage[0].name == 'PAGE') {
|
|
397
|
-
cond = `and a.code = 'BRIDGE' and at.name='PAGE'`;
|
|
398
|
-
}
|
|
399
|
-
else {
|
|
400
|
-
cond = `and (at.name not in ('EVENT','PAGE')) and (a.originName is null or a.originName = '${oName}') `;
|
|
401
|
-
}
|
|
386
|
+
//
|
|
387
|
+
cond = `and at.name != 'EVENT' and (a.originName is null or a.originName = '${oName}')`;
|
|
402
388
|
}
|
|
403
389
|
let actions = await (0, typeorm_1.getManager)()
|
|
404
390
|
.createQueryBuilder(Action_1.default, "a")
|
|
@@ -514,7 +500,7 @@ let Flow = class Flow extends core_1.Controller {
|
|
|
514
500
|
"a.actionId"
|
|
515
501
|
])
|
|
516
502
|
.innerJoin("a.actionType", "at")
|
|
517
|
-
.where(`a.isActive = 1 and a.hidden = 'N' and at.name
|
|
503
|
+
.where(`a.isActive = 1 and a.hidden = 'N' and at.name = 'EVENT' and at.isActive = 1 `, { actionId: params.actionId })
|
|
518
504
|
.getMany();
|
|
519
505
|
if (action) {
|
|
520
506
|
const newNode = manager.create(Node_1.default, {
|
package/dist/controllers/Node.js
CHANGED
|
@@ -223,6 +223,9 @@ let Node = class Node extends core_1.Controller {
|
|
|
223
223
|
...(descValue && { descValue: descValue }),
|
|
224
224
|
...(verifyIfValueFromFieldMap(value) && { fromFieldMap: true, ...findFieldMapAndMetaData(value) }),
|
|
225
225
|
};
|
|
226
|
+
if (schemaJsonObject[nameKey].hidden === true) {
|
|
227
|
+
schemaJsonObject[nameKey].initialValue = value;
|
|
228
|
+
}
|
|
226
229
|
}
|
|
227
230
|
}
|
|
228
231
|
//console.log('111 schemaJsonObject',schemaJsonObject)
|
package/dist/entity/Flow.d.ts
CHANGED
package/dist/entity/Flow.js
CHANGED
|
@@ -11,7 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
|
-
var Flow_1;
|
|
15
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
15
|
/*****************************************************************************
|
|
17
16
|
* Copyright(c) 2023 Qorus Inc
|
|
@@ -29,13 +28,7 @@ const typeorm_1 = require("typeorm");
|
|
|
29
28
|
const FlowInstance_1 = __importDefault(require("./FlowInstance"));
|
|
30
29
|
const Node_1 = __importDefault(require("./Node"));
|
|
31
30
|
const common_1 = require("@pxp-nd/common");
|
|
32
|
-
let Flow =
|
|
33
|
-
async validateName() {
|
|
34
|
-
const existingFlow = await Flow_1.findOne({ where: { name: this.name, vendorId: this.vendorId } });
|
|
35
|
-
if (existingFlow) {
|
|
36
|
-
throw new Error('Name in use.');
|
|
37
|
-
}
|
|
38
|
-
}
|
|
31
|
+
let Flow = class Flow extends common_1.PxpEntity {
|
|
39
32
|
};
|
|
40
33
|
__decorate([
|
|
41
34
|
(0, typeorm_1.PrimaryGeneratedColumn)({ name: 'flow_id' }),
|
|
@@ -93,13 +86,7 @@ __decorate([
|
|
|
93
86
|
(0, typeorm_1.Column)({ name: 'template_type', type: 'varchar', nullable: false, length: 15 }),
|
|
94
87
|
__metadata("design:type", String)
|
|
95
88
|
], Flow.prototype, "templateType", void 0);
|
|
96
|
-
__decorate([
|
|
97
|
-
(0, typeorm_1.BeforeInsert)(),
|
|
98
|
-
__metadata("design:type", Function),
|
|
99
|
-
__metadata("design:paramtypes", []),
|
|
100
|
-
__metadata("design:returntype", Promise)
|
|
101
|
-
], Flow.prototype, "validateName", null);
|
|
102
|
-
Flow = Flow_1 = __decorate([
|
|
89
|
+
Flow = __decorate([
|
|
103
90
|
(0, typeorm_1.Entity)({ name: 'twf_flow' })
|
|
104
91
|
], Flow);
|
|
105
92
|
exports.default = Flow;
|
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;
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Effex 2021
|
|
4
|
-
*
|
|
5
|
-
* MIT
|
|
6
|
-
*
|
|
7
|
-
* Flow Controller
|
|
8
|
-
*
|
|
9
|
-
* @summary Flow Controller
|
|
10
|
-
* @author Jaime 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 Node_1 = __importDefault(require("../entity/Node"));
|
|
31
|
-
const NodeConnection_1 = __importDefault(require("../entity/NodeConnection"));
|
|
32
|
-
const Flow_1 = __importDefault(require("../entity/Flow"));
|
|
33
|
-
let Flow = class Flow extends core_1.Controller {
|
|
34
|
-
async get(params) {
|
|
35
|
-
const nodes = await Node_1.default.find({ flowId: params.flowId });
|
|
36
|
-
const restNodes = [];
|
|
37
|
-
for (let node of nodes) {
|
|
38
|
-
const { actionConfigJson, action: { actionType: { schemaJson } } } = node;
|
|
39
|
-
const actionConfigJsonObject = actionConfigJson ? JSON.parse(actionConfigJson) : {};
|
|
40
|
-
const schemaJsonObject = schemaJson ? JSON.parse(schemaJson) : {};
|
|
41
|
-
const valuesForShowingInNode = {};
|
|
42
|
-
Object.entries(schemaJsonObject).filter(([n, sjo]) => sjo.showInNode === true).forEach(([nameKey, json]) => {
|
|
43
|
-
valuesForShowingInNode[nameKey] = {
|
|
44
|
-
label: json.label,
|
|
45
|
-
value: actionConfigJsonObject[nameKey] || null
|
|
46
|
-
};
|
|
47
|
-
});
|
|
48
|
-
const nodeRow = {
|
|
49
|
-
...node,
|
|
50
|
-
valuesForShowingInNode
|
|
51
|
-
};
|
|
52
|
-
const connections = await NodeConnection_1.default.find({ nodeIdMaster: node.nodeId });
|
|
53
|
-
restNodes.push({ node: nodeRow, connections: connections.map(c => c.nodeIdChild) });
|
|
54
|
-
}
|
|
55
|
-
return restNodes;
|
|
56
|
-
}
|
|
57
|
-
async copyNodeConnections(nodeId, newNodeId, newFlowId, manager) {
|
|
58
|
-
const connections = await core_1.__(NodeConnection_1.default.find({ nodeIdMaster: nodeId }));
|
|
59
|
-
for (let connection of connections) {
|
|
60
|
-
const newNodeConnection = new NodeConnection_1.default();
|
|
61
|
-
const { nodeConnectionId, nodeIdMaster, nodeIdChild, createdAt, modifiedAt, ...nodeConnectionToCopy } = connection;
|
|
62
|
-
// get node from nodeIdChild
|
|
63
|
-
const dataNodeChild = await Node_1.default.findOne({ nodeId: connection.nodeIdChild });
|
|
64
|
-
const { nodeId: newNodeIdChild } = await this.copyNode(dataNodeChild, newFlowId, manager);
|
|
65
|
-
Object.assign(newNodeConnection, { ...nodeConnectionToCopy, nodeIdMaster: newNodeId, nodeIdChild: newNodeIdChild });
|
|
66
|
-
const insertNewNodeConnection = await core_1.__(manager.save(NodeConnection_1.default, newNodeConnection));
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
async copyNode(node, newFlowId, manager) {
|
|
70
|
-
// insert new node
|
|
71
|
-
const newNode = new Node_1.default();
|
|
72
|
-
const { nodeId, flowId, createdAt, modifiedAt, actionConfigJson, ...nodeToCopy } = node;
|
|
73
|
-
Object.assign(newNode, { ...nodeToCopy, flowId: newFlowId });
|
|
74
|
-
const insertNewNode = await core_1.__(manager.save(Node_1.default, newNode));
|
|
75
|
-
// insert connection
|
|
76
|
-
await this.copyNodeConnections(node.nodeId, insertNewNode.nodeId, newFlowId, manager);
|
|
77
|
-
return { nodeId: insertNewNode.nodeId };
|
|
78
|
-
}
|
|
79
|
-
async createFlowFromFlow(params, manager) {
|
|
80
|
-
// we need clone the flow selected
|
|
81
|
-
const dataFlow = await core_1.__(Flow_1.default.findOne(params.flowId));
|
|
82
|
-
const { flowId, createdAt, modifiedAt, nodes, ...flowToCopy } = dataFlow;
|
|
83
|
-
const newFlow = new Flow_1.default();
|
|
84
|
-
Object.assign(newFlow, flowToCopy);
|
|
85
|
-
newFlow.name = params.name;
|
|
86
|
-
newFlow.description = params.description;
|
|
87
|
-
const insertNewFlow = await core_1.__(manager.save(Flow_1.default, newFlow));
|
|
88
|
-
// create the nodes
|
|
89
|
-
// get the first node "the trigger node"
|
|
90
|
-
const dataNode = await Node_1.default.findOne({ where: { flowId: params.flowId }, order: { nodeId: "ASC" } });
|
|
91
|
-
dataNode && await this.copyNode(dataNode, insertNewFlow.flowId, manager);
|
|
92
|
-
return { flowId: insertNewFlow.flowId };
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
__decorate([
|
|
96
|
-
core_1.Get(),
|
|
97
|
-
core_1.DbSettings('Orm'),
|
|
98
|
-
core_1.ReadOnly(true),
|
|
99
|
-
core_1.Log(true),
|
|
100
|
-
__metadata("design:type", Function),
|
|
101
|
-
__metadata("design:paramtypes", [Object]),
|
|
102
|
-
__metadata("design:returntype", Promise)
|
|
103
|
-
], Flow.prototype, "get", null);
|
|
104
|
-
__decorate([
|
|
105
|
-
core_1.Post(),
|
|
106
|
-
core_1.DbSettings('Orm'),
|
|
107
|
-
core_1.ReadOnly(false),
|
|
108
|
-
core_1.Log(true),
|
|
109
|
-
__metadata("design:type", Function),
|
|
110
|
-
__metadata("design:paramtypes", [Object, typeorm_1.EntityManager]),
|
|
111
|
-
__metadata("design:returntype", Promise)
|
|
112
|
-
], Flow.prototype, "createFlowFromFlow", null);
|
|
113
|
-
Flow = __decorate([
|
|
114
|
-
core_1.Model('flow-nd/Flow')
|
|
115
|
-
], Flow);
|
|
116
|
-
exports.default = Flow;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kplian 2021
|
|
3
|
-
*
|
|
4
|
-
* MIT
|
|
5
|
-
*
|
|
6
|
-
* NodeInstance Controller
|
|
7
|
-
*
|
|
8
|
-
* @summary Member Controller
|
|
9
|
-
* @author Favio Figueroa
|
|
10
|
-
* Jaime Rivera
|
|
11
|
-
*
|
|
12
|
-
* Created at : 2021-07-08 12:55:38
|
|
13
|
-
* Last modified :
|
|
14
|
-
*/
|
|
15
|
-
import { EntityManager } from 'typeorm';
|
|
16
|
-
import { Controller } from '@pxp-nd/core';
|
|
17
|
-
declare class FlowInstance extends Controller {
|
|
18
|
-
processPending(params: Record<string, any>, manager: EntityManager): Promise<unknown>;
|
|
19
|
-
}
|
|
20
|
-
export default FlowInstance;
|
|
@@ -1,78 +0,0 @@
|
|
|
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 core_1 = require("@pxp-nd/core");
|
|
31
|
-
const FlowInstance_1 = __importDefault(require("../entity/FlowInstance"));
|
|
32
|
-
const common_1 = require("@pxp-nd/common");
|
|
33
|
-
const NodeInstance_1 = __importDefault(require("./NodeInstance"));
|
|
34
|
-
const NodeInstance_2 = __importDefault(require("../entity/NodeInstance"));
|
|
35
|
-
const Node_1 = __importDefault(require("../entity/Node"));
|
|
36
|
-
class FlowInstance extends core_1.Controller {
|
|
37
|
-
async processPending(params, manager) {
|
|
38
|
-
const flag = await common_1.GlobalData.findOne({ data: 'wf_processing_pending_flows_flag' });
|
|
39
|
-
if (flag) {
|
|
40
|
-
if (flag.value == 'true') {
|
|
41
|
-
throw new core_1.PxpError(400, 'Already processing pending flows');
|
|
42
|
-
}
|
|
43
|
-
flag.value = 'true';
|
|
44
|
-
let flowInstanceIdProcessing = -1;
|
|
45
|
-
await typeorm_1.getManager().save(flag);
|
|
46
|
-
try {
|
|
47
|
-
const maxFlows = await common_1.GlobalData.findOne({ data: 'wf_max_concurrent_flows_process' });
|
|
48
|
-
const flowInstances = await FlowInstance_1.default.find({ take: (maxFlows && maxFlows.value), where: [{ status: 'pending' }], order: { flowInstanceId: "ASC" } });
|
|
49
|
-
for (const flowInstance of flowInstances) {
|
|
50
|
-
flowInstanceIdProcessing = flowInstance.flowInstanceId;
|
|
51
|
-
const node = await Node_1.default.findOne({ where: { actionId: flowInstance.actionId, flowId: flowInstance.flowId } });
|
|
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);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
catch (error) {
|
|
59
|
-
flag.value = 'false';
|
|
60
|
-
await typeorm_1.getManager().save(flag);
|
|
61
|
-
throw new core_1.PxpError(400, 'Error processing flow: ' + flowInstanceIdProcessing);
|
|
62
|
-
}
|
|
63
|
-
flag.value = 'false';
|
|
64
|
-
await typeorm_1.getManager().save(flag);
|
|
65
|
-
}
|
|
66
|
-
return { success: true };
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
__decorate([
|
|
70
|
-
core_1.Post(),
|
|
71
|
-
core_1.DbSettings('Orm'),
|
|
72
|
-
core_1.ReadOnly(false),
|
|
73
|
-
core_1.Log(true),
|
|
74
|
-
__metadata("design:type", Function),
|
|
75
|
-
__metadata("design:paramtypes", [Object, typeorm_1.EntityManager]),
|
|
76
|
-
__metadata("design:returntype", Promise)
|
|
77
|
-
], FlowInstance.prototype, "processPending", null);
|
|
78
|
-
exports.default = FlowInstance;
|
|
@@ -1,23 +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 Node extends Controller {
|
|
17
|
-
getNodeData(node: any, dataId: any, manager: EntityManager): Promise<string>;
|
|
18
|
-
add(params: Record<string, any>, manager: EntityManager): Promise<unknown>;
|
|
19
|
-
AddActionConfigJson(params: Record<string, any>, manager: EntityManager): Promise<unknown>;
|
|
20
|
-
getParameterizedNode(params: Record<string, any>, manager: EntityManager): Promise<unknown>;
|
|
21
|
-
executeActionJson(params: Record<string, any>, manager: EntityManager): Promise<unknown>;
|
|
22
|
-
}
|
|
23
|
-
export default Node;
|