flowable-流程中心设计之结束事件(四)

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

flowable-流程中⼼设计之结束事件(四)
简介
流程开始于开始事件,⽌于结束事件,结束事件标志着(⼦)流程的(分⽀的)结束,结束事件是抛出型的,意味着流程结束会抛出⼀个结束结果。

结束事件分为:空结束事件、错误结束事件、取消结束事件、终⽌结束事件
空结束事件
说明
结束执⾏流并不会抛出结果,最常⽤的⼀个
设计
XML
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="/spec/BPMN/20100524/MODEL" xmlns:xsi="/2001/XMLSchema-instance" xmlns:xsd="/2001/XMLSchema" xmlns:flowable="/bpmn" <process id="add_product" name="新增审核" isExecutable="true">
<documentation>新增商品审核流程</documentation>
<startEvent id="startEvent1"></startEvent>
<userTask id="sid-01B3A151-EC35-4812-A114-2ADAC1868AEE" name="商品管理员审核" flowable:assignee="863">
<extensionElements>
<modeler:activiti-idm-assignee xmlns:modeler="/modeler"><![CDATA[true]]></modeler:activiti-idm-assignee>
<modeler:assignee-info-email xmlns:modeler="/modeler"><![CDATA[181********]]></modeler:assignee-info-email>
<modeler:assignee-info-firstname xmlns:modeler="/modeler"><![CDATA[⽢露见]]></modeler:assignee-info-firstname>
<modeler:assignee-info-lastname xmlns:modeler="/modeler"><![CDATA[⽢露见]]></modeler:assignee-info-lastname>
<modeler:initiator-can-complete xmlns:modeler="/modeler"><![CDATA[false]]></modeler:initiator-can-complete>
</extensionElements>
</userTask>
<endEvent id="sid-943B6EB9-8CAB-4E43-9F22-7FC39590D3DF">
<extensionElements>
<flowable:executionListener event="end"></flowable:executionListener>
</extensionElements>
</endEvent>
<sequenceFlow id="sid-9E28F162-AAA8-4753-AE4A-26E892438EC3" sourceRef="sid-01B3A151-EC35-4812-A114-2ADAC1868AEE" targetRef="sid-943B6EB9-8CAB-4E43-9F22-7FC39590D3DF"></sequenceFlow
<sequenceFlow id="sid-6613444C-C874-4545-8FE8-B9829DFC6B69" sourceRef="startEvent1" targetRef="sid-01B3A151-EC35-4812-A114-2ADAC1868AEE"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_add_product">
<bpmndi:BPMNPlane bpmnElement="add_product" id="BPMNPlane_add_product">
<bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1">
<omgdc:Bounds height="30.0" width="30.0" x="100.0" y="163.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-01B3A151-EC35-4812-A114-2ADAC1868AEE" id="BPMNShape_sid-01B3A151-EC35-4812-A114-2ADAC1868AEE">
<omgdc:Bounds height="80.0" width="100.0" x="225.0" y="135.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-943B6EB9-8CAB-4E43-9F22-7FC39590D3DF" id="BPMNShape_sid-943B6EB9-8CAB-4E43-9F22-7FC39590D3DF">
<omgdc:Bounds height="28.0" width="28.0" x="405.0" y="161.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sid-9E28F162-AAA8-4753-AE4A-26E892438EC3" id="BPMNEdge_sid-9E28F162-AAA8-4753-AE4A-26E892438EC3">
<omgdi:waypoint x="324.95000000000005" y="175.0"></omgdi:waypoint>
<omgdi:waypoint x="405.0" y="175.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-6613444C-C874-4545-8FE8-B9829DFC6B69" id="BPMNEdge_sid-6613444C-C874-4545-8FE8-B9829DFC6B69">
<omgdi:waypoint x="129.94464935299203" y="177.59473969032732"></omgdi:waypoint>
<omgdi:waypoint x="224.9999999999996" y="175.0256756756757"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
View Code
错误结束事件
说明
错误结束事件会在流程到达错误结束事件的时候抛出错误,并结束当前的流程分⽀。

错误可以使⽤使⽤匹配的错误边界中间事件(intermediate boundary error event)捕获。

如果找不到匹配的错误边界事
件,将会抛出异常(已测试)。

注:不能跨流程,⽐如A流程有个捕获 B流程错误结束。

⼀般⽤于⼦流程
设计
2.设置抛出和边界错误的引⽤为同⼀个
xml
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="/spec/BPMN/20100524/MODEL" xmlns:xsi="/2001/XMLSchema-instance" xmlns:xsd="/2001/XMLSchema" xmlns:flowable="/bpmn" <process id="test_error_end_event" name="错误结束事件测试" isExecutable="true">
<startEvent id="startEvent1"></startEvent>
<userTask id="sid-501019E3-B885-4CB5-8EFD-53706F28E48E" name="客服⼿动创建订单" flowable:assignee="客服01">
<extensionElements>
<modeler:initiator-can-complete xmlns:modeler="/modeler"><![CDATA[false]]></modeler:initiator-can-complete>
</extensionElements>
</userTask>
<sequenceFlow id="sid-18C7DE61-046A-40E7-BEB1-D0631FC4BD91" sourceRef="startEvent1" targetRef="sid-501019E3-B885-4CB5-8EFD-53706F28E48E"></sequenceFlow>
<subProcess id="sid-66D39BB3-B2B9-464E-B095-5EE0C489F128" name="subProcess">
<startEvent id="sid-1391FA1D-3077-44ED-A683-94608120BF0A"></startEvent>
<userTask id="sid-6A73E77D-F031-4E73-BA72-FBE4D5FCE13A" name="⽤户发起⽀付" flowable:assignee="user01">
<extensionElements>
<modeler:initiator-can-complete xmlns:modeler="/modeler"><![CDATA[false]]></modeler:initiator-can-complete>
</extensionElements>
</userTask>
<endEvent id="sid-449B7266-1537-48F5-AED2-42B3EFBEFA6A"></endEvent>
<endEvent id="sid-F4912CDF-AF70-48B5-881F-E8D64C34674A">
<errorEventDefinition errorRef="payError"></errorEventDefinition>
</endEvent>
<sequenceFlow id="sid-74A91280-D297-498A-A9F6-C12DE4C00B68" sourceRef="sid-1391FA1D-3077-44ED-A683-94608120BF0A" targetRef="sid-6A73E77D-F031-4E73-BA72-FBE4D5FCE13A"></sequenceFlow <sequenceFlow id="sid-51DC5F48-5FCC-4824-AD61-01021352CFC9" name="⽀付成功" sourceRef="sid-6A73E77D-F031-4E73-BA72-FBE4D5FCE13A" targetRef="sid-449B7266-1537-48F5-AED2-42B3EFBEFA6A"
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${money>0}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="sid-9C50131F-A932-4759-835C-C3D4E1E6627B" sourceRef="sid-6A73E77D-F031-4E73-BA72-FBE4D5FCE13A" targetRef="sid-F4912CDF-AF70-48B5-881F-E8D64C34674A">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${money<=0}]]></conditionExpression>
</sequenceFlow>
</subProcess>
<sequenceFlow id="sid-2C80D5EE-49FD-4A40-B53C-038B5DFD070A" sourceRef="sid-501019E3-B885-4CB5-8EFD-53706F28E48E" targetRef="sid-66D39BB3-B2B9-464E-B095-5EE0C489F128"></sequenceFlow
<endEvent id="sid-B8ABD2C9-A9C3-417F-9D31-93EA018C4E5C"></endEvent>
<sequenceFlow id="sid-18815521-001A-4B1A-BF5F-1748E1CBF854" sourceRef="sid-66D39BB3-B2B9-464E-B095-5EE0C489F128" targetRef="sid-B8ABD2C9-A9C3-417F-9D31-93EA018C4E5C"></sequenceFlow
<boundaryEvent id="sid-38596941-485C-4851-9C5C-7B5EF4457CAF" attachedToRef="sid-66D39BB3-B2B9-464E-B095-5EE0C489F128">
<errorEventDefinition errorRef="payError"></errorEventDefinition>
</boundaryEvent>
<userTask id="sid-D5BA302B-18A4-426A-9EE9-8CA7441927B9" name="修改订单状态异常" flowable:assignee="system01">
<extensionElements>
<modeler:initiator-can-complete xmlns:modeler="/modeler"><![CDATA[false]]></modeler:initiator-can-complete>
</extensionElements>
</userTask>
<sequenceFlow id="sid-F8C81E39-7BD5-4630-A995-5657879032B4" sourceRef="sid-38596941-485C-4851-9C5C-7B5EF4457CAF" targetRef="sid-D5BA302B-18A4-426A-9EE9-8CA7441927B9"></sequenceFlow
<endEvent id="sid-AEF93080-1239-4F5F-B3F7-E08EEEF8EF9B"></endEvent>
<sequenceFlow id="sid-FB5F1A4D-6283-44E0-A807-E929FF523E01" sourceRef="sid-D5BA302B-18A4-426A-9EE9-8CA7441927B9" targetRef="sid-AEF93080-1239-4F5F-B3F7-E08EEEF8EF9B"></sequenceFlow
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_test_error_end_event">
<bpmndi:BPMNPlane bpmnElement="test_error_end_event" id="BPMNPlane_test_error_end_event">
<bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1">
<omgdc:Bounds height="30.0" width="30.0" x="100.0" y="172.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-501019E3-B885-4CB5-8EFD-53706F28E48E" id="BPMNShape_sid-501019E3-B885-4CB5-8EFD-53706F28E48E">
<omgdc:Bounds height="80.0" width="100.0" x="165.0" y="147.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-66D39BB3-B2B9-464E-B095-5EE0C489F128" id="BPMNShape_sid-66D39BB3-B2B9-464E-B095-5EE0C489F128">
<omgdc:Bounds height="194.0" width="374.0" x="360.0" y="90.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-1391FA1D-3077-44ED-A683-94608120BF0A" id="BPMNShape_sid-1391FA1D-3077-44ED-A683-94608120BF0A">
<omgdc:Bounds height="30.0" width="30.0" x="390.0" y="145.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-6A73E77D-F031-4E73-BA72-FBE4D5FCE13A" id="BPMNShape_sid-6A73E77D-F031-4E73-BA72-FBE4D5FCE13A">
<omgdc:Bounds height="80.0" width="100.0" x="495.0" y="120.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-449B7266-1537-48F5-AED2-42B3EFBEFA6A" id="BPMNShape_sid-449B7266-1537-48F5-AED2-42B3EFBEFA6A">
<omgdc:Bounds height="28.0" width="28.0" x="675.0" y="146.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-F4912CDF-AF70-48B5-881F-E8D64C34674A" id="BPMNShape_sid-F4912CDF-AF70-48B5-881F-E8D64C34674A">
<omgdc:Bounds height="28.0" width="28.0" x="531.0" y="255.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-B8ABD2C9-A9C3-417F-9D31-93EA018C4E5C" id="BPMNShape_sid-B8ABD2C9-A9C3-417F-9D31-93EA018C4E5C">
<omgdc:Bounds height="28.0" width="28.0" x="840.0" y="173.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-38596941-485C-4851-9C5C-7B5EF4457CAF" id="BPMNShape_sid-38596941-485C-4851-9C5C-7B5EF4457CAF">
<omgdc:Bounds height="30.0" width="30.0" x="436.339298622689" y="269.39998685689847"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-D5BA302B-18A4-426A-9EE9-8CA7441927B9" id="BPMNShape_sid-D5BA302B-18A4-426A-9EE9-8CA7441927B9">
<omgdc:Bounds height="80.0" width="100.0" x="401.339298622689" y="390.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-AEF93080-1239-4F5F-B3F7-E08EEEF8EF9B" id="BPMNShape_sid-AEF93080-1239-4F5F-B3F7-E08EEEF8EF9B">
<omgdc:Bounds height="28.0" width="28.0" x="600.0" y="416.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sid-51DC5F48-5FCC-4824-AD61-01021352CFC9" id="BPMNEdge_sid-51DC5F48-5FCC-4824-AD61-01021352CFC9">
<omgdi:waypoint x="594.9499999999827" y="160.0"></omgdi:waypoint>
<omgdi:waypoint x="675.0" y="160.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-FB5F1A4D-6283-44E0-A807-E929FF523E01" id="BPMNEdge_sid-FB5F1A4D-6283-44E0-A807-E929FF523E01">
<omgdi:waypoint x="501.289298622689" y="430.0"></omgdi:waypoint>
<omgdi:waypoint x="600.0" y="430.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-2C80D5EE-49FD-4A40-B53C-038B5DFD070A" id="BPMNEdge_sid-2C80D5EE-49FD-4A40-B53C-038B5DFD070A">
<omgdi:waypoint x="264.95000000000005" y="187.0"></omgdi:waypoint>
<omgdi:waypoint x="359.99999999992826" y="187.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-74A91280-D297-498A-A9F6-C12DE4C00B68" id="BPMNEdge_sid-74A91280-D297-498A-A9F6-C12DE4C00B68">
<omgdi:waypoint x="419.9499990675947" y="160.0"></omgdi:waypoint>
<omgdi:waypoint x="495.0" y="160.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-F8C81E39-7BD5-4630-A995-5657879032B4" id="BPMNEdge_sid-F8C81E39-7BD5-4630-A995-5657879032B4">
<omgdi:waypoint x="451.339298622689" y="299.34998599487693"></omgdi:waypoint>
<omgdi:waypoint x="451.339298622689" y="390.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-18C7DE61-046A-40E7-BEB1-D0631FC4BD91" id="BPMNEdge_sid-18C7DE61-046A-40E7-BEB1-D0631FC4BD91">
<omgdi:waypoint x="129.94999817301806" y="187.0"></omgdi:waypoint>
<omgdi:waypoint x="164.99999999998187" y="187.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-9C50131F-A932-4759-835C-C3D4E1E6627B" id="BPMNEdge_sid-9C50131F-A932-4759-835C-C3D4E1E6627B">
<omgdi:waypoint x="545.0" y="199.95"></omgdi:waypoint>
<omgdi:waypoint x="545.0" y="255.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-18815521-001A-4B1A-BF5F-1748E1CBF854" id="BPMNEdge_sid-18815521-001A-4B1A-BF5F-1748E1CBF854">
<omgdi:waypoint x="733.95" y="187.0"></omgdi:waypoint>
<omgdi:waypoint x="840.0" y="187.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
View Code
终⽌结束事件
说明
当到达终⽌结束事件时,,会判断第⼀个范围 scope(流程或⼦流程)并终⽌它。

请注意在BPMN 2.0中,⼦流程可以是嵌⼊式⼦流程,调⽤活动,事件⼦流程,或事务⼦流程。

有⼀条通⽤规则:当存在
多实例的调⽤过程或嵌⼊式⼦流程时,只会终⽌⼀个实例,其他的实例与流程实例不会受影响。

可以添加⼀个可选属性terminateAll。

当其为true时,⽆论该终⽌结束事件在流程定义中的位置,也⽆论它
是否在⼦流程(甚⾄是嵌套⼦流程)中,都会终⽌(根)流程实例。

可以⽤在⼦流程,嵌⼊式⼦流程,调⽤⼦流程,事务字流程中。

设计
1.如果没有勾选终⽌流程,则和空结束事件⼀样,只会结束当前执⾏流,如果勾选了终⽌流程,则整个流程所有执⾏流都会结束
xml
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="/spec/BPMN/20100524/MODEL" xmlns:xsi="/2001/XMLSchema-instance" xmlns:xsd="/2001/XMLSchema" xmlns:flowable="/bpmn" <process id="test_top" name="测试流程终⽌" isExecutable="true">
<startEvent id="startEvent1"></startEvent>
<userTask id="sid-69CE65F9-BA77-469A-B746-92C65F526F67" name="发起⼈填表" flowable:assignee="张三丰⼩弟">
<extensionElements>
<modeler:initiator-can-complete xmlns:modeler="/modeler"><![CDATA[false]]></modeler:initiator-can-complete>
</extensionElements>
</userTask>
<sequenceFlow id="sid-230111BA-224B-4A0F-9E8A-0AC82EF3C85E" sourceRef="startEvent1" targetRef="sid-69CE65F9-BA77-469A-B746-92C65F526F67"></sequenceFlow>
<sequenceFlow id="sid-9DA91B51-2548-45C2-879E-FF38FB047525" sourceRef="sid-69CE65F9-BA77-469A-B746-92C65F526F67" targetRef="sid-E165482E-A4D7-4428-8A30-BDD17B631402"></sequenceFlow
<subProcess id="sid-E165482E-A4D7-4428-8A30-BDD17B631402" name="subProcess">
<startEvent id="sid-ABC94286-68F9-45EA-B7AC-93EEB2E0C835"></startEvent>
<userTask id="sid-EBEF4031-A52C-47A3-A114-9A27EF39EF8A" name="管理员审核" flowable:assignee="张三丰">
<extensionElements>
<modeler:initiator-can-complete xmlns:modeler="/modeler"><![CDATA[false]]></modeler:initiator-can-complete>
</extensionElements>
</userTask>
<endEvent id="sid-E386B866-E2D7-414E-871B-B7E81E37193A">
<terminateEventDefinition flowable:terminateAll="true"></terminateEventDefinition>
</endEvent>
<sequenceFlow id="sid-F7B5C919-0F04-4068-B7A2-1F92F1D82F57" sourceRef="sid-ABC94286-68F9-45EA-B7AC-93EEB2E0C835" targetRef="sid-EBEF4031-A52C-47A3-A114-9A27EF39EF8A"></sequenceFlow <sequenceFlow id="sid-CCEA63E8-3F3B-49B7-8A52-8B48D5DB7BA5" sourceRef="sid-EBEF4031-A52C-47A3-A114-9A27EF39EF8A" targetRef="sid-E386B866-E2D7-414E-871B-B7E81E37193A"></sequenceFlow
</subProcess>
<userTask id="sid-DEC6EEF2-7B3D-4F93-97F4-DC1BED1245A1" name="判定审核状态" flowable:assignee="system">
<extensionElements>
<modeler:initiator-can-complete xmlns:modeler="/modeler"><![CDATA[false]]></modeler:initiator-can-complete>
</extensionElements>
</userTask>
<sequenceFlow id="sid-383F1D3E-B719-4CC9-8E8A-613BE6F9EB7F" sourceRef="sid-E165482E-A4D7-4428-8A30-BDD17B631402" targetRef="sid-DEC6EEF2-7B3D-4F93-97F4-DC1BED1245A1"></sequenceFlow
<endEvent id="sid-4ABC05A2-0ECE-4583-A3B5-77EBDF918716"></endEvent>
<sequenceFlow id="sid-FA04A16D-3AE0-4D6D-9283-675F7295B88D" sourceRef="sid-DEC6EEF2-7B3D-4F93-97F4-DC1BED1245A1" targetRef="sid-4ABC05A2-0ECE-4583-A3B5-77EBDF918716"></sequenceFlow
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_test_top">
<bpmndi:BPMNPlane bpmnElement="test_top" id="BPMNPlane_test_top">
<bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1">
<omgdc:Bounds height="30.0" width="30.0" x="60.0" y="140.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-69CE65F9-BA77-469A-B746-92C65F526F67" id="BPMNShape_sid-69CE65F9-BA77-469A-B746-92C65F526F67">
<omgdc:Bounds height="80.0" width="100.0" x="135.0" y="115.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-E165482E-A4D7-4428-8A30-BDD17B631402" id="BPMNShape_sid-E165482E-A4D7-4428-8A30-BDD17B631402">
<omgdc:Bounds height="162.0" width="393.0" x="315.0" y="74.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-ABC94286-68F9-45EA-B7AC-93EEB2E0C835" id="BPMNShape_sid-ABC94286-68F9-45EA-B7AC-93EEB2E0C835">
<omgdc:Bounds height="30.0" width="30.0" x="370.0" y="140.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-EBEF4031-A52C-47A3-A114-9A27EF39EF8A" id="BPMNShape_sid-EBEF4031-A52C-47A3-A114-9A27EF39EF8A">
<omgdc:Bounds height="80.0" width="100.0" x="445.0" y="115.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-E386B866-E2D7-414E-871B-B7E81E37193A" id="BPMNShape_sid-E386B866-E2D7-414E-871B-B7E81E37193A">
<omgdc:Bounds height="28.0" width="28.0" x="630.0" y="142.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-DEC6EEF2-7B3D-4F93-97F4-DC1BED1245A1" id="BPMNShape_sid-DEC6EEF2-7B3D-4F93-97F4-DC1BED1245A1">
<omgdc:Bounds height="80.0" width="100.0" x="753.0" y="116.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-4ABC05A2-0ECE-4583-A3B5-77EBDF918716" id="BPMNShape_sid-4ABC05A2-0ECE-4583-A3B5-77EBDF918716">
<omgdc:Bounds height="28.0" width="28.0" x="898.0" y="142.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sid-230111BA-224B-4A0F-9E8A-0AC82EF3C85E" id="BPMNEdge_sid-230111BA-224B-4A0F-9E8A-0AC82EF3C85E">
<omgdi:waypoint x="89.94999848995758" y="155.0"></omgdi:waypoint>
<omgdi:waypoint x="135.0" y="155.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-9DA91B51-2548-45C2-879E-FF38FB047525" id="BPMNEdge_sid-9DA91B51-2548-45C2-879E-FF38FB047525">
<omgdi:waypoint x="234.94999999997728" y="155.0"></omgdi:waypoint>
<omgdi:waypoint x="314.9999999999991" y="155.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-CCEA63E8-3F3B-49B7-8A52-8B48D5DB7BA5" id="BPMNEdge_sid-CCEA63E8-3F3B-49B7-8A52-8B48D5DB7BA5">
<omgdi:waypoint x="544.9499999999964" y="155.33523489932884"></omgdi:waypoint>
<omgdi:waypoint x="630.0000838516468" y="155.9060423405678"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-FA04A16D-3AE0-4D6D-9283-675F7295B88D" id="BPMNEdge_sid-FA04A16D-3AE0-4D6D-9283-675F7295B88D">
<omgdi:waypoint x="852.949999999934" y="156.0"></omgdi:waypoint>
<omgdi:waypoint x="898.0" y="156.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-F7B5C919-0F04-4068-B7A2-1F92F1D82F57" id="BPMNEdge_sid-F7B5C919-0F04-4068-B7A2-1F92F1D82F57">
<omgdi:waypoint x="399.9499984899576" y="155.0"></omgdi:waypoint>
<omgdi:waypoint x="445.0" y="155.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-383F1D3E-B719-4CC9-8E8A-613BE6F9EB7F" id="BPMNEdge_sid-383F1D3E-B719-4CC9-8E8A-613BE6F9EB7F">
<omgdi:waypoint x="707.95" y="155.0"></omgdi:waypoint>
<omgdi:waypoint x="730.5" y="155.0"></omgdi:waypoint>
<omgdi:waypoint x="730.5" y="156.0"></omgdi:waypoint>
<omgdi:waypoint x="752.999999999986" y="156.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
View Code
取消结束事件
说明
取消结束事件,只能与bpmn事务⼦流程(bpmn transaction subprocess)⼀起使⽤。

当到达取消结束事件时,会抛出取消事件,且必须由取消边界事件(cancel boundary event)捕获。

之后这个取消
边界事件将取消事务,并触发补偿(compensation)。

设计
xml
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="/spec/BPMN/20100524/MODEL" xmlns:xsi="/2001/XMLSchema-instance" xmlns:xsd="/2001/XMLSchema" xmlns:flowable="/bpmn" <process id="cancel_test" name="取消事件测试" isExecutable="true">
<startEvent id="startEvent1"></startEvent>
<userTask id="sid-A34D5144-ED86-4782-8FC3-DBC10512AB40" name="发起⼈填表"></userTask>
<sequenceFlow id="sid-567D1B46-3837-4E6E-B169-2912D9CB7858" sourceRef="startEvent1" targetRef="sid-A34D5144-ED86-4782-8FC3-DBC10512AB40"></sequenceFlow>
<subProcess id="sid-A61AD57A-ED87-4808-B61A-F542513E7B89" name="subProcess">
<startEvent id="sid-36D3167D-A191-4CE2-9ACE-8BB543714F49"></startEvent>
<userTask id="sid-B303EE37-B516-442E-89E2-12CDC2FFF325" name="管理员审核"></userTask>
<endEvent id="sid-B7EBB58D-5143-4C76-9FE3-CD686FA5CEE3"></endEvent>
<endEvent id="sid-2EA5230D-A612-4FAF-8D7F-979A06683164">
<cancelEventDefinition></cancelEventDefinition>
</endEvent>
<sequenceFlow id="sid-C16B1AB5-BB64-4930-BBCD-768BB924CC13" sourceRef="sid-36D3167D-A191-4CE2-9ACE-8BB543714F49" targetRef="sid-B303EE37-B516-442E-89E2-12CDC2FFF325"></sequenceFlow <sequenceFlow id="sid-CA6ADAB6-D943-4F30-9DE8-82368B8E26D4" sourceRef="sid-B303EE37-B516-442E-89E2-12CDC2FFF325" targetRef="sid-B7EBB58D-5143-4C76-9FE3-CD686FA5CEE3"></sequenceFlow <sequenceFlow id="sid-E0FF51D8-9EAE-47B8-8907-CD0E04058579" sourceRef="sid-B303EE37-B516-442E-89E2-12CDC2FFF325" targetRef="sid-2EA5230D-A612-4FAF-8D7F-979A06683164"></sequenceFlow
</subProcess>
<userTask id="sid-D9BBB6F5-379D-4676-8B16-1805D0072090" name="管理员2审核"></userTask>
<sequenceFlow id="sid-2EF5E141-326A-4B68-8989-B655B8240C51" sourceRef="sid-A61AD57A-ED87-4808-B61A-F542513E7B89" targetRef="sid-D9BBB6F5-379D-4676-8B16-1805D0072090"></sequenceFlow
<endEvent id="sid-72D86EBD-2715-44BC-A64D-E44D8B1B2A32"></endEvent>
<sequenceFlow id="sid-FA142829-9975-4421-A54D-665BA1674286" sourceRef="sid-D9BBB6F5-379D-4676-8B16-1805D0072090" targetRef="sid-72D86EBD-2715-44BC-A64D-E44D8B1B2A32"></sequenceFlow
<sequenceFlow id="sid-AA4C8A80-71FF-432A-AA2A-267DDEDC0536" sourceRef="sid-A34D5144-ED86-4782-8FC3-DBC10512AB40" targetRef="sid-A61AD57A-ED87-4808-B61A-F542513E7B89"></sequenceFlow
<boundaryEvent id="sid-CA018FD9-6B5D-458C-BAA8-5522F2FE761C" attachedToRef="sid-A61AD57A-ED87-4808-B61A-F542513E7B89" cancelActivity="false">
<cancelEventDefinition></cancelEventDefinition>
</boundaryEvent>
<userTask id="sid-990BEB7E-D00A-4492-8ED0-57E5D6FBED16" name="修改状态为取消"></userTask>
<sequenceFlow id="sid-A7E95E0C-86DD-444A-B36D-44BBBFD40516" sourceRef="sid-CA018FD9-6B5D-458C-BAA8-5522F2FE761C" targetRef="sid-990BEB7E-D00A-4492-8ED0-57E5D6FBED16"></sequenceFlow <endEvent id="sid-053D9FC5-DD1B-445A-B45A-2AE36C44602B"></endEvent>
<sequenceFlow id="sid-613A7019-481C-4D3A-82C6-9263A6F13FA2" sourceRef="sid-990BEB7E-D00A-4492-8ED0-57E5D6FBED16" targetRef="sid-053D9FC5-DD1B-445A-B45A-2AE36C44602B"></sequenceFlow </process>
<bpmndi:BPMNDiagram id="BPMNDiagram_cancel_test">
<bpmndi:BPMNPlane bpmnElement="cancel_test" id="BPMNPlane_cancel_test">
<bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1">
<omgdc:Bounds height="30.0" width="30.0" x="90.0" y="175.5"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-A34D5144-ED86-4782-8FC3-DBC10512AB40" id="BPMNShape_sid-A34D5144-ED86-4782-8FC3-DBC10512AB40">
<omgdc:Bounds height="80.0" width="100.0" x="165.0" y="150.5"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-A61AD57A-ED87-4808-B61A-F542513E7B89" id="BPMNShape_sid-A61AD57A-ED87-4808-B61A-F542513E7B89">
<omgdc:Bounds height="231.0" width="303.0" x="330.0" y="75.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-36D3167D-A191-4CE2-9ACE-8BB543714F49" id="BPMNShape_sid-36D3167D-A191-4CE2-9ACE-8BB543714F49">
<omgdc:Bounds height="30.0" width="30.0" x="363.0" y="150.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-B303EE37-B516-442E-89E2-12CDC2FFF325" id="BPMNShape_sid-B303EE37-B516-442E-89E2-12CDC2FFF325">
<omgdc:Bounds height="80.0" width="100.0" x="435.0" y="125.5"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-B7EBB58D-5143-4C76-9FE3-CD686FA5CEE3" id="BPMNShape_sid-B7EBB58D-5143-4C76-9FE3-CD686FA5CEE3">
<omgdc:Bounds height="28.0" width="28.0" x="585.0" y="151.5"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-2EA5230D-A612-4FAF-8D7F-979A06683164" id="BPMNShape_sid-2EA5230D-A612-4FAF-8D7F-979A06683164">
<omgdc:Bounds height="28.0" width="28.0" x="469.0" y="255.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-D9BBB6F5-379D-4676-8B16-1805D0072090" id="BPMNShape_sid-D9BBB6F5-379D-4676-8B16-1805D0072090">
<omgdc:Bounds height="80.0" width="100.0" x="735.0" y="150.5"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-72D86EBD-2715-44BC-A64D-E44D8B1B2A32" id="BPMNShape_sid-72D86EBD-2715-44BC-A64D-E44D8B1B2A32">
<omgdc:Bounds height="28.0" width="28.0" x="900.0" y="176.5"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-CA018FD9-6B5D-458C-BAA8-5522F2FE761C" id="BPMNShape_sid-CA018FD9-6B5D-458C-BAA8-5522F2FE761C">
<omgdc:Bounds height="30.0" width="30.0" x="410.25052724357926" y="291.0231107147996"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-990BEB7E-D00A-4492-8ED0-57E5D6FBED16" id="BPMNShape_sid-990BEB7E-D00A-4492-8ED0-57E5D6FBED16">
<omgdc:Bounds height="80.0" width="100.0" x="375.25052724357926" y="390.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-053D9FC5-DD1B-445A-B45A-2AE36C44602B" id="BPMNShape_sid-053D9FC5-DD1B-445A-B45A-2AE36C44602B">
<omgdc:Bounds height="28.0" width="28.0" x="520.2505272435792" y="416.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sid-C16B1AB5-BB64-4930-BBCD-768BB924CC13" id="BPMNEdge_sid-C16B1AB5-BB64-4930-BBCD-768BB924CC13">
<omgdi:waypoint x="392.9498068448925" y="165.0698592926006"></omgdi:waypoint>
<omgdi:waypoint x="434.9999999999972" y="165.2663551401869"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-567D1B46-3837-4E6E-B169-2912D9CB7858" id="BPMNEdge_sid-567D1B46-3837-4E6E-B169-2912D9CB7858">
<omgdi:waypoint x="119.94999848995758" y="190.5"></omgdi:waypoint>
<omgdi:waypoint x="164.9999999999917" y="190.5"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-2EF5E141-326A-4B68-8989-B655B8240C51" id="BPMNEdge_sid-2EF5E141-326A-4B68-8989-B655B8240C51">
<omgdi:waypoint x="632.95" y="190.5"></omgdi:waypoint>
<omgdi:waypoint x="735.0" y="190.5"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-613A7019-481C-4D3A-82C6-9263A6F13FA2" id="BPMNEdge_sid-613A7019-481C-4D3A-82C6-9263A6F13FA2">
<omgdi:waypoint x="475.2005272435132" y="430.0"></omgdi:waypoint>
<omgdi:waypoint x="520.2505272435792" y="430.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-AA4C8A80-71FF-432A-AA2A-267DDEDC0536" id="BPMNEdge_sid-AA4C8A80-71FF-432A-AA2A-267DDEDC0536">
<omgdi:waypoint x="264.94999999995815" y="190.5"></omgdi:waypoint>
<omgdi:waypoint x="329.9999999999015" y="190.5"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-E0FF51D8-9EAE-47B8-8907-CD0E04058579" id="BPMNEdge_sid-E0FF51D8-9EAE-47B8-8907-CD0E04058579">
<omgdi:waypoint x="484.22705314009664" y="205.45"></omgdi:waypoint>
<omgdi:waypoint x="483.26951588780975" y="255.0025619309542"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-CA6ADAB6-D943-4F30-9DE8-82368B8E26D4" id="BPMNEdge_sid-CA6ADAB6-D943-4F30-9DE8-82368B8E26D4">
<omgdi:waypoint x="534.95" y="165.5"></omgdi:waypoint>
<omgdi:waypoint x="585.0" y="165.5"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-FA142829-9975-4421-A54D-665BA1674286" id="BPMNEdge_sid-FA142829-9975-4421-A54D-665BA1674286">
<omgdi:waypoint x="834.9499999999999" y="190.5"></omgdi:waypoint>
<omgdi:waypoint x="900.0" y="190.5"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-A7E95E0C-86DD-444A-B36D-44BBBFD40516" id="BPMNEdge_sid-A7E95E0C-86DD-444A-B36D-44BBBFD40516">
<omgdi:waypoint x="425.25052724357926" y="320.9731095259939"></omgdi:waypoint>
<omgdi:waypoint x="425.25052724357926" y="390.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
View Code。

相关文档
最新文档