Flowable自由跳转
Flowable6已经实现了流程节点间的跳转,本次就初探一下相关的API。
相关的示例代码在Flowable的开源代码中可以找到,具体的位置如下:
modulesflowable-enginesrc estjavaorgflowableengine estapi
untimechangestate
代码:
/** * 移动节点 * www.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();