@nocobase/plugin-workflow-loop 1.8.0-alpha.7 → 1.8.0-alpha.8
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/externalVersion.js
CHANGED
|
@@ -13,9 +13,9 @@ module.exports = {
|
|
|
13
13
|
"antd": "5.24.2",
|
|
14
14
|
"@formily/antd-v5": "1.2.3",
|
|
15
15
|
"@formily/react": "2.3.0",
|
|
16
|
-
"@nocobase/client": "1.8.0-alpha.
|
|
17
|
-
"@nocobase/plugin-workflow": "1.8.0-alpha.
|
|
16
|
+
"@nocobase/client": "1.8.0-alpha.8",
|
|
17
|
+
"@nocobase/plugin-workflow": "1.8.0-alpha.8",
|
|
18
18
|
"react-i18next": "11.18.6",
|
|
19
|
-
"@nocobase/evaluators": "1.8.0-alpha.
|
|
20
|
-
"@nocobase/server": "1.8.0-alpha.
|
|
19
|
+
"@nocobase/evaluators": "1.8.0-alpha.8",
|
|
20
|
+
"@nocobase/server": "1.8.0-alpha.8"
|
|
21
21
|
};
|
|
@@ -24,7 +24,7 @@ export default class extends Instruction {
|
|
|
24
24
|
looped: number;
|
|
25
25
|
};
|
|
26
26
|
}>;
|
|
27
|
-
resume(node: FlowNodeModel, branchJob: any, processor: Processor): Promise<
|
|
27
|
+
resume(node: FlowNodeModel, branchJob: any, processor: Processor): Promise<JobModel>;
|
|
28
28
|
getScope(node: any, { looped }: {
|
|
29
29
|
looped: any;
|
|
30
30
|
}, processor: any): {
|
|
@@ -72,7 +72,7 @@ class LoopInstruction_default extends import_plugin_workflow.Instruction {
|
|
|
72
72
|
result: { looped }
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
-
const job =
|
|
75
|
+
const job = processor.saveJob({
|
|
76
76
|
status: import_plugin_workflow.JOB_STATUS.PENDING,
|
|
77
77
|
result: { looped },
|
|
78
78
|
nodeId: node.id,
|
|
@@ -83,12 +83,17 @@ class LoopInstruction_default extends import_plugin_workflow.Instruction {
|
|
|
83
83
|
const { checkpoint, calculation, expression, continueOnFalse } = node.config.condition ?? {};
|
|
84
84
|
if ((calculation || expression) && !checkpoint) {
|
|
85
85
|
const condition = calculateCondition(node, processor);
|
|
86
|
-
if (!condition
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
86
|
+
if (!condition) {
|
|
87
|
+
if (continueOnFalse) {
|
|
88
|
+
job.set("result", { looped: 1 });
|
|
89
|
+
processor.saveJob(job);
|
|
90
|
+
} else {
|
|
91
|
+
job.set({
|
|
92
|
+
status: import_plugin_workflow.JOB_STATUS.RESOLVED,
|
|
93
|
+
result: { looped, broken: true }
|
|
94
|
+
});
|
|
95
|
+
return job;
|
|
96
|
+
}
|
|
92
97
|
}
|
|
93
98
|
}
|
|
94
99
|
}
|
|
@@ -111,7 +116,7 @@ class LoopInstruction_default extends import_plugin_workflow.Instruction {
|
|
|
111
116
|
const target = processor.getParsedValue(loop.config.target, node.id);
|
|
112
117
|
if (branchJob.status === import_plugin_workflow.JOB_STATUS.RESOLVED || branchJob.status < import_plugin_workflow.JOB_STATUS.PENDING && loop.config.exit === import_constants.EXIT.CONTINUE) {
|
|
113
118
|
job.set({ result: { looped: nextIndex } });
|
|
114
|
-
|
|
119
|
+
processor.saveJob(job);
|
|
115
120
|
const length = getTargetLength(target);
|
|
116
121
|
if (nextIndex < length) {
|
|
117
122
|
if (loop.config.condition) {
|
|
@@ -128,7 +133,7 @@ class LoopInstruction_default extends import_plugin_workflow.Instruction {
|
|
|
128
133
|
}
|
|
129
134
|
}
|
|
130
135
|
await processor.run(branch, job);
|
|
131
|
-
return
|
|
136
|
+
return null;
|
|
132
137
|
} else {
|
|
133
138
|
job.set({
|
|
134
139
|
status: import_plugin_workflow.JOB_STATUS.RESOLVED
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "工作流:循环节点",
|
|
5
5
|
"description": "Used to repeat the sub-process processing of each value in an array, and can also be used for fixed times of sub-process processing.",
|
|
6
6
|
"description.zh-CN": "用于对一个数组中的每个值进行重复的子流程处理,也可用于固定次数的重复子流程处理。",
|
|
7
|
-
"version": "1.8.0-alpha.
|
|
7
|
+
"version": "1.8.0-alpha.8",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "./dist/server/index.js",
|
|
10
10
|
"homepage": "https://docs.nocobase.com/handbook/workflow-loop",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@nocobase/server": "1.x",
|
|
23
23
|
"@nocobase/test": "1.x"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "17d36b98700b0c32ebb621781e7fe27a81740c16",
|
|
26
26
|
"keywords": [
|
|
27
27
|
"Workflow"
|
|
28
28
|
]
|