<?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:dc="http://www.omg.org/spec/DD/20100524/DC"
  xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Defs_tobe" targetNamespace="https://github.com/dzahyk/karsa">
 <bpmn:collaboration id="Collab_tobe">
  <bpmn:participant id="Participant_tobe" name="TO-BE: Karsa deal desk" processRef="Process_tobe" />
 </bpmn:collaboration>
 <bpmn:process id="Process_tobe" isExecutable="false">
  <bpmn:laneSet id="LaneSet_tobe">
   <bpmn:lane id="Lane_A" name="Analyst"><bpmn:flowNodeRef>S</bpmn:flowNodeRef><bpmn:flowNodeRef>A1</bpmn:flowNodeRef><bpmn:flowNodeRef>A2</bpmn:flowNodeRef><bpmn:flowNodeRef>G1</bpmn:flowNodeRef><bpmn:flowNodeRef>A3</bpmn:flowNodeRef></bpmn:lane>
   <bpmn:lane id="Lane_S" name="Karsa (system)"><bpmn:flowNodeRef>Y1</bpmn:flowNodeRef><bpmn:flowNodeRef>Y2</bpmn:flowNodeRef><bpmn:flowNodeRef>Y3</bpmn:flowNodeRef><bpmn:flowNodeRef>Y4</bpmn:flowNodeRef><bpmn:flowNodeRef>G3</bpmn:flowNodeRef><bpmn:flowNodeRef>E1</bpmn:flowNodeRef></bpmn:lane>
   <bpmn:lane id="Lane_P" name="Approver"><bpmn:flowNodeRef>G2</bpmn:flowNodeRef><bpmn:flowNodeRef>P1</bpmn:flowNodeRef><bpmn:flowNodeRef>P2</bpmn:flowNodeRef><bpmn:flowNodeRef>P3</bpmn:flowNodeRef></bpmn:lane>
   <bpmn:lane id="Lane_X" name="Automation Eng."><bpmn:flowNodeRef>X1</bpmn:flowNodeRef></bpmn:lane>
  </bpmn:laneSet>
  <bpmn:startEvent id="S" name="Brief received"><bpmn:outgoing>Flow_0</bpmn:outgoing></bpmn:startEvent>
  <bpmn:task id="A1" name="Create case (paste / upload)"><bpmn:incoming>Flow_0</bpmn:incoming><bpmn:outgoing>Flow_1</bpmn:outgoing></bpmn:task>
  <bpmn:task id="Y1" name="Extract drafts with evidence"><bpmn:incoming>Flow_1</bpmn:incoming><bpmn:outgoing>Flow_2</bpmn:outgoing></bpmn:task>
  <bpmn:task id="A2" name="Review and confirm requirements"><bpmn:incoming>Flow_2</bpmn:incoming><bpmn:incoming>Flow_5</bpmn:incoming><bpmn:outgoing>Flow_3</bpmn:outgoing></bpmn:task>
  <bpmn:exclusiveGateway id="G1" name="All critical confirmed?"><bpmn:incoming>Flow_3</bpmn:incoming><bpmn:outgoing>Flow_4</bpmn:outgoing><bpmn:outgoing>Flow_6</bpmn:outgoing></bpmn:exclusiveGateway>
  <bpmn:task id="A3" name="Clarify with client (channel + ref)"><bpmn:incoming>Flow_4</bpmn:incoming><bpmn:outgoing>Flow_5</bpmn:outgoing></bpmn:task>
  <bpmn:task id="Y2" name="Price deterministically"><bpmn:incoming>Flow_6</bpmn:incoming><bpmn:outgoing>Flow_7</bpmn:outgoing></bpmn:task>
  <bpmn:task id="Y3" name="Freeze package (SHA-256)"><bpmn:incoming>Flow_7</bpmn:incoming><bpmn:outgoing>Flow_8</bpmn:outgoing></bpmn:task>
  <bpmn:exclusiveGateway id="G2" name="High risk?"><bpmn:incoming>Flow_8</bpmn:incoming><bpmn:outgoing>Flow_9</bpmn:outgoing><bpmn:outgoing>Flow_10</bpmn:outgoing></bpmn:exclusiveGateway>
  <bpmn:task id="P1" name="Approve (single)"><bpmn:incoming>Flow_9</bpmn:incoming><bpmn:outgoing>Flow_11</bpmn:outgoing></bpmn:task>
  <bpmn:task id="P2" name="Exception + two approvers"><bpmn:incoming>Flow_10</bpmn:incoming><bpmn:outgoing>Flow_12</bpmn:outgoing></bpmn:task>
  <bpmn:task id="P3" name="Authorize execution"><bpmn:incoming>Flow_11</bpmn:incoming><bpmn:incoming>Flow_12</bpmn:incoming><bpmn:outgoing>Flow_13</bpmn:outgoing></bpmn:task>
  <bpmn:task id="Y4" name="Write CRM + tracker (idempotent)"><bpmn:incoming>Flow_13</bpmn:incoming><bpmn:outgoing>Flow_14</bpmn:outgoing></bpmn:task>
  <bpmn:exclusiveGateway id="G3" name="Read-back = hash?"><bpmn:incoming>Flow_14</bpmn:incoming><bpmn:outgoing>Flow_15</bpmn:outgoing><bpmn:outgoing>Flow_16</bpmn:outgoing></bpmn:exclusiveGateway>
  <bpmn:endEvent id="E1" name="Completed (verified)"><bpmn:incoming>Flow_15</bpmn:incoming></bpmn:endEvent>
  <bpmn:task id="X1" name="Reconcile / exception queue"><bpmn:incoming>Flow_16</bpmn:incoming></bpmn:task>
  <bpmn:sequenceFlow id="Flow_0" sourceRef="S" targetRef="A1" />
  <bpmn:sequenceFlow id="Flow_1" sourceRef="A1" targetRef="Y1" />
  <bpmn:sequenceFlow id="Flow_2" sourceRef="Y1" targetRef="A2" />
  <bpmn:sequenceFlow id="Flow_3" sourceRef="A2" targetRef="G1" />
  <bpmn:sequenceFlow id="Flow_4" name="no" sourceRef="G1" targetRef="A3" />
  <bpmn:sequenceFlow id="Flow_5" sourceRef="A3" targetRef="A2" />
  <bpmn:sequenceFlow id="Flow_6" name="yes" sourceRef="G1" targetRef="Y2" />
  <bpmn:sequenceFlow id="Flow_7" sourceRef="Y2" targetRef="Y3" />
  <bpmn:sequenceFlow id="Flow_8" sourceRef="Y3" targetRef="G2" />
  <bpmn:sequenceFlow id="Flow_9" name="no" sourceRef="G2" targetRef="P1" />
  <bpmn:sequenceFlow id="Flow_10" name="yes" sourceRef="G2" targetRef="P2" />
  <bpmn:sequenceFlow id="Flow_11" sourceRef="P1" targetRef="P3" />
  <bpmn:sequenceFlow id="Flow_12" sourceRef="P2" targetRef="P3" />
  <bpmn:sequenceFlow id="Flow_13" sourceRef="P3" targetRef="Y4" />
  <bpmn:sequenceFlow id="Flow_14" sourceRef="Y4" targetRef="G3" />
  <bpmn:sequenceFlow id="Flow_15" name="yes" sourceRef="G3" targetRef="E1" />
  <bpmn:sequenceFlow id="Flow_16" name="no" sourceRef="G3" targetRef="X1" />
  <bpmn:textAnnotation id="Note_0"><bpmn:text>BR-009: quote + offsets</bpmn:text></bpmn:textAnnotation>
  <bpmn:association id="Assoc_0" sourceRef="Y1" targetRef="Note_0" />
  <bpmn:textAnnotation id="Note_1"><bpmn:text>BR-001 gate</bpmn:text></bpmn:textAnnotation>
  <bpmn:association id="Assoc_1" sourceRef="Y3" targetRef="Note_1" />
  <bpmn:textAnnotation id="Note_2"><bpmn:text>BR-003: binds hash</bpmn:text></bpmn:textAnnotation>
  <bpmn:association id="Assoc_2" sourceRef="P3" targetRef="Note_2" />
  <bpmn:textAnnotation id="Note_3"><bpmn:text>BR-007, AC-06</bpmn:text></bpmn:textAnnotation>
  <bpmn:association id="Assoc_3" sourceRef="Y4" targetRef="Note_3" />
 </bpmn:process>
 <bpmndi:BPMNDiagram id="Diagram_tobe">
  <bpmndi:BPMNPlane id="Plane_tobe" bpmnElement="Collab_tobe">
   <bpmndi:BPMNShape id="Participant_tobe_di" bpmnElement="Participant_tobe" isHorizontal="true"><dc:Bounds x="30" y="30" width="2020" height="600" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Lane_A_di" bpmnElement="Lane_A" isHorizontal="true"><dc:Bounds x="60" y="30" width="1990" height="150" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Lane_S_di" bpmnElement="Lane_S" isHorizontal="true"><dc:Bounds x="60" y="180" width="1990" height="150" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Lane_P_di" bpmnElement="Lane_P" isHorizontal="true"><dc:Bounds x="60" y="330" width="1990" height="150" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Lane_X_di" bpmnElement="Lane_X" isHorizontal="true"><dc:Bounds x="60" y="480" width="1990" height="150" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="S_di" bpmnElement="S"><dc:Bounds x="127" y="87" width="36" height="36" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="A1_di" bpmnElement="A1"><dc:Bounds x="235" y="73" width="120" height="64" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Y1_di" bpmnElement="Y1"><dc:Bounds x="385" y="223" width="120" height="64" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="A2_di" bpmnElement="A2"><dc:Bounds x="535" y="73" width="120" height="64" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="G1_di" bpmnElement="G1" isMarkerVisible="true"><dc:Bounds x="720" y="80" width="50" height="50" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="A3_di" bpmnElement="A3"><dc:Bounds x="835" y="73" width="120" height="64" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Y2_di" bpmnElement="Y2"><dc:Bounds x="835" y="223" width="120" height="64" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Y3_di" bpmnElement="Y3"><dc:Bounds x="985" y="223" width="120" height="64" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="G2_di" bpmnElement="G2" isMarkerVisible="true"><dc:Bounds x="1170" y="380" width="50" height="50" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="P1_di" bpmnElement="P1"><dc:Bounds x="1285" y="335" width="120" height="64" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="P2_di" bpmnElement="P2"><dc:Bounds x="1285" y="411" width="120" height="64" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="P3_di" bpmnElement="P3"><dc:Bounds x="1435" y="373" width="120" height="64" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Y4_di" bpmnElement="Y4"><dc:Bounds x="1585" y="223" width="120" height="64" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="G3_di" bpmnElement="G3" isMarkerVisible="true"><dc:Bounds x="1770" y="230" width="50" height="50" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="E1_di" bpmnElement="E1"><dc:Bounds x="1927" y="237" width="36" height="36" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="X1_di" bpmnElement="X1"><dc:Bounds x="1885" y="523" width="120" height="64" /></bpmndi:BPMNShape>
   <bpmndi:BPMNEdge id="Flow_0_di" bpmnElement="Flow_0"><di:waypoint x="163" y="105" /><di:waypoint x="235" y="105" /></bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_1_di" bpmnElement="Flow_1"><di:waypoint x="295" y="137" /><di:waypoint x="295" y="255" /><di:waypoint x="385" y="255" /></bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_2_di" bpmnElement="Flow_2"><di:waypoint x="445" y="223" /><di:waypoint x="445" y="105" /><di:waypoint x="535" y="105" /></bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_3_di" bpmnElement="Flow_3"><di:waypoint x="655" y="105" /><di:waypoint x="720" y="105" /></bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_4_di" bpmnElement="Flow_4"><di:waypoint x="770" y="105" /><di:waypoint x="835" y="105" /></bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_5_di" bpmnElement="Flow_5"><di:waypoint x="895" y="73" /><di:waypoint x="895" y="51" /><di:waypoint x="595" y="51" /><di:waypoint x="595" y="73" /></bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_6_di" bpmnElement="Flow_6"><di:waypoint x="745" y="130" /><di:waypoint x="745" y="255" /><di:waypoint x="835" y="255" /></bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_7_di" bpmnElement="Flow_7"><di:waypoint x="955" y="255" /><di:waypoint x="985" y="255" /></bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_8_di" bpmnElement="Flow_8"><di:waypoint x="1045" y="287" /><di:waypoint x="1045" y="405" /><di:waypoint x="1170" y="405" /></bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_9_di" bpmnElement="Flow_9"><di:waypoint x="1195" y="380" /><di:waypoint x="1195" y="367" /><di:waypoint x="1285" y="367" /></bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_10_di" bpmnElement="Flow_10"><di:waypoint x="1195" y="430" /><di:waypoint x="1195" y="443" /><di:waypoint x="1285" y="443" /></bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_11_di" bpmnElement="Flow_11"><di:waypoint x="1405" y="367" /><di:waypoint x="1420" y="367" /><di:waypoint x="1420" y="405" /><di:waypoint x="1435" y="405" /></bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_12_di" bpmnElement="Flow_12"><di:waypoint x="1405" y="443" /><di:waypoint x="1420" y="443" /><di:waypoint x="1420" y="405" /><di:waypoint x="1435" y="405" /></bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_13_di" bpmnElement="Flow_13"><di:waypoint x="1495" y="373" /><di:waypoint x="1495" y="255" /><di:waypoint x="1585" y="255" /></bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_14_di" bpmnElement="Flow_14"><di:waypoint x="1705" y="255" /><di:waypoint x="1770" y="255" /></bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_15_di" bpmnElement="Flow_15"><di:waypoint x="1820" y="255" /><di:waypoint x="1927" y="255" /></bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_16_di" bpmnElement="Flow_16"><di:waypoint x="1795" y="280" /><di:waypoint x="1795" y="555" /><di:waypoint x="1885" y="555" /></bpmndi:BPMNEdge>
   <bpmndi:BPMNShape id="Note_0_di" bpmnElement="Note_0"><dc:Bounds x="385" y="301" width="140" height="40" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Note_1_di" bpmnElement="Note_1"><dc:Bounds x="985" y="301" width="140" height="40" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Note_2_di" bpmnElement="Note_2"><dc:Bounds x="1435" y="451" width="140" height="40" /></bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Note_3_di" bpmnElement="Note_3"><dc:Bounds x="1585" y="301" width="140" height="40" /></bpmndi:BPMNShape>
  </bpmndi:BPMNPlane>
 </bpmndi:BPMNDiagram>
</bpmn:definitions>
