Flowable6已經實作了流程節點間的跳轉,本次就初探一下相關的API。
相關的示例代碼在Flowable的開源代碼中可以找到,具體的位置如下:
\modules\flowable-engine\src\test\java\org\flowable\engine\test\api\runtime\changestate
代碼:
/**
* 移動節點
* from fhadmin.cn
*/
@RequestMapping(value = "move/{proInstId}/{nodeId}/{toNodeId}")
public void move(@PathVariable("proInstId") String proInstId,
@PathVariable("nodeId") String nodeId,
@PathVariable("toNodeId") String toNodeId) {
runtimeService.createChangeActivityStateBuilder()
.processInstanceId(proInstId)
.moveActivityIdTo(nodeId, toNodeId)
.changeState();
}
runtimeService.createChangeActivityStateBuilder()
.processInstanceId(proInstId)
.moveActivityIdTo(nodeId, toNodeId)
.changeState();