flowable-流程中心設計之結束事件(四)

簡介

流程開始於開始事件,止於結束事件,結束事件標誌着(子)流程的(分支的)結束,結束事件是拋出型的,意味着流程結束會拋出一個結束結果。

結束事件分爲:空結束事件、錯誤結束事件、取消結束事件、終止結束事件

 

 

空結束事件

說明

結束執行流並不會拋出結果,最常用的一個

設計

XML

 

<?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="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="http://flowable.org/modeler"><![CDATA[true]]></modeler:activiti-idm-assignee>
        <modeler:assignee-info-email xmlns:modeler="http://flowable.org/modeler"><![CDATA[18140017213]]></modeler:assignee-info-email>
        <modeler:assignee-info-firstname xmlns:modeler="http://flowable.org/modeler"><![CDATA[甘露見]]></modeler:assignee-info-firstname>
        <modeler:assignee-info-lastname xmlns:modeler="http://flowable.org/modeler"><![CDATA[甘露見]]></modeler:assignee-info-lastname>
        <modeler:initiator-can-complete xmlns:modeler="http://flowable.org/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="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="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="http://flowable.org/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="http://flowable.org/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="http://flowable.org/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="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="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="http://flowable.org/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="http://flowable.org/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="http://flowable.org/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="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="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

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章