<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_ReviewRerun" targetNamespace="http://bpmn.io/schema/bpmn">
  <bpmn:collaboration id="Collaboration_ReviewRerun">
    <bpmn:participant id="Participant_Platform" name="檢視與重跑｜已確認需求與待補防護" processRef="Process_ReviewRerun" />
  </bpmn:collaboration>
  <bpmn:process id="Process_ReviewRerun" name="檢視與重跑｜已確認需求與待補防護" isExecutable="false">
    <bpmn:laneSet id="LaneSet_ReviewRerun">
      <bpmn:lane id="Lane_Owner" name="平台維護者">
        <bpmn:flowNodeRef>Event_Start</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Activity_Read</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Gateway_Issue</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Activity_Triage</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Gateway_Rerun</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Activity_Safe</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Activity_Invoke</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Activity_Reconcile</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Event_Pending</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Event_End</bpmn:flowNodeRef>
      </bpmn:lane>
      <bpmn:lane id="Lane_Dev" name="對應系統開發人員">
        <bpmn:flowNodeRef>Activity_Fix</bpmn:flowNodeRef>
      </bpmn:lane>
      <bpmn:lane id="Lane_Crystal" name="Crystal 管理平台">
        <bpmn:flowNodeRef>Activity_Accept</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Gateway_Started</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Event_New</bpmn:flowNodeRef>
      </bpmn:lane>
    </bpmn:laneSet>
    <bpmn:startEvent id="Event_Start" name="需檢視結果或補跑">
      <bpmn:outgoing>Flow_StartToRead</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:sequenceFlow id="Flow_StartToRead" sourceRef="Event_Start" targetRef="Activity_Read" />
    <bpmn:userTask id="Activity_Read" name="查閱 Run 與案例步驟">
      <bpmn:incoming>Flow_StartToRead</bpmn:incoming>
      <bpmn:outgoing>Flow_ReadToIssue</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:sequenceFlow id="Flow_ReadToIssue" sourceRef="Activity_Read" targetRef="Gateway_Issue" />
    <bpmn:exclusiveGateway id="Gateway_Issue" name="是否需要修正?" default="Flow_IssueToRerun">
      <bpmn:incoming>Flow_ReadToIssue</bpmn:incoming>
      <bpmn:outgoing>Flow_IssueToTriage</bpmn:outgoing>
      <bpmn:outgoing>Flow_IssueToRerun</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:sequenceFlow id="Flow_IssueToTriage" name="需要修正" sourceRef="Gateway_Issue" targetRef="Activity_Triage">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">needsFix</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="Flow_IssueToRerun" name="無需修正" sourceRef="Gateway_Issue" targetRef="Gateway_Rerun" />
    <bpmn:userTask id="Activity_Triage" name="判斷平台資料或系統問題">
      <bpmn:incoming>Flow_IssueToTriage</bpmn:incoming>
      <bpmn:outgoing>Flow_TriageToFix</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:sequenceFlow id="Flow_TriageToFix" sourceRef="Activity_Triage" targetRef="Activity_Fix" />
    <bpmn:userTask id="Activity_Fix" name="修正問題與確認資料">
      <bpmn:incoming>Flow_TriageToFix</bpmn:incoming>
      <bpmn:outgoing>Flow_FixToRerun</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:sequenceFlow id="Flow_FixToRerun" sourceRef="Activity_Fix" targetRef="Gateway_Rerun" />
    <bpmn:exclusiveGateway id="Gateway_Rerun" name="決定重跑整個 Plan?" default="Flow_RerunToEnd">
      <bpmn:incoming>Flow_IssueToRerun</bpmn:incoming>
      <bpmn:incoming>Flow_FixToRerun</bpmn:incoming>
      <bpmn:outgoing>Flow_RerunToSafe</bpmn:outgoing>
      <bpmn:outgoing>Flow_RerunToEnd</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:sequenceFlow id="Flow_RerunToSafe" name="決定重跑" sourceRef="Gateway_Rerun" targetRef="Activity_Safe">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">rerunApproved</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="Flow_RerunToEnd" name="不重跑" sourceRef="Gateway_Rerun" targetRef="Event_End" />
    <bpmn:userTask id="Activity_Safe" name="確認共用環境與副作用已收尾">
      <bpmn:incoming>Flow_RerunToSafe</bpmn:incoming>
      <bpmn:outgoing>Flow_SafeToInvoke</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:sequenceFlow id="Flow_SafeToInvoke" sourceRef="Activity_Safe" targetRef="Activity_Invoke" />
    <bpmn:userTask id="Activity_Invoke" name="以維護者身分提出新執行">
      <bpmn:incoming>Flow_SafeToInvoke</bpmn:incoming>
      <bpmn:outgoing>Flow_InvokeToAccept</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:sequenceFlow id="Flow_InvokeToAccept" sourceRef="Activity_Invoke" targetRef="Activity_Accept" />
    <bpmn:serviceTask id="Activity_Accept" name="依既有入口檢核並轉送">
      <bpmn:incoming>Flow_InvokeToAccept</bpmn:incoming>
      <bpmn:outgoing>Flow_AcceptToStarted</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:sequenceFlow id="Flow_AcceptToStarted" sourceRef="Activity_Accept" targetRef="Gateway_Started" />
    <bpmn:exclusiveGateway id="Gateway_Started" name="查得新 Run 已開始?" default="Flow_StartedToReconcile">
      <bpmn:incoming>Flow_AcceptToStarted</bpmn:incoming>
      <bpmn:outgoing>Flow_StartedToNew</bpmn:outgoing>
      <bpmn:outgoing>Flow_StartedToReconcile</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:sequenceFlow id="Flow_StartedToNew" name="已查得" sourceRef="Gateway_Started" targetRef="Event_New">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">runObserved</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="Flow_StartedToReconcile" name="尚未查得" sourceRef="Gateway_Started" targetRef="Activity_Reconcile" />
    <bpmn:userTask id="Activity_Reconcile" name="核對未啟動原因">
      <bpmn:incoming>Flow_StartedToReconcile</bpmn:incoming>
      <bpmn:outgoing>Flow_ReconcileToPending</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:sequenceFlow id="Flow_ReconcileToPending" sourceRef="Activity_Reconcile" targetRef="Event_Pending" />
    <bpmn:endEvent id="Event_Pending" name="待處理；不盲目重送">
      <bpmn:incoming>Flow_ReconcileToPending</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:endEvent id="Event_New" name="新 Run 執行；原結果保留">
      <bpmn:incoming>Flow_StartedToNew</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:endEvent id="Event_End" name="保留結果及處理決定">
      <bpmn:incoming>Flow_RerunToEnd</bpmn:incoming>
    </bpmn:endEvent>
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_Collaboration_ReviewRerun">
    <bpmndi:BPMNPlane id="BPMNPlane_Collaboration_ReviewRerun" bpmnElement="Collaboration_ReviewRerun">
      <bpmndi:BPMNShape id="BPMNShape_Participant_Platform" bpmnElement="Participant_Platform" isHorizontal="true">
        <dc:Bounds x="80" y="80" width="1722" height="646" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Lane_Owner" bpmnElement="Lane_Owner" isHorizontal="true">
        <dc:Bounds x="110" y="80" width="1692" height="236" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Lane_Dev" bpmnElement="Lane_Dev" isHorizontal="true">
        <dc:Bounds x="110" y="316" width="1692" height="140" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Lane_Crystal" bpmnElement="Lane_Crystal" isHorizontal="true">
        <dc:Bounds x="110" y="456" width="1692" height="270" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Event_Start" bpmnElement="Event_Start">
        <dc:Bounds x="170" y="132" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="154" y="174" width="68" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Activity_Read" bpmnElement="Activity_Read">
        <dc:Bounds x="266" y="110" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Gateway_Issue" bpmnElement="Gateway_Issue" isMarkerVisible="true">
        <dc:Bounds x="426" y="125" width="50" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="421" y="105" width="61" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Activity_Triage" bpmnElement="Activity_Triage">
        <dc:Bounds x="536" y="110" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Activity_Fix" bpmnElement="Activity_Fix">
        <dc:Bounds x="696" y="346" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Gateway_Rerun" bpmnElement="Gateway_Rerun" isMarkerVisible="true">
        <dc:Bounds x="856" y="125" width="50" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="854" y="91" width="54" height="28" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Activity_Safe" bpmnElement="Activity_Safe">
        <dc:Bounds x="966" y="110" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Activity_Invoke" bpmnElement="Activity_Invoke">
        <dc:Bounds x="1126" y="110" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Activity_Accept" bpmnElement="Activity_Accept">
        <dc:Bounds x="1286" y="486" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Gateway_Started" bpmnElement="Gateway_Started" isMarkerVisible="true">
        <dc:Bounds x="1446" y="501" width="50" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1441" y="467" width="61" height="28" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Activity_Reconcile" bpmnElement="Activity_Reconcile">
        <dc:Bounds x="1556" y="110" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Event_Pending" bpmnElement="Event_Pending">
        <dc:Bounds x="1716" y="132" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1697" y="174" width="75" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Event_New" bpmnElement="Event_New">
        <dc:Bounds x="1588" y="626" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1572" y="668" width="68" height="28" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Event_End" bpmnElement="Event_End">
        <dc:Bounds x="998" y="250" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="979" y="292" width="75" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="BPMNEdge_Flow_StartToRead" bpmnElement="Flow_StartToRead">
        <di:waypoint x="206" y="150" />
        <di:waypoint x="266" y="150" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_Flow_ReadToIssue" bpmnElement="Flow_ReadToIssue">
        <di:waypoint x="366" y="150" />
        <di:waypoint x="426" y="150" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_Flow_IssueToTriage" bpmnElement="Flow_IssueToTriage">
        <di:waypoint x="476" y="150" />
        <di:waypoint x="536" y="150" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="484" y="132" width="40" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_Flow_IssueToRerun" bpmnElement="Flow_IssueToRerun">
        <di:waypoint x="451" y="175" />
        <di:waypoint x="451" y="316" />
        <di:waypoint x="881" y="316" />
        <di:waypoint x="881" y="175" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="459" y="298" width="40" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_Flow_TriageToFix" bpmnElement="Flow_TriageToFix">
        <di:waypoint x="586" y="190" />
        <di:waypoint x="586" y="386" />
        <di:waypoint x="696" y="386" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_Flow_FixToRerun" bpmnElement="Flow_FixToRerun">
        <di:waypoint x="796" y="386" />
        <di:waypoint x="881" y="386" />
        <di:waypoint x="881" y="175" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_Flow_RerunToSafe" bpmnElement="Flow_RerunToSafe">
        <di:waypoint x="906" y="150" />
        <di:waypoint x="966" y="150" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="914" y="132" width="40" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_Flow_RerunToEnd" bpmnElement="Flow_RerunToEnd">
        <di:waypoint x="906" y="150" />
        <di:waypoint x="921" y="150" />
        <di:waypoint x="921" y="268" />
        <di:waypoint x="998" y="268" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="929" y="250" width="33" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_Flow_SafeToInvoke" bpmnElement="Flow_SafeToInvoke">
        <di:waypoint x="1066" y="150" />
        <di:waypoint x="1126" y="150" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_Flow_InvokeToAccept" bpmnElement="Flow_InvokeToAccept">
        <di:waypoint x="1176" y="190" />
        <di:waypoint x="1176" y="526" />
        <di:waypoint x="1286" y="526" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_Flow_AcceptToStarted" bpmnElement="Flow_AcceptToStarted">
        <di:waypoint x="1386" y="526" />
        <di:waypoint x="1446" y="526" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_Flow_StartedToNew" bpmnElement="Flow_StartedToNew">
        <di:waypoint x="1471" y="551" />
        <di:waypoint x="1471" y="644" />
        <di:waypoint x="1588" y="644" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1479" y="626" width="33" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_Flow_StartedToReconcile" bpmnElement="Flow_StartedToReconcile">
        <di:waypoint x="1496" y="526" />
        <di:waypoint x="1606" y="526" />
        <di:waypoint x="1606" y="190" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1504" y="508" width="40" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_Flow_ReconcileToPending" bpmnElement="Flow_ReconcileToPending">
        <di:waypoint x="1656" y="150" />
        <di:waypoint x="1716" y="150" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>
