@nocobase/plugin-workflow-action-trigger 2.1.0-alpha.14 → 2.1.0-alpha.15

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.
@@ -9,19 +9,19 @@
9
9
 
10
10
  module.exports = {
11
11
  "@formily/react": "2.3.7",
12
- "@nocobase/client": "2.1.0-alpha.14",
13
- "@nocobase/plugin-workflow": "2.1.0-alpha.14",
12
+ "@nocobase/client": "2.1.0-alpha.15",
13
+ "@nocobase/plugin-workflow": "2.1.0-alpha.15",
14
14
  "react": "18.2.0",
15
- "@nocobase/flow-engine": "2.1.0-alpha.14",
15
+ "@nocobase/flow-engine": "2.1.0-alpha.15",
16
16
  "react-i18next": "11.18.6",
17
17
  "lodash": "4.17.21",
18
18
  "sequelize": "6.35.2",
19
- "@nocobase/database": "2.1.0-alpha.14",
20
- "@nocobase/server": "2.1.0-alpha.14",
21
- "@nocobase/actions": "2.1.0-alpha.14",
22
- "@nocobase/plugin-error-handler": "2.1.0-alpha.14",
23
- "@nocobase/data-source-manager": "2.1.0-alpha.14",
24
- "@nocobase/plugin-workflow-test": "2.1.0-alpha.14",
25
- "@nocobase/test": "2.1.0-alpha.14",
26
- "@nocobase/utils": "2.1.0-alpha.14"
19
+ "@nocobase/database": "2.1.0-alpha.15",
20
+ "@nocobase/server": "2.1.0-alpha.15",
21
+ "@nocobase/actions": "2.1.0-alpha.15",
22
+ "@nocobase/plugin-error-handler": "2.1.0-alpha.15",
23
+ "@nocobase/data-source-manager": "2.1.0-alpha.15",
24
+ "@nocobase/plugin-workflow-test": "2.1.0-alpha.15",
25
+ "@nocobase/test": "2.1.0-alpha.15",
26
+ "@nocobase/utils": "2.1.0-alpha.15"
27
27
  };
@@ -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-04-07T15:55:29.040Z"}
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-04-10T12:41:01.008Z"}
@@ -214,28 +214,66 @@ class ActionTrigger_default extends import_plugin_workflow.Trigger {
214
214
  (workflow.sync ? syncGroup : asyncGroup).push([workflow, { data, ...userInfo }]);
215
215
  }
216
216
  }
217
- for (const event of syncGroup) {
218
- const processor = await this.workflow.trigger(event[0], event[1], { httpContext: context });
217
+ for (const [index, event] of syncGroup.entries()) {
218
+ const workflow = event[0];
219
+ const remainingSyncWorkflows = syncGroup.length - index - 1;
220
+ const syncLogMeta = {
221
+ workflowId: workflow.id,
222
+ workflowKey: workflow.key,
223
+ workflowTitle: workflow.title,
224
+ resourceName,
225
+ actionName,
226
+ currentSyncOrder: index + 1,
227
+ totalSyncWorkflows: syncGroup.length,
228
+ remainingSyncWorkflows,
229
+ pendingAsyncWorkflows: asyncGroup.length
230
+ };
231
+ context.logger.debug("[Workflow post-action]: executing sync workflow", syncLogMeta);
232
+ const processor = await this.workflow.trigger(workflow, event[1], { httpContext: context });
219
233
  if (!processor) {
220
- return context.throw(500);
234
+ context.logger.error(
235
+ "[Workflow post-action]: sync workflow trigger failed before execution created",
236
+ syncLogMeta
237
+ );
238
+ return context.throw(500, "Workflow on your action failed, please contact the administrator");
221
239
  }
222
240
  const { lastSavedJob, nodesMap } = processor;
223
241
  const lastNode = nodesMap.get(lastSavedJob == null ? void 0 : lastSavedJob.nodeId);
224
242
  if (processor.execution.status === import_plugin_workflow.EXECUTION_STATUS.RESOLVED) {
225
243
  if ((lastNode == null ? void 0 : lastNode.type) === "end") {
244
+ context.logger.debug("[Workflow post-action]: sync workflow ended request chain on end node", {
245
+ ...syncLogMeta,
246
+ ...(0, import_plugin_workflow.getWorkflowExecutionLogMeta)(workflow, processor)
247
+ });
226
248
  return;
227
249
  }
250
+ context.logger.debug("[Workflow post-action]: sync workflow finished successfully", {
251
+ ...syncLogMeta,
252
+ ...(0, import_plugin_workflow.getWorkflowExecutionLogMeta)(workflow, processor)
253
+ });
228
254
  continue;
229
255
  }
230
256
  if (processor.execution.status < import_plugin_workflow.EXECUTION_STATUS.STARTED) {
231
257
  if ((lastNode == null ? void 0 : lastNode.type) !== "end") {
258
+ context.logger.error("[Workflow post-action]: sync workflow failed", {
259
+ ...syncLogMeta,
260
+ ...(0, import_plugin_workflow.getWorkflowExecutionLogMeta)(workflow, processor)
261
+ });
232
262
  return context.throw(500, "Workflow on your action failed, please contact the administrator");
233
263
  }
264
+ context.logger.warn("[Workflow post-action]: sync workflow intercepted request on end node", {
265
+ ...syncLogMeta,
266
+ ...(0, import_plugin_workflow.getWorkflowExecutionLogMeta)(workflow, processor)
267
+ });
234
268
  const err = new RequestOnActionTriggerError("Request failed");
235
269
  err.status = 400;
236
270
  err.messages = context.state.messages;
237
271
  return context.throw(err.status, err);
238
272
  }
273
+ context.logger.error("[Workflow post-action]: sync workflow is still pending after trigger", {
274
+ ...syncLogMeta,
275
+ ...(0, import_plugin_workflow.getWorkflowExecutionLogMeta)(workflow, processor)
276
+ });
239
277
  return context.throw(500, "Workflow on your action hangs, please contact the administrator");
240
278
  }
241
279
  for (const event of asyncGroup) {
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description": "Triggered after the completion of a request initiated through an action button or API, such as after adding, updating, deleting data, or \"submit to workflow\". Suitable for data processing, sending notifications, etc., after actions are completed.",
7
7
  "description.ru-RU": "Срабатывает после завершения запроса, инициированного кнопкой действия или API, например после добавления, обновления, удаления данных или «отправки в рабочий процесс». Подходит для обработки данных, отправки уведомлений и т.д. после выполнения действий.",
8
8
  "description.zh-CN": "通过操作按钮或 API 发起请求并在执行完成后触发,比如新增、更新、删除数据或者“提交至工作流”之后。适用于在操作完成后进行数据处理、发送通知等。",
9
- "version": "2.1.0-alpha.14",
9
+ "version": "2.1.0-alpha.15",
10
10
  "license": "Apache-2.0",
11
11
  "main": "./dist/server/index.js",
12
12
  "homepage": "https://docs.nocobase.com/plugins/workflow-action-trigger",
@@ -26,7 +26,7 @@
26
26
  "@nocobase/server": "2.x",
27
27
  "@nocobase/test": "2.x"
28
28
  },
29
- "gitHead": "d8735b541de0ff9557bba704de49c799b4962672",
29
+ "gitHead": "7c86e75b0af4b9f532c8ebf5ef96a7423b0ab60e",
30
30
  "keywords": [
31
31
  "Workflow"
32
32
  ]