之前寫過一個(gè)關(guān)于flowable實(shí)現(xiàn)多實(shí)例節(jié)點(diǎn)的自由跳轉(zhuǎn)的文章,但后面研究發(fā)現(xiàn),原來flowable已經(jīng)提供了前后跳轉(zhuǎn)的方法,只是我不知道而已
方法如下:
runtimeService.createChangeActivityStateBuilder().processInstanceId(task.getProcessInstanceId())
.moveActivityIdTo(task.getTaskDefinitionKey(), operationContext.getTargetNodeId())
.processVariables(operationContext.getFormData()).changeState();
確實(shí)這樣簡(jiǎn)單及方便多了!