@nocobase/plugin-workflow 2.1.5 → 2.1.7
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 +12 -12
- package/dist/locale/en-US.json +1 -1
- package/dist/locale/zh-CN.json +1 -1
- package/dist/node_modules/cron-parser/package.json +1 -1
- package/dist/node_modules/joi/package.json +1 -1
- package/dist/node_modules/lru-cache/package.json +1 -1
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/server/Dispatcher.d.ts +1 -0
- package/dist/server/Dispatcher.js +46 -28
- package/dist/server/utils.js +9 -2
- package/package.json +2 -2
package/dist/externalVersion.js
CHANGED
|
@@ -11,8 +11,8 @@ module.exports = {
|
|
|
11
11
|
"react": "18.2.0",
|
|
12
12
|
"@formily/core": "2.3.7",
|
|
13
13
|
"@formily/react": "2.3.7",
|
|
14
|
-
"@nocobase/client": "2.1.
|
|
15
|
-
"@nocobase/utils": "2.1.
|
|
14
|
+
"@nocobase/client": "2.1.7",
|
|
15
|
+
"@nocobase/utils": "2.1.7",
|
|
16
16
|
"antd": "5.24.2",
|
|
17
17
|
"@ant-design/icons": "5.6.1",
|
|
18
18
|
"react-router-dom": "6.30.1",
|
|
@@ -20,20 +20,20 @@ module.exports = {
|
|
|
20
20
|
"lodash": "4.18.1",
|
|
21
21
|
"@dnd-kit/core": "6.1.0",
|
|
22
22
|
"@formily/shared": "2.3.7",
|
|
23
|
-
"@nocobase/flow-engine": "2.1.
|
|
24
|
-
"@nocobase/plugin-mobile": "2.1.
|
|
23
|
+
"@nocobase/flow-engine": "2.1.7",
|
|
24
|
+
"@nocobase/plugin-mobile": "2.1.7",
|
|
25
25
|
"sequelize": "6.35.2",
|
|
26
|
-
"@nocobase/server": "2.1.
|
|
27
|
-
"@nocobase/database": "2.1.
|
|
28
|
-
"@nocobase/data-source-manager": "2.1.
|
|
29
|
-
"@nocobase/logger": "2.1.
|
|
30
|
-
"@nocobase/evaluators": "2.1.
|
|
26
|
+
"@nocobase/server": "2.1.7",
|
|
27
|
+
"@nocobase/database": "2.1.7",
|
|
28
|
+
"@nocobase/data-source-manager": "2.1.7",
|
|
29
|
+
"@nocobase/logger": "2.1.7",
|
|
30
|
+
"@nocobase/evaluators": "2.1.7",
|
|
31
31
|
"@formily/antd-v5": "1.2.3",
|
|
32
32
|
"@formily/reactive": "2.3.7",
|
|
33
33
|
"@emotion/css": "11.13.0",
|
|
34
34
|
"@formily/json-schema": "2.3.7",
|
|
35
|
-
"@nocobase/actions": "2.1.
|
|
35
|
+
"@nocobase/actions": "2.1.7",
|
|
36
36
|
"dayjs": "1.11.13",
|
|
37
|
-
"@nocobase/plugin-workflow-test": "2.1.
|
|
38
|
-
"@nocobase/test": "2.1.
|
|
37
|
+
"@nocobase/plugin-workflow-test": "2.1.7",
|
|
38
|
+
"@nocobase/test": "2.1.7"
|
|
39
39
|
};
|
package/dist/locale/en-US.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"53 bit (JavaScript safe) unique ID generated by Snowflake algorithm. Will always generate new one each time use this variable.": "53 bit (JavaScript safe) unique ID generated by Snowflake algorithm. Will always generate new one each time use this variable.",
|
|
3
|
-
"53-bit Snowflake ID doc link": "https://
|
|
3
|
+
"53-bit Snowflake ID doc link": "https://docs.nocobase.com/data-sources/data-modeling/collection-fields/advanced/snowflake-id",
|
|
4
4
|
"\"Submit to workflow\" to \"Post-action event\" is deprecated, please use \"Custom action event\" instead.": "\"Submit to workflow\" to \"Post-action event\" is deprecated, please use \"Custom action event\" instead.",
|
|
5
5
|
"\"{{branchName}}\" branch": "\"{{branchName}}\" branch",
|
|
6
6
|
"A new version will be created automatically after execution if current version is not executed.": "A new version will be created automatically after execution if current version is not executed.",
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"53 bit (JavaScript safe) unique ID generated by Snowflake algorithm. Will always generate new one each time use this variable.": "53 位长度(JavaScript 安全)雪花算法唯一 ID,每次使用该变量都会生成一个新的 ID。",
|
|
3
|
-
"53-bit Snowflake ID doc link": "https://
|
|
3
|
+
"53-bit Snowflake ID doc link": "https://docs.nocobase.com/cn/data-sources/data-modeling/collection-fields/advanced/snowflake-id",
|
|
4
4
|
"\"Submit to workflow\" to \"Post-action event\" is deprecated, please use \"Custom action event\" instead.": "“提交至工作流”到“操作后事件”的方式已被弃用,请使用“自定义操作事件”代替。",
|
|
5
5
|
"\"{{branchName}}\" branch": "“{{branchName}}”分支",
|
|
6
6
|
"A new version will be created automatically after execution if current version is not executed.": "如果当前版本还未执行过,将在执行后自动创建一个新版本。",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"cron-parser","version":"4.4.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"index.d.ts","typesVersions":{"<4.1":{"*":["types/ts3/*"]}},"directories":{"test":"test"},"scripts":{"test:tsd":"tsd","test:unit":"TZ=UTC tap ./test/*.js","test:cover":"TZ=UTC tap --coverage-report=html ./test/*.js","lint":"eslint .","lint:fix":"eslint --fix .","test":"npm run lint && npm run test:unit && npm run test:tsd"},"repository":{"type":"git","url":"https://github.com/harrisiirak/cron-parser.git"},"keywords":["cron","crontab","parser"],"author":"Harri Siirak","contributors":["Nicholas Clawson","Daniel Prentis <daniel@salsitasoft.com>","Renault John Lecoultre","Richard Astbury <richard.astbury@gmail.com>","Meaglin Wasabi <Meaglin.wasabi@gmail.com>","Mike Kusold <hello@mikekusold.com>","Alex Kit <alex.kit@atmajs.com>","Santiago Gimeno <santiago.gimeno@gmail.com>","Daniel <darc.tec@gmail.com>","Christian Steininger <christian.steininger.cs@gmail.com>","Mykola Piskovyi <m.piskovyi@gmail.com>","Brian Vaughn <brian.david.vaughn@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Yasuhiroki <yasuhiroki.duck@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Brendan Warkentin <faazshift@gmail.com>","Charlie Fish <fishcharlie.code@gmail.com>","Ian Graves <ian+diskimage@iangrav.es>","Andy Thompson <me@andytson.com>","Regev Brody <regevbr@gmail.com>"],"license":"MIT","dependencies":{"luxon":"^1.28.0"},"devDependencies":{"eslint":"^8.2.0","sinon":"^10.0.0","tap":"^16.0.1","tsd":"^0.19.0"},"engines":{"node":">=0.8"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"_lastModified":"2026-06-
|
|
1
|
+
{"name":"cron-parser","version":"4.4.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"index.d.ts","typesVersions":{"<4.1":{"*":["types/ts3/*"]}},"directories":{"test":"test"},"scripts":{"test:tsd":"tsd","test:unit":"TZ=UTC tap ./test/*.js","test:cover":"TZ=UTC tap --coverage-report=html ./test/*.js","lint":"eslint .","lint:fix":"eslint --fix .","test":"npm run lint && npm run test:unit && npm run test:tsd"},"repository":{"type":"git","url":"https://github.com/harrisiirak/cron-parser.git"},"keywords":["cron","crontab","parser"],"author":"Harri Siirak","contributors":["Nicholas Clawson","Daniel Prentis <daniel@salsitasoft.com>","Renault John Lecoultre","Richard Astbury <richard.astbury@gmail.com>","Meaglin Wasabi <Meaglin.wasabi@gmail.com>","Mike Kusold <hello@mikekusold.com>","Alex Kit <alex.kit@atmajs.com>","Santiago Gimeno <santiago.gimeno@gmail.com>","Daniel <darc.tec@gmail.com>","Christian Steininger <christian.steininger.cs@gmail.com>","Mykola Piskovyi <m.piskovyi@gmail.com>","Brian Vaughn <brian.david.vaughn@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Yasuhiroki <yasuhiroki.duck@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Brendan Warkentin <faazshift@gmail.com>","Charlie Fish <fishcharlie.code@gmail.com>","Ian Graves <ian+diskimage@iangrav.es>","Andy Thompson <me@andytson.com>","Regev Brody <regevbr@gmail.com>"],"license":"MIT","dependencies":{"luxon":"^1.28.0"},"devDependencies":{"eslint":"^8.2.0","sinon":"^10.0.0","tap":"^16.0.1","tsd":"^0.19.0"},"engines":{"node":">=0.8"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"_lastModified":"2026-06-17T23:29:59.208Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-06-
|
|
1
|
+
{"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-06-17T23:29:58.943Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"11.3.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","prepare":"tshy && bash scripts/build.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig ./.tshy/esm.json ./src/*.ts","benchmark-results-typedoc":"bash scripts/benchmark-results-typedoc.sh","prebenchmark":"npm run prepare","benchmark":"make -C benchmark","preprofile":"npm run prepare","profile":"make -C benchmark profile","lint":"oxlint --fix src test","postsnap":"npm run lint","postlint":"npm run format"},"main":"./dist/commonjs/index.min.js","types":"./dist/commonjs/index.d.ts","tshy":{"esmDialects":["node","browser"],"exports":{"./raw":"./src/index.ts",".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"selfLink":false},"repository":{"type":"git","url":"git+ssh://git@github.com/isaacs/node-lru-cache.git"},"devDependencies":{"benchmark":"^2.1.4","esbuild":"^0.25.9","marked":"^4.2.12","mkdirp":"^3.0.1","oxlint":"^1.58.0","oxlint-tsgolint":"^0.19.0","prettier":"^3.8.1","tap":"^21.6.3","tshy":"^4.1.1","typedoc":"^0.28.18"},"license":"BlueOak-1.0.0","files":["dist"],"engines":{"node":"20 || >=22"},"exports":{"./raw":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"type":"module","module":"./dist/esm/index.min.js","_lastModified":"2026-06-
|
|
1
|
+
{"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"11.3.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","prepare":"tshy && bash scripts/build.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig ./.tshy/esm.json ./src/*.ts","benchmark-results-typedoc":"bash scripts/benchmark-results-typedoc.sh","prebenchmark":"npm run prepare","benchmark":"make -C benchmark","preprofile":"npm run prepare","profile":"make -C benchmark profile","lint":"oxlint --fix src test","postsnap":"npm run lint","postlint":"npm run format"},"main":"./dist/commonjs/index.min.js","types":"./dist/commonjs/index.d.ts","tshy":{"esmDialects":["node","browser"],"exports":{"./raw":"./src/index.ts",".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"selfLink":false},"repository":{"type":"git","url":"git+ssh://git@github.com/isaacs/node-lru-cache.git"},"devDependencies":{"benchmark":"^2.1.4","esbuild":"^0.25.9","marked":"^4.2.12","mkdirp":"^3.0.1","oxlint":"^1.58.0","oxlint-tsgolint":"^0.19.0","prettier":"^3.8.1","tap":"^21.6.3","tshy":"^4.1.1","typedoc":"^0.28.18"},"license":"BlueOak-1.0.0","files":["dist"],"engines":{"node":"20 || >=22"},"exports":{"./raw":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"type":"module","module":"./dist/esm/index.min.js","_lastModified":"2026-06-17T23:29:58.220Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"nodejs-snowflake","collaborators":["Utkarsh Srivastava <utkarsh@sagacious.dev>"],"description":"Generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)","version":"2.0.1","license":"Apache 2.0","repository":{"type":"git","url":"https://github.com/utkarsh-pro/nodejs-snowflake.git"},"files":["nodejs_snowflake_bg.wasm","nodejs_snowflake.js","nodejs_snowflake.d.ts"],"main":"nodejs_snowflake.js","types":"nodejs_snowflake.d.ts","_lastModified":"2026-06-
|
|
1
|
+
{"name":"nodejs-snowflake","collaborators":["Utkarsh Srivastava <utkarsh@sagacious.dev>"],"description":"Generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)","version":"2.0.1","license":"Apache 2.0","repository":{"type":"git","url":"https://github.com/utkarsh-pro/nodejs-snowflake.git"},"files":["nodejs_snowflake_bg.wasm","nodejs_snowflake.js","nodejs_snowflake.d.ts"],"main":"nodejs_snowflake.js","types":"nodejs_snowflake.d.ts","_lastModified":"2026-06-17T23:29:58.053Z"}
|
|
@@ -35,6 +35,7 @@ var import_constants = require("./constants");
|
|
|
35
35
|
var import_Plugin = require("./Plugin");
|
|
36
36
|
var import_utils = require("./utils");
|
|
37
37
|
const EXECUTION_ACQUIRE_MAX_ATTEMPTS = 5;
|
|
38
|
+
const PENDING_DISPATCH_MAX_ATTEMPTS = 3;
|
|
38
39
|
class Dispatcher {
|
|
39
40
|
constructor(plugin) {
|
|
40
41
|
this.plugin = plugin;
|
|
@@ -196,39 +197,56 @@ class Dispatcher {
|
|
|
196
197
|
}
|
|
197
198
|
this.executing = (async () => {
|
|
198
199
|
let next = null;
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
200
|
+
let pending = null;
|
|
201
|
+
try {
|
|
202
|
+
pending = this.pending.shift() ?? null;
|
|
203
|
+
if (pending || this.ready && this.plugin.serving()) {
|
|
204
|
+
const execution = await this.prepare((pending == null ? void 0 : pending.execution) ?? null, {
|
|
205
|
+
immediate: pending == null ? void 0 : pending.immediate
|
|
206
|
+
});
|
|
207
|
+
if (execution) {
|
|
208
|
+
next = [execution, pending == null ? void 0 : pending.job, pending == null ? void 0 : pending.rerun];
|
|
209
|
+
}
|
|
210
|
+
if (pending && next) {
|
|
211
|
+
this.plugin.getLogger(next[0].workflowId).info(`pending execution (${next[0].id}) ready to process`);
|
|
212
|
+
}
|
|
213
|
+
} else {
|
|
214
|
+
this.plugin.getLogger("dispatcher").warn(
|
|
215
|
+
`${import_Plugin.WORKER_JOB_WORKFLOW_PROCESS} is not serving on this instance or app not ready, new dispatching will be ignored`
|
|
216
|
+
);
|
|
206
217
|
}
|
|
207
|
-
if (
|
|
208
|
-
|
|
218
|
+
if (next) {
|
|
219
|
+
try {
|
|
220
|
+
await this.process(next[0], next[1], { rerun: next[2] });
|
|
221
|
+
} catch (error) {
|
|
222
|
+
this.plugin.getLogger(next[0].workflowId).error(`execution (${next[0].id}) process failed`, { error });
|
|
223
|
+
if (pending && (0, import_utils.isLockAcquireError)(error)) {
|
|
224
|
+
this.pending.unshift({ ...pending, execution: next[0], immediate: true });
|
|
225
|
+
}
|
|
226
|
+
}
|
|
209
227
|
}
|
|
210
|
-
}
|
|
211
|
-
this.plugin.getLogger("dispatcher").
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
this.pending.unshift({ ...pending, execution: next[0], immediate: true });
|
|
228
|
+
} catch (error) {
|
|
229
|
+
this.plugin.getLogger("dispatcher").error(`workflow dispatch failed`, { error });
|
|
230
|
+
if (pending) {
|
|
231
|
+
const dispatchAttempts = (pending.dispatchAttempts ?? 0) + 1;
|
|
232
|
+
if (dispatchAttempts < PENDING_DISPATCH_MAX_ATTEMPTS) {
|
|
233
|
+
this.pending.push({ ...pending, dispatchAttempts });
|
|
234
|
+
} else {
|
|
235
|
+
this.plugin.getLogger(pending.execution.workflowId).error(`pending execution (${pending.execution.id}) dispatch failed, local retry limit reached`, {
|
|
236
|
+
error,
|
|
237
|
+
dispatchAttempts
|
|
238
|
+
});
|
|
222
239
|
}
|
|
223
240
|
}
|
|
241
|
+
} finally {
|
|
242
|
+
setImmediate(() => {
|
|
243
|
+
this.executing = null;
|
|
244
|
+
if (next || this.pending.length) {
|
|
245
|
+
this.plugin.getLogger("dispatcher").debug(`last process finished, will do another dispatch`);
|
|
246
|
+
this.dispatch();
|
|
247
|
+
}
|
|
248
|
+
});
|
|
224
249
|
}
|
|
225
|
-
setImmediate(() => {
|
|
226
|
-
this.executing = null;
|
|
227
|
-
if (next || this.pending.length) {
|
|
228
|
-
this.plugin.getLogger("dispatcher").debug(`last process finished, will do another dispatch`);
|
|
229
|
-
this.dispatch();
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
250
|
})();
|
|
233
251
|
}
|
|
234
252
|
async run(pending) {
|
package/dist/server/utils.js
CHANGED
|
@@ -109,10 +109,14 @@ async function abortExecution(plugin, execution, options = {}) {
|
|
|
109
109
|
reason: options.reason
|
|
110
110
|
} : {}
|
|
111
111
|
};
|
|
112
|
+
const expectedStatus = typeof execution.status === "undefined" ? import_constants.EXECUTION_STATUS.STARTED : execution.status;
|
|
113
|
+
if (![import_constants.EXECUTION_STATUS.QUEUEING, import_constants.EXECUTION_STATUS.STARTED].includes(expectedStatus)) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
112
116
|
const [affected] = await ExecutionRepo.model.update(abortValues, {
|
|
113
117
|
where: {
|
|
114
118
|
id: execution.id,
|
|
115
|
-
status:
|
|
119
|
+
status: expectedStatus
|
|
116
120
|
},
|
|
117
121
|
individualHooks: true,
|
|
118
122
|
transaction
|
|
@@ -134,11 +138,14 @@ async function abortExecution(plugin, execution, options = {}) {
|
|
|
134
138
|
const childExecutions = await plugin.db.getRepository("executions").find({
|
|
135
139
|
filter: {
|
|
136
140
|
parentExecutionId: execution.id,
|
|
137
|
-
status: import_constants.EXECUTION_STATUS.STARTED
|
|
141
|
+
status: [import_constants.EXECUTION_STATUS.QUEUEING, import_constants.EXECUTION_STATUS.STARTED]
|
|
138
142
|
},
|
|
139
143
|
transaction
|
|
140
144
|
});
|
|
141
145
|
for (const child of childExecutions) {
|
|
146
|
+
if (![import_constants.EXECUTION_STATUS.QUEUEING, import_constants.EXECUTION_STATUS.STARTED].includes(child.status)) {
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
142
149
|
await abortExecution(plugin, child, { transaction, reason: import_constants.EXECUTION_REASON.PARENT_ABORTED });
|
|
143
150
|
}
|
|
144
151
|
const updateLocalState = () => {
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "A powerful BPM tool that provides foundational support for business automation, with the capability to extend unlimited triggers and nodes.",
|
|
7
7
|
"description.zh-CN": "一个强大的 BPM 工具,为业务自动化提供基础支持,并且可任意扩展更多的触发器和节点。",
|
|
8
8
|
"description.ru-RU": "Мощный инструмент BPM, обеспечивающий базовую поддержку автоматизации бизнес-процессов с возможностью неограниченного расширения триггеров и узлов.",
|
|
9
|
-
"version": "2.1.
|
|
9
|
+
"version": "2.1.7",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "./dist/server/index.js",
|
|
12
12
|
"homepage": "https://docs.nocobase.com/handbook/workflow",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@nocobase/test": "2.x",
|
|
50
50
|
"@nocobase/utils": "2.x"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "fc3bc8bf6ef0c185a456cb5241abc4716af8c20c",
|
|
53
53
|
"keywords": [
|
|
54
54
|
"Workflow"
|
|
55
55
|
]
|