其他分享
首页 > 其他分享> > 工作流 Flowable 节点自由跳转

工作流 Flowable 节点自由跳转

作者:互联网

Flowable6已经实现了流程节点间的跳转,本次就初探一下相关的API。

相关的示例代码在Flowable的开源代码中可以找到,具体的位置如下:

\modules\flowable-engine\src\test\java\org\flowable\engine\test\api\runtime\changestate

代码:

/**
 * 移动节点
 * www.fhadmin.org
 */
@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();

 


标签:PathVariable,Flowable,nodeId,String,toNodeId,跳转,节点,proInstId
来源: https://blog.51cto.com/u_14622073/2703301