flowable 撤回发起代码
时间: 2023-08-25 13:13:06 浏览: 53
在 Flowable 中,撤回发起的代码取决于你是使用 Flowable 的哪个版本以及你是如何发起流程的。以下是一些常见的撤回发起代码示例:
1. Flowable 6.x 版本:
```java
// 获取流程引擎
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
RuntimeService runtimeService = processEngine.getRuntimeService();
// 根据流程实例 ID 撤回流程
String processInstanceId = "yourProcessInstanceId";
runtimeService.deleteProcessInstance(processInstanceId, "撤回原因");
```
2. Flowable 5.x 版本:
```java
// 获取流程引擎
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
ManagementService managementService = processEngine.getManagementService();
// 根据流程实例 ID 撤回流程
String processInstanceId = "yourProcessInstanceId";
managementService.executeCommand(new DeleteProcessInstanceCmd(processInstanceId, "撤回原因"));
```
请注意,以上代码仅供参考,具体实现可能会因你的业务需求和使用情况而有所不同。另外,撤回流程需要根据你的业务逻辑来实现,包括判断流程状态、更新相关数据等。