@nocobase/plugin-workflow 1.9.0-alpha.11 → 1.9.0-alpha.13

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.
@@ -45,6 +45,7 @@ export declare const executionSchema: {
45
45
  foreignKey?: undefined;
46
46
  unique?: undefined;
47
47
  onDelete?: undefined;
48
+ defaultValue?: undefined;
48
49
  } | {
49
50
  type: string;
50
51
  name: string;
@@ -69,6 +70,7 @@ export declare const executionSchema: {
69
70
  autoIncrement?: undefined;
70
71
  unique?: undefined;
71
72
  onDelete?: undefined;
73
+ defaultValue?: undefined;
72
74
  } | {
73
75
  type: string;
74
76
  name: string;
@@ -80,6 +82,7 @@ export declare const executionSchema: {
80
82
  foreignKey?: undefined;
81
83
  unique?: undefined;
82
84
  onDelete?: undefined;
85
+ defaultValue?: undefined;
83
86
  } | {
84
87
  type: string;
85
88
  name: string;
@@ -91,6 +94,7 @@ export declare const executionSchema: {
91
94
  target?: undefined;
92
95
  foreignKey?: undefined;
93
96
  onDelete?: undefined;
97
+ defaultValue?: undefined;
94
98
  } | {
95
99
  type: string;
96
100
  name: string;
@@ -102,6 +106,7 @@ export declare const executionSchema: {
102
106
  target?: undefined;
103
107
  foreignKey?: undefined;
104
108
  unique?: undefined;
109
+ defaultValue?: undefined;
105
110
  } | {
106
111
  type: string;
107
112
  name: string;
@@ -121,6 +126,19 @@ export declare const executionSchema: {
121
126
  foreignKey?: undefined;
122
127
  unique?: undefined;
123
128
  onDelete?: undefined;
129
+ defaultValue?: undefined;
130
+ } | {
131
+ type: string;
132
+ name: string;
133
+ defaultValue: boolean;
134
+ interface?: undefined;
135
+ uiSchema?: undefined;
136
+ primaryKey?: undefined;
137
+ autoIncrement?: undefined;
138
+ target?: undefined;
139
+ foreignKey?: undefined;
140
+ unique?: undefined;
141
+ onDelete?: undefined;
124
142
  } | {
125
143
  interface: string;
126
144
  type: string;
@@ -142,7 +160,11 @@ export declare const executionSchema: {
142
160
  foreignKey?: undefined;
143
161
  unique?: undefined;
144
162
  onDelete?: undefined;
163
+ defaultValue?: undefined;
145
164
  })[];
165
+ indexes: {
166
+ fields: string[];
167
+ }[];
146
168
  };
147
169
  resourceName: string;
148
170
  request: {
@@ -71,7 +71,7 @@ export declare const BaseTypeSets: {
71
71
  string: Set<string>;
72
72
  date: Set<string>;
73
73
  };
74
- export declare function useWorkflowVariableOptions(options?: UseVariableOptions): any[];
74
+ export declare function useWorkflowVariableOptions(options?: UseVariableOptions, preset?: VariableOption[]): VariableOption[];
75
75
  export declare function getCollectionFieldOptions(options: any): VariableOption[];
76
76
  export declare function useGetDataSourceCollectionManager(dataSourceName?: any): CollectionManager;
77
77
  export declare function WorkflowVariableInput({ variableOptions, ...props }: {
@@ -34,6 +34,7 @@ declare const _default: {
34
34
  foreignKey?: undefined;
35
35
  unique?: undefined;
36
36
  onDelete?: undefined;
37
+ defaultValue?: undefined;
37
38
  } | {
38
39
  type: string;
39
40
  name: string;
@@ -58,6 +59,7 @@ declare const _default: {
58
59
  autoIncrement?: undefined;
59
60
  unique?: undefined;
60
61
  onDelete?: undefined;
62
+ defaultValue?: undefined;
61
63
  } | {
62
64
  type: string;
63
65
  name: string;
@@ -69,6 +71,7 @@ declare const _default: {
69
71
  foreignKey?: undefined;
70
72
  unique?: undefined;
71
73
  onDelete?: undefined;
74
+ defaultValue?: undefined;
72
75
  } | {
73
76
  type: string;
74
77
  name: string;
@@ -80,6 +83,7 @@ declare const _default: {
80
83
  target?: undefined;
81
84
  foreignKey?: undefined;
82
85
  onDelete?: undefined;
86
+ defaultValue?: undefined;
83
87
  } | {
84
88
  type: string;
85
89
  name: string;
@@ -91,6 +95,7 @@ declare const _default: {
91
95
  target?: undefined;
92
96
  foreignKey?: undefined;
93
97
  unique?: undefined;
98
+ defaultValue?: undefined;
94
99
  } | {
95
100
  type: string;
96
101
  name: string;
@@ -110,6 +115,19 @@ declare const _default: {
110
115
  foreignKey?: undefined;
111
116
  unique?: undefined;
112
117
  onDelete?: undefined;
118
+ defaultValue?: undefined;
119
+ } | {
120
+ type: string;
121
+ name: string;
122
+ defaultValue: boolean;
123
+ interface?: undefined;
124
+ uiSchema?: undefined;
125
+ primaryKey?: undefined;
126
+ autoIncrement?: undefined;
127
+ target?: undefined;
128
+ foreignKey?: undefined;
129
+ unique?: undefined;
130
+ onDelete?: undefined;
113
131
  } | {
114
132
  interface: string;
115
133
  type: string;
@@ -131,6 +149,10 @@ declare const _default: {
131
149
  foreignKey?: undefined;
132
150
  unique?: undefined;
133
151
  onDelete?: undefined;
152
+ defaultValue?: undefined;
134
153
  })[];
154
+ indexes: {
155
+ fields: string[];
156
+ }[];
135
157
  };
136
158
  export default _default;
@@ -101,6 +101,11 @@ var executions_default = {
101
101
  enum: "{{ExecutionStatusOptions}}"
102
102
  }
103
103
  },
104
+ {
105
+ type: "boolean",
106
+ name: "dispatched",
107
+ defaultValue: false
108
+ },
104
109
  {
105
110
  type: "json",
106
111
  name: "stack"
@@ -121,5 +126,6 @@ var executions_default = {
121
126
  "x-read-pretty": true
122
127
  }
123
128
  }
124
- ]
129
+ ],
130
+ indexes: [{ fields: ["dispatched", "id"] }]
125
131
  };
@@ -11,8 +11,8 @@ module.exports = {
11
11
  "react": "18.2.0",
12
12
  "@formily/core": "2.3.0",
13
13
  "@formily/react": "2.3.0",
14
- "@nocobase/client": "1.9.0-alpha.11",
15
- "@nocobase/utils": "1.9.0-alpha.11",
14
+ "@nocobase/client": "1.9.0-alpha.13",
15
+ "@nocobase/utils": "1.9.0-alpha.13",
16
16
  "antd": "5.24.2",
17
17
  "@ant-design/icons": "5.6.1",
18
18
  "react-router-dom": "6.28.1",
@@ -20,17 +20,17 @@ module.exports = {
20
20
  "lodash": "4.17.21",
21
21
  "@dnd-kit/core": "6.1.0",
22
22
  "@formily/shared": "2.3.2",
23
- "@nocobase/plugin-mobile": "1.9.0-alpha.11",
23
+ "@nocobase/plugin-mobile": "1.9.0-alpha.13",
24
24
  "sequelize": "6.35.2",
25
- "@nocobase/database": "1.9.0-alpha.11",
26
- "@nocobase/server": "1.9.0-alpha.11",
27
- "@nocobase/data-source-manager": "1.9.0-alpha.11",
28
- "@nocobase/logger": "1.9.0-alpha.11",
29
- "@nocobase/evaluators": "1.9.0-alpha.11",
25
+ "@nocobase/database": "1.9.0-alpha.13",
26
+ "@nocobase/server": "1.9.0-alpha.13",
27
+ "@nocobase/data-source-manager": "1.9.0-alpha.13",
28
+ "@nocobase/logger": "1.9.0-alpha.13",
29
+ "@nocobase/evaluators": "1.9.0-alpha.13",
30
30
  "@formily/antd-v5": "1.2.3",
31
31
  "@formily/reactive": "2.3.0",
32
- "@nocobase/actions": "1.9.0-alpha.11",
32
+ "@nocobase/actions": "1.9.0-alpha.13",
33
33
  "dayjs": "1.11.13",
34
- "@nocobase/plugin-workflow-test": "1.9.0-alpha.11",
35
- "@nocobase/test": "1.9.0-alpha.11"
34
+ "@nocobase/plugin-workflow-test": "1.9.0-alpha.13",
35
+ "@nocobase/test": "1.9.0-alpha.13"
36
36
  };
@@ -241,12 +241,14 @@
241
241
  "Move all downstream nodes to": "将所有下游节点移至",
242
242
  "After end of branches": "分支结束后",
243
243
  "Inside of branch": "分支内",
244
-
244
+ "Workflow tasks": "流程待办",
245
245
  "Workflow todos": "流程待办",
246
246
  "New version enabled": "已启用新版本",
247
247
  "Workflow is not exists": "工作流不存在",
248
248
 
249
249
  "Select users": "选择用户",
250
250
  "Query users": "查询用户",
251
- "Add": "添加"
251
+ "Add": "添加",
252
+ "The workflow tasks page has already been created.": "工作流待办页面已创建。",
253
+ "No workflow tasks available. Please contact the administrator.": "没有可用的工作流待办,请联系管理员。"
252
254
  }
@@ -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":"2025-08-13T03:02:09.016Z"}
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":"2025-09-09T04:55:45.210Z"}
@@ -1 +1 @@
1
- {"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"8.0.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","preprepare":"rm -rf dist","prepare":"tsc -p tsconfig.json && tsc -p tsconfig-esm.json","postprepare":"bash fixup.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"c8 tap","snap":"c8 tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig tsconfig-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"},"main":"./dist/cjs/index-cjs.js","module":"./dist/mjs/index.js","types":"./dist/mjs/index.d.ts","exports":{"./min":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.min.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.min.js"}},".":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index-cjs.js"}}},"repository":"git://github.com/isaacs/node-lru-cache.git","devDependencies":{"@size-limit/preset-small-lib":"^7.0.8","@types/node":"^17.0.31","@types/tap":"^15.0.6","benchmark":"^2.1.4","c8":"^7.11.2","clock-mock":"^1.0.6","esbuild":"^0.17.11","eslint-config-prettier":"^8.5.0","marked":"^4.2.12","mkdirp":"^2.1.5","prettier":"^2.6.2","size-limit":"^7.0.8","tap":"^16.3.4","ts-node":"^10.7.0","tslib":"^2.4.0","typedoc":"^0.23.24","typescript":"^4.6.4"},"license":"ISC","files":["dist"],"engines":{"node":">=16.14"},"prettier":{"semi":false,"printWidth":70,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf"},"tap":{"coverage":false,"node-arg":["--expose-gc","--no-warnings","--loader","ts-node/esm"],"ts":false},"size-limit":[{"path":"./dist/mjs/index.js"}],"_lastModified":"2025-08-13T03:02:08.668Z"}
1
+ {"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"8.0.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","preprepare":"rm -rf dist","prepare":"tsc -p tsconfig.json && tsc -p tsconfig-esm.json","postprepare":"bash fixup.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"c8 tap","snap":"c8 tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig tsconfig-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"},"main":"./dist/cjs/index-cjs.js","module":"./dist/mjs/index.js","types":"./dist/mjs/index.d.ts","exports":{"./min":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.min.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.min.js"}},".":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index-cjs.js"}}},"repository":"git://github.com/isaacs/node-lru-cache.git","devDependencies":{"@size-limit/preset-small-lib":"^7.0.8","@types/node":"^17.0.31","@types/tap":"^15.0.6","benchmark":"^2.1.4","c8":"^7.11.2","clock-mock":"^1.0.6","esbuild":"^0.17.11","eslint-config-prettier":"^8.5.0","marked":"^4.2.12","mkdirp":"^2.1.5","prettier":"^2.6.2","size-limit":"^7.0.8","tap":"^16.3.4","ts-node":"^10.7.0","tslib":"^2.4.0","typedoc":"^0.23.24","typescript":"^4.6.4"},"license":"ISC","files":["dist"],"engines":{"node":">=16.14"},"prettier":{"semi":false,"printWidth":70,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf"},"tap":{"coverage":false,"node-arg":["--expose-gc","--no-warnings","--loader","ts-node/esm"],"ts":false},"size-limit":[{"path":"./dist/mjs/index.js"}],"_lastModified":"2025-09-09T04:55:44.882Z"}
@@ -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":"2025-08-13T03:02:08.482Z"}
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":"2025-09-09T04:55:44.690Z"}
@@ -81,7 +81,7 @@ class PluginWorkflowServer extends import_server.Plugin {
81
81
  const execution = await ExecutionRepo.findOne({
82
82
  filterByTk: event.executionId
83
83
  });
84
- if (!execution || execution.status !== import_constants.EXECUTION_STATUS.QUEUEING) {
84
+ if (!execution || execution.dispatched) {
85
85
  this.getLogger("dispatcher").info(
86
86
  `execution (${event.executionId}) from queue not found or not in queueing status, skip`
87
87
  );
@@ -474,7 +474,7 @@ class PluginWorkflowServer extends import_server.Plugin {
474
474
  * @experimental
475
475
  */
476
476
  async start(execution) {
477
- if (execution.status !== import_constants.EXECUTION_STATUS.STARTED) {
477
+ if (execution.status) {
478
478
  return;
479
479
  }
480
480
  this.getLogger(execution.workflowId).info(`starting deferred execution (${execution.id})`);
@@ -526,7 +526,7 @@ class PluginWorkflowServer extends import_server.Plugin {
526
526
  key: workflow.key,
527
527
  eventKey: options.eventKey ?? (0, import_crypto.randomUUID)(),
528
528
  stack: options.stack,
529
- status: deferred ? import_constants.EXECUTION_STATUS.STARTED : import_constants.EXECUTION_STATUS.QUEUEING
529
+ dispatched: deferred ?? false
530
530
  },
531
531
  { transaction }
532
532
  );
@@ -571,7 +571,7 @@ class PluginWorkflowServer extends import_server.Plugin {
571
571
  logger.info(`preparing execution for event`);
572
572
  try {
573
573
  const execution = await this.createExecution(...event);
574
- if ((execution == null ? void 0 : execution.status) === import_constants.EXECUTION_STATUS.QUEUEING) {
574
+ if (!(execution == null ? void 0 : execution.dispatched)) {
575
575
  if (!this.executing && !this.pending.length) {
576
576
  logger.info(`local pending list is empty, adding execution (${execution.id}) to pending list`);
577
577
  this.pending.push([execution]);
@@ -627,9 +627,7 @@ class PluginWorkflowServer extends import_server.Plugin {
627
627
  async (transaction) => {
628
628
  const execution = await this.db.getRepository("executions").findOne({
629
629
  filter: {
630
- status: {
631
- [import_database.Op.is]: import_constants.EXECUTION_STATUS.QUEUEING
632
- },
630
+ dispatched: false,
633
631
  "workflow.enabled": true
634
632
  },
635
633
  sort: "id",
@@ -639,6 +637,7 @@ class PluginWorkflowServer extends import_server.Plugin {
639
637
  this.getLogger(execution.workflowId).info(`execution (${execution.id}) fetched from db`);
640
638
  await execution.update(
641
639
  {
640
+ dispatched: true,
642
641
  status: import_constants.EXECUTION_STATUS.STARTED
643
642
  },
644
643
  { transaction }
@@ -670,9 +669,9 @@ class PluginWorkflowServer extends import_server.Plugin {
670
669
  async process(execution, job, options = {}) {
671
670
  var _a, _b;
672
671
  const logger = this.getLogger(execution.workflowId);
673
- if (execution.status === import_constants.EXECUTION_STATUS.QUEUEING) {
672
+ if (!execution.dispatched) {
674
673
  const transaction = await this.useDataSourceTransaction("main", options.transaction);
675
- await execution.update({ status: import_constants.EXECUTION_STATUS.STARTED }, { transaction });
674
+ await execution.update({ dispatched: true, status: import_constants.EXECUTION_STATUS.STARTED }, { transaction });
676
675
  logger.info(`execution (${execution.id}) from pending list updated to started`);
677
676
  }
678
677
  const processor = this.createProcessor(execution, options);
@@ -95,7 +95,7 @@ export default class Processor {
95
95
  /**
96
96
  * @experimental
97
97
  */
98
- getScope(sourceNodeId: number | string, includeSelfScope?: boolean): {
98
+ getScope(sourceNodeId?: number | string, includeSelfScope?: boolean): {
99
99
  $context: any;
100
100
  $jobsMapByNodeKey: {
101
101
  [key: string]: any;
@@ -107,7 +107,7 @@ export default class Processor {
107
107
  /**
108
108
  * @experimental
109
109
  */
110
- getParsedValue(value: any, sourceNodeId: number | string, { additionalScope, includeSelfScope }?: {
110
+ getParsedValue(value: any, sourceNodeId?: number | string, { additionalScope, includeSelfScope }?: {
111
111
  additionalScope?: {};
112
112
  includeSelfScope?: boolean;
113
113
  }): any;
@@ -118,7 +118,7 @@ class Processor {
118
118
  if (!execution.workflow) {
119
119
  execution.workflow = plugin.enabledCache.get(execution.workflowId) || await execution.getWorkflow({ transaction });
120
120
  }
121
- const nodes = await execution.workflow.getNodes({ transaction });
121
+ const nodes = execution.workflow.nodes || await execution.workflow.getNodes({ transaction });
122
122
  execution.workflow.nodes = nodes;
123
123
  this.makeNodes(nodes);
124
124
  const JobDBModel = plugin.db.getModel("jobs");
@@ -143,7 +143,7 @@ class Processor {
143
143
  }
144
144
  async start() {
145
145
  const { execution } = this;
146
- if (execution.status !== import_constants.EXECUTION_STATUS.STARTED) {
146
+ if (execution.status) {
147
147
  this.logger.warn(`execution was ended with status ${execution.status} before, could not be started again`);
148
148
  return;
149
149
  }
@@ -157,7 +157,7 @@ class Processor {
157
157
  }
158
158
  async resume(job) {
159
159
  const { execution } = this;
160
- if (execution.status !== import_constants.EXECUTION_STATUS.STARTED) {
160
+ if (execution.status) {
161
161
  this.logger.warn(`execution was ended with status ${execution.status} before, could not be resumed`);
162
162
  return;
163
163
  }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ /**
10
+ * This file is part of the NocoBase (R) project.
11
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
12
+ * Authors: NocoBase Team.
13
+ *
14
+ * This program is offered under a commercial license.
15
+ * For more information, see <https://www.nocobase.com/agreement>
16
+ */
17
+ import { Migration } from '@nocobase/server';
18
+ export default class extends Migration {
19
+ appVersion: string;
20
+ up(): Promise<void>;
21
+ }
@@ -0,0 +1,58 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var mobile_tasks_uid_exports = {};
28
+ __export(mobile_tasks_uid_exports, {
29
+ default: () => mobile_tasks_uid_default
30
+ });
31
+ module.exports = __toCommonJS(mobile_tasks_uid_exports);
32
+ var import_server = require("@nocobase/server");
33
+ class mobile_tasks_uid_default extends import_server.Migration {
34
+ appVersion = "<1.9.0";
35
+ async up() {
36
+ const { db, app } = this.context;
37
+ const MobileRouteRepo = db.getRepository("mobileRoutes");
38
+ const route = await MobileRouteRepo.findOne({
39
+ filter: {
40
+ type: "page",
41
+ schemaUid: "workflow/tasks"
42
+ }
43
+ });
44
+ if (!route) {
45
+ app.logger.debug(`no route found to be migrated.`);
46
+ return;
47
+ }
48
+ await route.update({
49
+ schemaUid: "workflow-tasks",
50
+ options: {
51
+ url: "/page/workflow-tasks",
52
+ schema: {
53
+ "x-component": "MobileTabBarWorkflowTasksItem"
54
+ }
55
+ }
56
+ });
57
+ }
58
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ /**
10
+ * This file is part of the NocoBase (R) project.
11
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
12
+ * Authors: NocoBase Team.
13
+ *
14
+ * This program is offered under a commercial license.
15
+ * For more information, see <https://www.nocobase.com/agreement>
16
+ */
17
+ import { Migration } from '@nocobase/server';
18
+ export default class extends Migration {
19
+ appVersion: string;
20
+ up(): Promise<void>;
21
+ }
@@ -0,0 +1,64 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var execution_dispatched_exports = {};
28
+ __export(execution_dispatched_exports, {
29
+ default: () => execution_dispatched_default
30
+ });
31
+ module.exports = __toCommonJS(execution_dispatched_exports);
32
+ var import_server = require("@nocobase/server");
33
+ var import_constants = require("../constants");
34
+ var import_sequelize = require("sequelize");
35
+ class execution_dispatched_default extends import_server.Migration {
36
+ appVersion = "<1.9.0";
37
+ async up() {
38
+ const { db, app } = this.context;
39
+ const ExecutionModel = db.getModel("executions");
40
+ await ExecutionModel.update(
41
+ { dispatched: true },
42
+ {
43
+ where: {
44
+ status: [
45
+ import_constants.EXECUTION_STATUS.STARTED,
46
+ import_constants.EXECUTION_STATUS.RESOLVED,
47
+ import_constants.EXECUTION_STATUS.FAILED,
48
+ import_constants.EXECUTION_STATUS.ERROR,
49
+ import_constants.EXECUTION_STATUS.ABORTED,
50
+ import_constants.EXECUTION_STATUS.CANCELED,
51
+ import_constants.EXECUTION_STATUS.REJECTED,
52
+ import_constants.EXECUTION_STATUS.RETRY_NEEDED
53
+ ]
54
+ }
55
+ }
56
+ );
57
+ await ExecutionModel.update(
58
+ {
59
+ dispatched: false
60
+ },
61
+ { where: { status: { [import_sequelize.Op.is]: null } } }
62
+ );
63
+ }
64
+ }
@@ -15,6 +15,7 @@ export default class ExecutionModel extends Model {
15
15
  title: string;
16
16
  context: any;
17
17
  status: number;
18
+ dispatched: boolean;
18
19
  createdAt: Date;
19
20
  updatedAt: Date;
20
21
  key: string;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "工作流",
5
5
  "description": "A powerful BPM tool that provides foundational support for business automation, with the capability to extend unlimited triggers and nodes.",
6
6
  "description.zh-CN": "一个强大的 BPM 工具,为业务自动化提供基础支持,并且可任意扩展更多的触发器和节点。",
7
- "version": "1.9.0-alpha.11",
7
+ "version": "1.9.0-alpha.13",
8
8
  "license": "AGPL-3.0",
9
9
  "main": "./dist/server/index.js",
10
10
  "homepage": "https://docs.nocobase.com/handbook/workflow",
@@ -45,7 +45,7 @@
45
45
  "@nocobase/test": "1.x",
46
46
  "@nocobase/utils": "1.x"
47
47
  },
48
- "gitHead": "2dbef60d43720e92b483fc07d8ef1fd013083c88",
48
+ "gitHead": "e981abb387c32b94e010424718df66283279d67d",
49
49
  "keywords": [
50
50
  "Workflow"
51
51
  ]
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- "use strict";(self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).push([["158"],{6920:function(e,t,n){n.d(t,{a:function(){return a}});var o=n(8156),r=n.n(o),c=n(3238),i=n(6128),l=n(3772),u=n(5292),a=function(){var e=(0,c.useTranslation)().t,t=(0,l.useRecord)().id,n=(0,l.useActionContext)().setVisible;return r().createElement(i.Link,{to:(0,u.s_)(t),onClick:function(){return n(!1)}},e("View"))}},5352:function(e,t,n){n.d(t,{P:function(){return b},r:function(){return v}});var o=n(8156),r=n.n(o),c=n(2721),i=n(482),l=n(3238),u=n(3772),a=n(3377),s=n(2748);function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}function d(){var e,t,n=(e=["\n display: flex;\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return d=function(){return n},n}function m(e){var t,n=(0,u.useCompile)()(e.label),o=(null!=(t=a.uy[e.value])?t:{}).color;return r().createElement(c.Tag,{color:o,closable:e.closable,onClose:e.onClose},n)}function y(e){var t=(0,u.useCompile)();return r().createElement(r().Fragment,null,r().createElement(m,e),e.description?r().createElement("span",null,t(e.description)):null)}function b(e){var t,n,o=p({},function(e){if(null==e)throw TypeError("Cannot destructure "+e);return e}(e)),i=o.multiple?"multiple":null;return r().createElement(c.Select,(t=f({role:"button","data-testid":"select-".concat(i||"single")},o),n=n={mode:i,optionLabelProp:"label",tagRender:m},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t),a.C6.filter(function(e){return!!e.value&&e.value!==a.r9.ABORTED}).map(function(e){return r().createElement(c.Select.Option,f({key:e.value},e),r().createElement(y,e))}))}function v(e){var t=(0,l.useTranslation)().t,n=(0,u.useResourceActionContext)().refresh,a=(0,u.useResourceContext)().resource,p=(0,u.useRecord)(),f=(0,o.useCallback)(function(){c.Modal.confirm({title:(0,s.KQ)("Cancel the execution"),icon:r().createElement(i.ExclamationCircleFilled,null),content:(0,s.KQ)("Are you sure you want to cancel the execution?"),onOk:function(){a.cancel({filterByTk:p.id}).then(function(){c.message.success(t("Operation succeeded")),n()}).catch(function(e){console.error(e.data.error)})}})},[p]);return r().createElement("div",{className:(0,u.css)(d())},e.children,p.status?null:r().createElement(c.Tooltip,{title:(0,s.KQ)("Cancel the execution")},r().createElement(c.Button,{type:"link",danger:!0,onClick:f,shape:"circle",size:"small",icon:r().createElement(i.StopOutlined,null)})))}},5519:function(e,t,n){n.d(t,{V:function(){return b}});var o,r=n(8156),c=n.n(r),i=n(6128),l=n(3238),u=n(2721),a=n(3772),s=n(2297),p=n(3377),f=n(2748),d=n(5292);function m(e,t,n,o,r,c,i){try{var l=e[c](i),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(o,r)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var b={type:"void",name:"executionHistoryDrawer",title:'{{t("Execution history", { ns: "'.concat(f.A7,'" })}}'),"x-component":"Action.Drawer",properties:{content:{type:"void","x-decorator":"ExecutionResourceProvider","x-decorator-props":{collection:s.Z,resourceName:"executions",request:{resource:"executions",action:"list",params:{appends:["workflow.id","workflow.title"],pageSize:20,sort:["-createdAt"],except:["context","output"],filter:{}}}},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{refresher:{type:"void",title:'{{ t("Refresh") }}',"x-component":"Action","x-use-component-props":"useRefreshActionProps","x-component-props":{icon:"ReloadOutlined"}},delete:{type:"void",title:'{{t("Delete")}}',"x-component":"Action","x-component-props":{icon:"DeleteOutlined",useAction:"{{ cm.useBulkDestroyAction }}",confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}}},clear:{type:"void",title:'{{t("Clear")}}',"x-component":"Action","x-component-props":{useAction:function(){var e=(0,l.useTranslation)().t,t=(0,a.useResourceActionContext)(),n=t.refresh,o=t.defaultRequest,r=(0,a.useResourceContext)().resource,c=(0,a.useActionContext)().setVisible;return{run:function(){var t;return(t=function(){var t;return function(e,t){var n,o,r,c,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return c={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function l(c){return function(l){var u=[c,l];if(n)throw TypeError("Generator is already executing.");for(;i;)try{if(n=1,o&&(r=2&u[0]?o.return:u[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;switch(o=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,o=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(r=(r=i.trys).length>0&&r[r.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]<r[3])){i.label=u[1];break}if(6===u[0]&&i.label<r[1]){i.label=r[1],r=u;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(u);break}r[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],o=0}finally{n=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(i){switch(i.label){case 0:return[4,r.destroy({filter:null==(t=o.params)?void 0:t.filter})];case 1:return i.sent(),u.message.success(e("Operation succeeded")),n(),c(!1),[2]}})},function(){var e=this,n=arguments;return new Promise(function(o,r){var c=t.apply(e,n);function i(e){m(c,o,r,i,l,"next",e)}function l(e){m(c,o,r,i,l,"throw",e)}i(void 0)})})()}}},confirm:{title:'{{t("Clear all executions", { ns: "'.concat(f.A7,'" })}}'),content:'{{t("Clear executions will not reset executed count, and started executions will not be deleted, are you sure you want to delete them all?", { ns: "'.concat(f.A7,'" })}}')}}}}},table:{type:"void","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}"},properties:{id:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{id:{type:"number","x-component":"CollectionField","x-read-pretty":!0}}},createdAt:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{createdAt:{type:"string","x-component":"CollectionField","x-component-props":{showTime:!0},"x-read-pretty":!0}}},workflowId:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{t("Version", { ns: "'.concat(f.A7,'" })}}'),properties:{workflowId:(y(o={type:"number"},"x-component",function(e){var t=e.value,n=(0,a.useActionContext)().setVisible;return c().createElement(i.Link,{to:(0,d.SI)(t),onClick:function(){return n(!1)}},"#".concat(t))}),y(o,"x-read-pretty",!0),o)}},status:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{t("Status", { ns: "'.concat(f.A7,'" })}}'),properties:{status:{type:"number","x-decorator":"ExecutionStatusColumn","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{ t("Actions") }}',"x-component":"Table.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{link:{type:"void","x-component":"ExecutionLink"},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"},useAction:"{{ cm.useDestroyActionAndRefreshCM }}"},"x-reactions":[{dependencies:["..status"],fulfill:{state:{visible:"{{ $deps[0] !== ".concat(p.r9.STARTED," }}")}}}]}}}}}}}}}}}},5494:function(e,t,n){n.d(t,{X:function(){return c}});var o=n(3772);function r(e,t,n,o,r,c,i){try{var l=e[c](i),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(o,r)}function c(){var e=(0,o.useResourceActionContext)();return{onClick:function(){var t;return(t=function(){var t;return function(e,t){var n,o,r,c,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return c={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function l(c){return function(l){var u=[c,l];if(n)throw TypeError("Generator is already executing.");for(;i;)try{if(n=1,o&&(r=2&u[0]?o.return:u[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;switch(o=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,o=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(r=(r=i.trys).length>0&&r[r.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]<r[3])){i.label=u[1];break}if(6===u[0]&&i.label<r[1]){i.label=r[1],r=u;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(u);break}r[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],o=0}finally{n=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(n){return null==e||null==(t=e.refresh)||t.call(e),[2]})},function(){var e=this,n=arguments;return new Promise(function(o,c){var i=t.apply(e,n);function l(e){r(i,o,c,l,u,"next",e)}function u(e){r(i,o,c,l,u,"throw",e)}l(void 0)})})()}}}}}]);