<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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" xmlns:bioc="http://bpmn.io/schema/bpmn/biocolor/1.0" xmlns:color="http://www.omg.org/spec/BPMN/non-normative/color/1.0" id="Definitions_purchase_request" targetNamespace="http://bpmn.io/schema/bpmn">
  <bpmn:collaboration id="Collaboration_purchase_request">
    <bpmn:participant id="Participant_purchase_request" name="Purchase Request" processRef="Process_purchase_request" />
  </bpmn:collaboration>
  <bpmn:process id="Process_purchase_request" name="Purchase Request" isExecutable="true">
    <bpmn:laneSet id="LaneSet_purchase_request">
      <bpmn:lane id="Lane_1" name="Requester"><bpmn:flowNodeRef>Start</bpmn:flowNodeRef><bpmn:flowNodeRef>Describe</bpmn:flowNodeRef><bpmn:flowNodeRef>Review</bpmn:flowNodeRef><bpmn:flowNodeRef>EndRejected</bpmn:flowNodeRef><bpmn:flowNodeRef>Receive</bpmn:flowNodeRef><bpmn:flowNodeRef>End</bpmn:flowNodeRef></bpmn:lane>
      <bpmn:lane id="Lane_2" name="Budget Owner"><bpmn:flowNodeRef>Approve</bpmn:flowNodeRef><bpmn:flowNodeRef>Approved</bpmn:flowNodeRef><bpmn:flowNodeRef>Value</bpmn:flowNodeRef></bpmn:lane>
      <bpmn:lane id="Lane_3" name="Finance"><bpmn:flowNodeRef>Finance</bpmn:flowNodeRef></bpmn:lane>
      <bpmn:lane id="Lane_4" name="Purchasing"><bpmn:flowNodeRef>Join</bpmn:flowNodeRef><bpmn:flowNodeRef>Order</bpmn:flowNodeRef></bpmn:lane>
    </bpmn:laneSet>
    <bpmn:startEvent id="Start" name="Purchase needed"><bpmn:outgoing>Flow_1</bpmn:outgoing></bpmn:startEvent>
    <bpmn:userTask id="Describe" name="Describe the purchase"><bpmn:incoming>Flow_1</bpmn:incoming><bpmn:outgoing>Flow_2</bpmn:outgoing></bpmn:userTask>
    <bpmn:userTask id="Approve" name="Approve the request"><bpmn:incoming>Flow_2</bpmn:incoming><bpmn:outgoing>Flow_3</bpmn:outgoing></bpmn:userTask>
    <bpmn:exclusiveGateway id="Approved" name="Approved?" default="Flow_5"><bpmn:incoming>Flow_3</bpmn:incoming><bpmn:outgoing>Flow_4</bpmn:outgoing><bpmn:outgoing>Flow_5</bpmn:outgoing></bpmn:exclusiveGateway>
    <bpmn:userTask id="Review" name="Read the reason for the rejection"><bpmn:incoming>Flow_4</bpmn:incoming><bpmn:outgoing>Flow_6</bpmn:outgoing></bpmn:userTask>
    <bpmn:endEvent id="EndRejected" name="Request rejected"><bpmn:incoming>Flow_6</bpmn:incoming></bpmn:endEvent>
    <bpmn:exclusiveGateway id="Value" name="High value?" default="Flow_8"><bpmn:incoming>Flow_5</bpmn:incoming><bpmn:outgoing>Flow_7</bpmn:outgoing><bpmn:outgoing>Flow_8</bpmn:outgoing></bpmn:exclusiveGateway>
    <bpmn:userTask id="Finance" name="Approve the high-value request"><bpmn:incoming>Flow_7</bpmn:incoming><bpmn:outgoing>Flow_9</bpmn:outgoing></bpmn:userTask>
    <bpmn:exclusiveGateway id="Join"><bpmn:incoming>Flow_8</bpmn:incoming><bpmn:incoming>Flow_9</bpmn:incoming><bpmn:outgoing>Flow_10</bpmn:outgoing></bpmn:exclusiveGateway>
    <bpmn:userTask id="Order" name="Place the order"><bpmn:incoming>Flow_10</bpmn:incoming><bpmn:outgoing>Flow_11</bpmn:outgoing></bpmn:userTask>
    <bpmn:userTask id="Receive" name="Confirm the delivery"><bpmn:incoming>Flow_11</bpmn:incoming><bpmn:outgoing>Flow_12</bpmn:outgoing></bpmn:userTask>
    <bpmn:endEvent id="End" name="Purchase completed"><bpmn:incoming>Flow_12</bpmn:incoming></bpmn:endEvent>
    <bpmn:sequenceFlow id="Flow_1" sourceRef="Start" targetRef="Describe" />
    <bpmn:sequenceFlow id="Flow_2" sourceRef="Describe" targetRef="Approve" />
    <bpmn:sequenceFlow id="Flow_3" sourceRef="Approve" targetRef="Approved" />
    <bpmn:sequenceFlow id="Flow_4" name="No" sourceRef="Approved" targetRef="Review"><bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${cur.fields.status.name == 'Rejected'}</bpmn:conditionExpression></bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="Flow_5" name="Yes" sourceRef="Approved" targetRef="Value" />
    <bpmn:sequenceFlow id="Flow_6" sourceRef="Review" targetRef="EndRejected" />
    <bpmn:sequenceFlow id="Flow_7" name="Yes" sourceRef="Value" targetRef="Finance"><bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${pi.fields.labels.includes('high-value')}</bpmn:conditionExpression></bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="Flow_8" name="No" sourceRef="Value" targetRef="Join" />
    <bpmn:sequenceFlow id="Flow_9" sourceRef="Finance" targetRef="Join" />
    <bpmn:sequenceFlow id="Flow_10" sourceRef="Join" targetRef="Order" />
    <bpmn:sequenceFlow id="Flow_11" sourceRef="Order" targetRef="Receive" />
    <bpmn:sequenceFlow id="Flow_12" sourceRef="Receive" targetRef="End" />
  </bpmn:process>
  <bpmndi:BPMNDiagram id="Diagram_purchase_request">
    <bpmndi:BPMNPlane id="Plane_purchase_request" bpmnElement="Collaboration_purchase_request">
      <bpmndi:BPMNShape id="Participant_purchase_request_di" bpmnElement="Participant_purchase_request" isHorizontal="true"><dc:Bounds x="160" y="80" width="2140" height="560" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_1_di" bpmnElement="Lane_1" isHorizontal="true"><dc:Bounds x="190" y="80" width="2110" height="140" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_2_di" bpmnElement="Lane_2" isHorizontal="true"><dc:Bounds x="190" y="220" width="2110" height="140" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_3_di" bpmnElement="Lane_3" isHorizontal="true"><dc:Bounds x="190" y="360" width="2110" height="140" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_4_di" bpmnElement="Lane_4" isHorizontal="true"><dc:Bounds x="190" y="500" width="2110" height="140" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Start_di" bpmnElement="Start"><dc:Bounds x="282" y="132" width="36" height="36" /><bpmndi:BPMNLabel><dc:Bounds x="250" y="174" width="100" height="27" /></bpmndi:BPMNLabel></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Describe_di" bpmnElement="Describe" bioc:stroke="#1e88e5" bioc:fill="#bbdefb" color:background-color="#bbdefb" color:border-color="#1e88e5"><dc:Bounds x="425" y="110" width="150" height="80" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Approve_di" bpmnElement="Approve" bioc:stroke="#43a047" bioc:fill="#c8e6c9" color:background-color="#c8e6c9" color:border-color="#43a047"><dc:Bounds x="625" y="250" width="150" height="80" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Approved_di" bpmnElement="Approved" isMarkerVisible="true"><dc:Bounds x="875" y="265" width="50" height="50" /><bpmndi:BPMNLabel><dc:Bounds x="797" y="233" width="90" height="27" /></bpmndi:BPMNLabel></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Review_di" bpmnElement="Review" bioc:stroke="#1e88e5" bioc:fill="#bbdefb" color:background-color="#bbdefb" color:border-color="#1e88e5"><dc:Bounds x="1025" y="110" width="150" height="80" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="EndRejected_di" bpmnElement="EndRejected"><dc:Bounds x="1282" y="132" width="36" height="36" /><bpmndi:BPMNLabel><dc:Bounds x="1250" y="174" width="100" height="27" /></bpmndi:BPMNLabel></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Value_di" bpmnElement="Value" isMarkerVisible="true"><dc:Bounds x="1075" y="265" width="50" height="50" /><bpmndi:BPMNLabel><dc:Bounds x="997" y="233" width="90" height="27" /></bpmndi:BPMNLabel></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Finance_di" bpmnElement="Finance" bioc:stroke="#fb8c00" bioc:fill="#ffe0b2" color:background-color="#ffe0b2" color:border-color="#fb8c00"><dc:Bounds x="1225" y="390" width="150" height="80" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Join_di" bpmnElement="Join" isMarkerVisible="true"><dc:Bounds x="1475" y="545" width="50" height="50" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Order_di" bpmnElement="Order" bioc:stroke="#8e24aa" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#8e24aa"><dc:Bounds x="1625" y="530" width="150" height="80" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Receive_di" bpmnElement="Receive" bioc:stroke="#1e88e5" bioc:fill="#bbdefb" color:background-color="#bbdefb" color:border-color="#1e88e5"><dc:Bounds x="1825" y="110" width="150" height="80" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="End_di" bpmnElement="End"><dc:Bounds x="2082" y="132" width="36" height="36" /><bpmndi:BPMNLabel><dc:Bounds x="2050" y="174" width="100" height="27" /></bpmndi:BPMNLabel></bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_1_di" bpmnElement="Flow_1"><di:waypoint x="318" y="150" /><di:waypoint x="425" y="150" /></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_2_di" bpmnElement="Flow_2"><di:waypoint x="575" y="150" /><di:waypoint x="600" y="150" /><di:waypoint x="600" y="290" /><di:waypoint x="625" y="290" /></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_3_di" bpmnElement="Flow_3"><di:waypoint x="775" y="290" /><di:waypoint x="875" y="290" /></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_4_di" bpmnElement="Flow_4"><di:waypoint x="900" y="265" /><di:waypoint x="900" y="150" /><di:waypoint x="1025" y="150" /><bpmndi:BPMNLabel><dc:Bounds x="912" y="130" width="30" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_5_di" bpmnElement="Flow_5"><di:waypoint x="925" y="290" /><di:waypoint x="1075" y="290" /><bpmndi:BPMNLabel><dc:Bounds x="933" y="270" width="30" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_6_di" bpmnElement="Flow_6"><di:waypoint x="1175" y="150" /><di:waypoint x="1282" y="150" /></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_7_di" bpmnElement="Flow_7"><di:waypoint x="1100" y="315" /><di:waypoint x="1100" y="430" /><di:waypoint x="1225" y="430" /><bpmndi:BPMNLabel><dc:Bounds x="1112" y="410" width="30" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_8_di" bpmnElement="Flow_8"><di:waypoint x="1125" y="290" /><di:waypoint x="1500" y="290" /><di:waypoint x="1500" y="545" /><bpmndi:BPMNLabel><dc:Bounds x="1133" y="270" width="30" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_9_di" bpmnElement="Flow_9"><di:waypoint x="1375" y="430" /><di:waypoint x="1500" y="430" /><di:waypoint x="1500" y="545" /></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_10_di" bpmnElement="Flow_10"><di:waypoint x="1525" y="570" /><di:waypoint x="1625" y="570" /></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_11_di" bpmnElement="Flow_11"><di:waypoint x="1775" y="570" /><di:waypoint x="1800" y="570" /><di:waypoint x="1800" y="150" /><di:waypoint x="1825" y="150" /></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_12_di" bpmnElement="Flow_12"><di:waypoint x="1975" y="150" /><di:waypoint x="2082" y="150" /></bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>
