我试图弄清楚如何确定使用 Camunda 提供的 REST API 的 BPM 流程调用是否成功,该 API 将从 Node.js 应用程序调用:
http://localhost:8080/engine-rest/process-definition/key/TestBPM/start
{
"links": [
{
"method": "GET",
"href": "http://localhost:8080/engine-rest/process-instance/72cc8ced-42e9-11e6-9c9d-4c72b965fca0",
"rel": "self"
}
],
"id": "72cc8ced-42e9-11e6-9c9d-4c72b965fca0",
"definitionId": "TestBPM:4:128925ef-42e9-11e6-9c9d-4c72b965fca0",
"businessKey": null,
"caseInstanceId": null,
"ended": true,
"suspended": false,
"tenantId": null
}
在该 JSON 响应中,我收到进程结束的信息,但我需要知道是在哪种结束状态下结束了该进程......我有办法做到这一点吗??
BPM:
最佳答案
通常您会使用一些服务或脚本任务来处理您的数据。您的 BPMN 图仅包含事件和网关,这是相当不寻常的。
但是,通过您的图表,有两种方法可以实现您的目标:
- 使用 Activity 级别的历史记录:https://docs.camunda.org/manual/7.5/user-guide/process-engine/history/并查询数据库。
- 如果您不想轮询数据库,只需在结束事件上使用事件监听器:https://docs.camunda.org/manual/7.5/user-guide/process-engine/delegation-code/#execution-listener
关于java - 如何知道 BPM 流程是否成功,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38211759/