rez_core 2.2.248 → 2.2.249
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/module/workflow-automation/service/workflow-automation.service.js +10 -8
- package/dist/module/workflow-automation/service/workflow-automation.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/workflow-automation/service/workflow-automation.service.ts +10 -8
package/package.json
CHANGED
|
@@ -71,11 +71,11 @@ export class WorkflowAutomationService extends EntityServiceImpl {
|
|
|
71
71
|
let workflow = await super.updateEntity(workflowData, loggedInUser);
|
|
72
72
|
|
|
73
73
|
// 3. EVENT
|
|
74
|
-
if (event) {
|
|
74
|
+
if (event?.eventFilterJson || event?.triggerType || event?.event) {
|
|
75
75
|
const eventFilterMaster = {
|
|
76
76
|
entity_type: 'SFM',
|
|
77
77
|
name: `Event_Filter_${workflow.id}`,
|
|
78
|
-
filterDetails: event
|
|
78
|
+
filterDetails: event?.eventFilterJson ?? [],
|
|
79
79
|
filter_scope: 'RULE',
|
|
80
80
|
};
|
|
81
81
|
|
|
@@ -84,17 +84,17 @@ export class WorkflowAutomationService extends EntityServiceImpl {
|
|
|
84
84
|
loggedInUser,
|
|
85
85
|
);
|
|
86
86
|
|
|
87
|
-
workflow.trigger_type = event
|
|
88
|
-
workflow.trigger_event = event
|
|
87
|
+
workflow.trigger_type = event?.triggerType ?? null;
|
|
88
|
+
workflow.trigger_event = event?.event ?? null;
|
|
89
89
|
workflow.condition_filter_code = savedEvent.code;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
// 4. CRITERIA
|
|
93
|
-
if (criteria) {
|
|
93
|
+
if (criteria?.criteriaFilterJson?.length) {
|
|
94
94
|
const criteriaFilterMaster = {
|
|
95
95
|
entity_type: 'SFM',
|
|
96
96
|
name: `Criteria_Filter_${workflow.id}`,
|
|
97
|
-
filterDetails: criteria
|
|
97
|
+
filterDetails: criteria?.criteriaFilterJson ?? [],
|
|
98
98
|
filter_scope: 'RULE',
|
|
99
99
|
};
|
|
100
100
|
|
|
@@ -107,13 +107,15 @@ export class WorkflowAutomationService extends EntityServiceImpl {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
// 5. ACTIONS
|
|
110
|
-
if (action
|
|
110
|
+
if (Array.isArray(action) && action.length) {
|
|
111
111
|
for (const a of action) {
|
|
112
|
+
if (!a?.actionCategory) continue; // skip invalid
|
|
113
|
+
|
|
112
114
|
const actionEntity = new WorkflowAutomationActionEntity();
|
|
113
115
|
actionEntity.entity_type = 'WFAA';
|
|
114
116
|
actionEntity.workflow_automation_id = workflow.id;
|
|
115
117
|
actionEntity.entity_method = a.actionCategory;
|
|
116
|
-
actionEntity.payload = a.actionPayload;
|
|
118
|
+
actionEntity.payload = a.actionPayload ?? {};
|
|
117
119
|
|
|
118
120
|
await super.createEntity(actionEntity, loggedInUser);
|
|
119
121
|
}
|