flowable 单节点跳转

 

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:flowable="http://flowable.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.flowable.org/processdef">
  <process id="节点跳转测试" name="节点跳转测试" isExecutable="true">
    <startEvent id="startEvent1"></startEvent>
    <userTask id="sid-56185228-F969-41F2-8850-52F9ECFDE51A" name="jump1" flowable:assignee="${assignee}">
      <extensionElements>
        <flowable:taskListener event="create" class="com.flowable.conf.UserTaskListener"></flowable:taskListener>
        <modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler"><![CDATA[false]]></modeler:initiator-can-complete>
      </extensionElements>
    </userTask>
    <sequenceFlow id="sid-DD7E1E0C-4D89-486A-BD26-7C4BD7C78CFB" sourceRef="startEvent1" targetRef="sid-56185228-F969-41F2-8850-52F9ECFDE51A"></sequenceFlow>
    <userTask id="sid-62F40B60-E15C-4373-AE11-A0FB15AC8BA6" name="jump2" flowable:assignee="${assignee}">
      <extensionElements>
        <flowable:taskListener event="create" class="com.flowable.conf.UserTaskListener"></flowable:taskListener>
        <modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler"><![CDATA[false]]></modeler:initiator-can-complete>
      </extensionElements>
    </userTask>
    <sequenceFlow id="sid-D7CBF7AA-7DBD-48CE-8059-510EBF9EB995" sourceRef="sid-56185228-F969-41F2-8850-52F9ECFDE51A" targetRef="sid-62F40B60-E15C-4373-AE11-A0FB15AC8BA6"></sequenceFlow>
    <userTask id="sid-7FC8B9BE-1AF6-462F-B2F8-6C4BDE0DD10F" name="jump3" flowable:assignee="${assignee}">
      <extensionElements>
        <flowable:taskListener event="create" class="com.flowable.conf.UserTaskListener"></flowable:taskListener>
        <modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler"><![CDATA[false]]></modeler:initiator-can-complete>
      </extensionElements>
    </userTask>
    <sequenceFlow id="sid-9C409457-03FE-482B-A83D-71A78F10CE98" sourceRef="sid-62F40B60-E15C-4373-AE11-A0FB15AC8BA6" targetRef="sid-7FC8B9BE-1AF6-462F-B2F8-6C4BDE0DD10F"></sequenceFlow>
    <userTask id="sid-D854E6D4-FD96-4374-9C77-A3D995212260" name="jump4" flowable:assignee="${assignee}">
      <extensionElements>
        <flowable:taskListener event="create" class="com.flowable.conf.UserTaskListener"></flowable:taskListener>
        <modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler"><![CDATA[false]]></modeler:initiator-can-complete>
      </extensionElements>
    </userTask>
    <sequenceFlow id="sid-EB2218E5-002A-4195-9C8D-44283624E20F" sourceRef="sid-7FC8B9BE-1AF6-462F-B2F8-6C4BDE0DD10F" targetRef="sid-D854E6D4-FD96-4374-9C77-A3D995212260"></sequenceFlow>
    <endEvent id="sid-C57739A2-F4BD-4080-B8C9-99964B758B46"></endEvent>
    <sequenceFlow id="sid-F0219DC7-2D07-4832-99BC-9AC345E5E62B" sourceRef="sid-D854E6D4-FD96-4374-9C77-A3D995212260" targetRef="sid-C57739A2-F4BD-4080-B8C9-99964B758B46"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_节点跳转测试">
    <bpmndi:BPMNPlane bpmnElement="节点跳转测试" id="BPMNPlane_节点跳转测试">
      <bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1">
        <omgdc:Bounds height="30.0" width="30.0" x="105.0" y="150.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-56185228-F969-41F2-8850-52F9ECFDE51A" id="BPMNShape_sid-56185228-F969-41F2-8850-52F9ECFDE51A">
        <omgdc:Bounds height="80.0" width="100.0" x="195.0" y="125.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-62F40B60-E15C-4373-AE11-A0FB15AC8BA6" id="BPMNShape_sid-62F40B60-E15C-4373-AE11-A0FB15AC8BA6">
        <omgdc:Bounds height="80.0" width="100.0" x="375.0" y="125.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-7FC8B9BE-1AF6-462F-B2F8-6C4BDE0DD10F" id="BPMNShape_sid-7FC8B9BE-1AF6-462F-B2F8-6C4BDE0DD10F">
        <omgdc:Bounds height="80.0" width="100.0" x="570.0" y="125.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-D854E6D4-FD96-4374-9C77-A3D995212260" id="BPMNShape_sid-D854E6D4-FD96-4374-9C77-A3D995212260">
        <omgdc:Bounds height="80.0" width="100.0" x="735.0" y="125.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-C57739A2-F4BD-4080-B8C9-99964B758B46" id="BPMNShape_sid-C57739A2-F4BD-4080-B8C9-99964B758B46">
        <omgdc:Bounds height="28.0" width="28.0" x="915.0" y="151.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="sid-D7CBF7AA-7DBD-48CE-8059-510EBF9EB995" id="BPMNEdge_sid-D7CBF7AA-7DBD-48CE-8059-510EBF9EB995">
        <omgdi:waypoint x="294.9499999999431" y="165.0"></omgdi:waypoint>
        <omgdi:waypoint x="375.0" y="165.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-EB2218E5-002A-4195-9C8D-44283624E20F" id="BPMNEdge_sid-EB2218E5-002A-4195-9C8D-44283624E20F">
        <omgdi:waypoint x="669.9499999999836" y="165.0"></omgdi:waypoint>
        <omgdi:waypoint x="734.9999999999847" y="165.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-F0219DC7-2D07-4832-99BC-9AC345E5E62B" id="BPMNEdge_sid-F0219DC7-2D07-4832-99BC-9AC345E5E62B">
        <omgdi:waypoint x="834.9499999999827" y="165.0"></omgdi:waypoint>
        <omgdi:waypoint x="915.0" y="165.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-9C409457-03FE-482B-A83D-71A78F10CE98" id="BPMNEdge_sid-9C409457-03FE-482B-A83D-71A78F10CE98">
        <omgdi:waypoint x="474.9499999999802" y="165.0"></omgdi:waypoint>
        <omgdi:waypoint x="570.0" y="165.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-DD7E1E0C-4D89-486A-BD26-7C4BD7C78CFB" id="BPMNEdge_sid-DD7E1E0C-4D89-486A-BD26-7C4BD7C78CFB">
        <omgdi:waypoint x="134.94999883049306" y="165.0"></omgdi:waypoint>
        <omgdi:waypoint x="195.0" y="165.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

/** * 串行节点跳转 需要将模型的节点信息存进一个大的map

*

*@param processId 部署id

*@param taskName 当前节点任务key

* @param targetNodeName 下一节点任务key */

public void taskJumpCmd(String processId, String taskkey, String targetNodekey) { runtimeService.createChangeActivityStateBuilder() .processInstanceId(processId) .moveActivityIdTo(taskkey, targetNodekey) .changeState(); }

/**
* 单节点跳转
*
* @param taskName 任务id
* @param targetNodeName 节点
* @param processId 流程部署id
*/
@PostMapping("taskJumpCmd")
@ResponseBody
public void taskJumpCmd(@RequestParam("processId") String processId, @RequestParam("taskkey") String taskkey, @RequestParam("targetNodekey") String targetNodekey) {
flowableUtil.taskJumpCmd(processId, taskkey, targetNodekey);
}

 跳转之后代理人信息会丢失需要重新设置,可以在ACT_HI_TASKINST找到历史节点走向信息,找到跳转节点的代理人并设置。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值