<?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_leave_request" targetNamespace="http://bpmn.io/schema/bpmn">
  <bpmn:collaboration id="Collaboration_leave_request">
    <bpmn:participant id="Participant_leave_request" name="Leave Request" processRef="Process_leave_request" />
  </bpmn:collaboration>
  <bpmn:process id="Process_leave_request" name="Leave Request" isExecutable="true">
    <bpmn:laneSet id="LaneSet_leave_request">
      <bpmn:lane id="Lane_1" name="Employee"><bpmn:flowNodeRef>Start</bpmn:flowNodeRef><bpmn:flowNodeRef>Submit</bpmn:flowNodeRef><bpmn:flowNodeRef>Adjust</bpmn:flowNodeRef><bpmn:flowNodeRef>EndRejected</bpmn:flowNodeRef></bpmn:lane>
      <bpmn:lane id="Lane_2" name="Manager"><bpmn:flowNodeRef>Decide</bpmn:flowNodeRef><bpmn:flowNodeRef>Approved</bpmn:flowNodeRef></bpmn:lane>
      <bpmn:lane id="Lane_3" name="HR"><bpmn:flowNodeRef>Record</bpmn:flowNodeRef><bpmn:flowNodeRef>Confirm</bpmn:flowNodeRef><bpmn:flowNodeRef>End</bpmn:flowNodeRef></bpmn:lane>
    </bpmn:laneSet>
    <bpmn:startEvent id="Start" name="Leave needed"><bpmn:outgoing>Flow_1</bpmn:outgoing></bpmn:startEvent>
    <bpmn:userTask id="Submit" name="Submit the leave request"><bpmn:incoming>Flow_1</bpmn:incoming><bpmn:outgoing>Flow_2</bpmn:outgoing></bpmn:userTask>
    <bpmn:userTask id="Decide" name="Decide on the leave 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="Adjust" name="Adjust or withdraw the request"><bpmn:incoming>Flow_4</bpmn:incoming><bpmn:outgoing>Flow_6</bpmn:outgoing></bpmn:userTask>
    <bpmn:endEvent id="EndRejected" name="Leave rejected"><bpmn:incoming>Flow_6</bpmn:incoming></bpmn:endEvent>
    <bpmn:userTask id="Record" name="Record the leave"><bpmn:incoming>Flow_5</bpmn:incoming><bpmn:outgoing>Flow_7</bpmn:outgoing></bpmn:userTask>
    <bpmn:userTask id="Confirm" name="Confirm the leave to the employee"><bpmn:incoming>Flow_7</bpmn:incoming><bpmn:outgoing>Flow_8</bpmn:outgoing></bpmn:userTask>
    <bpmn:endEvent id="End" name="Leave approved"><bpmn:incoming>Flow_8</bpmn:incoming></bpmn:endEvent>
    <bpmn:sequenceFlow id="Flow_1" sourceRef="Start" targetRef="Submit" />
    <bpmn:sequenceFlow id="Flow_2" sourceRef="Submit" targetRef="Decide" />
    <bpmn:sequenceFlow id="Flow_3" sourceRef="Decide" targetRef="Approved" />
    <bpmn:sequenceFlow id="Flow_4" name="No" sourceRef="Approved" targetRef="Adjust"><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="Record" />
    <bpmn:sequenceFlow id="Flow_6" sourceRef="Adjust" targetRef="EndRejected" />
    <bpmn:sequenceFlow id="Flow_7" sourceRef="Record" targetRef="Confirm" />
    <bpmn:sequenceFlow id="Flow_8" sourceRef="Confirm" targetRef="End" />
  </bpmn:process>
  <bpmndi:BPMNDiagram id="Diagram_leave_request">
    <bpmndi:BPMNPlane id="Plane_leave_request" bpmnElement="Collaboration_leave_request">
      <bpmndi:BPMNShape id="Participant_leave_request_di" bpmnElement="Participant_leave_request" isHorizontal="true"><dc:Bounds x="160" y="80" width="1540" height="420" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_1_di" bpmnElement="Lane_1" isHorizontal="true"><dc:Bounds x="190" y="80" width="1510" height="140" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_2_di" bpmnElement="Lane_2" isHorizontal="true"><dc:Bounds x="190" y="220" width="1510" height="140" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_3_di" bpmnElement="Lane_3" isHorizontal="true"><dc:Bounds x="190" y="360" width="1510" 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="Submit_di" bpmnElement="Submit" 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="Decide_di" bpmnElement="Decide" 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="Adjust_di" bpmnElement="Adjust" 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="Record_di" bpmnElement="Record" bioc:stroke="#fb8c00" bioc:fill="#ffe0b2" color:background-color="#ffe0b2" color:border-color="#fb8c00"><dc:Bounds x="1025" y="390" width="150" height="80" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Confirm_di" bpmnElement="Confirm" 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="End_di" bpmnElement="End"><dc:Bounds x="1482" y="412" width="36" height="36" /><bpmndi:BPMNLabel><dc:Bounds x="1450" y="454" 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="900" y="315" /><di:waypoint x="900" y="430" /><di:waypoint x="1025" y="430" /><bpmndi:BPMNLabel><dc:Bounds x="912" y="410" 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="1175" y="430" /><di:waypoint x="1225" y="430" /></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_8_di" bpmnElement="Flow_8"><di:waypoint x="1375" y="430" /><di:waypoint x="1482" y="430" /></bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>
