Leave Application.bpmn 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL"
  3. xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
  4. xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn"
  5. id="sample-diagram" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.21.0"
  6. xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
  7. <bpmn2:collaboration id="Collaboration_04y2yh2">
  8. <bpmn2:participant id="Participant_0r7glje" processRef="Process_1" />
  9. </bpmn2:collaboration>
  10. <bpmn2:process id="Process_1" isExecutable="false">
  11. <bpmn2:extensionElements>
  12. <camunda:executionListener event="start">
  13. <!-- <camunda:script scriptFormat="JavaScript">console.log('=========== Process Start ===============');</camunda:script>-->
  14. </camunda:executionListener>
  15. </bpmn2:extensionElements>
  16. <bpmn2:laneSet id="LaneSet_0yxecu8">
  17. <bpmn2:lane id="Lane_0jmm0qb" name="Employee">
  18. <bpmn2:flowNodeRef>StartEvent_1</bpmn2:flowNodeRef>
  19. <bpmn2:flowNodeRef>Request</bpmn2:flowNodeRef>
  20. </bpmn2:lane>
  21. <bpmn2:lane id="Lane_0a5bph6" name="Manager">
  22. <bpmn2:flowNodeRef>Event_02om8ew</bpmn2:flowNodeRef>
  23. <bpmn2:flowNodeRef>Gateway_1kqewfd</bpmn2:flowNodeRef>
  24. <bpmn2:flowNodeRef>Approve</bpmn2:flowNodeRef>
  25. <bpmn2:flowNodeRef>timer-event</bpmn2:flowNodeRef>
  26. </bpmn2:lane>
  27. <bpmn2:lane id="Lane_05wy8pe" name="HR">
  28. <bpmn2:flowNodeRef>Event_1qg3mz1</bpmn2:flowNodeRef>
  29. <bpmn2:flowNodeRef>Activity_1rx1txe</bpmn2:flowNodeRef>
  30. <bpmn2:flowNodeRef>Activity_1escddn</bpmn2:flowNodeRef>
  31. </bpmn2:lane>
  32. </bpmn2:laneSet>
  33. <bpmn2:sequenceFlow id="Flow_1ig8mx7" sourceRef="Request" targetRef="Approve" />
  34. <bpmn2:sequenceFlow id="Flow_0xa1hl7" sourceRef="StartEvent_1" targetRef="Request" />
  35. <bpmn2:startEvent id="StartEvent_1" camunda:initiator="requester">
  36. <bpmn2:extensionElements>
  37. <camunda:executionListener event="start">
  38. <camunda:script scriptFormat="JavaScript">/*console.log('appDel',appDelegate);
  39. console.log('services',appServices); */
  40. console.log('inst ', item.token.execution.getItems().length);</camunda:script>
  41. </camunda:executionListener>
  42. </bpmn2:extensionElements>
  43. <bpmn2:outgoing>Flow_0xa1hl7</bpmn2:outgoing>
  44. </bpmn2:startEvent>
  45. <bpmn2:sequenceFlow id="Flow_1my72g7" sourceRef="Approve" targetRef="Gateway_1kqewfd" />
  46. <bpmn2:sequenceFlow id="Flow_1un6mui" sourceRef="Activity_1rx1txe" targetRef="Event_1qg3mz1" />
  47. <bpmn2:userTask id="Request" name="Request" camunda:assignee="$(this.data.requester)">
  48. <bpmn2:extensionElements>
  49. <camunda:formData>
  50. <camunda:formField id="RequestReason" label="Reason" type="string" />
  51. <camunda:formField id="LeaveType" label="Leave Type" type="enum">
  52. <camunda:value id="Sick" name="Sick Leave" />
  53. <camunda:value id="Vacation" name="Vacation" />
  54. <camunda:value id="Study" name="Study" />
  55. <camunda:value id="Maternity" name="Maternity" />
  56. </camunda:formField>
  57. <camunda:formField id="StartDate" label="Start Date" type="date" />
  58. <camunda:formField id="EndDate" label="End Date" type="date" />
  59. </camunda:formData>
  60. <camunda:taskListener event="assignment">
  61. <camunda:script scriptFormat="JavaScript">console.log('assignment');</camunda:script>
  62. </camunda:taskListener>
  63. </bpmn2:extensionElements>
  64. <bpmn2:incoming>Flow_0xa1hl7</bpmn2:incoming>
  65. <bpmn2:incoming>Flow_0rvg1ym</bpmn2:incoming>
  66. <bpmn2:outgoing>Flow_1ig8mx7</bpmn2:outgoing>
  67. </bpmn2:userTask>
  68. <bpmn2:sequenceFlow id="Flow_1ufmnuh" name="Approved" sourceRef="Gateway_1kqewfd" targetRef="Activity_1rx1txe" />
  69. <bpmn2:sequenceFlow id="Flow_1ef1q1u" name="Rejected" sourceRef="Gateway_1kqewfd" targetRef="Event_02om8ew">
  70. <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="JavaScript">data.approval=='Reject'</bpmn2:conditionExpression>
  71. </bpmn2:sequenceFlow>
  72. <bpmn2:sequenceFlow id="Flow_0rvg1ym" name="Require Information" sourceRef="Gateway_1kqewfd" targetRef="Request">
  73. <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="JavaScript">data.approval=='InformationRequired'</bpmn2:conditionExpression>
  74. </bpmn2:sequenceFlow>
  75. <bpmn2:endEvent id="Event_02om8ew">
  76. <bpmn2:incoming>Flow_1ef1q1u</bpmn2:incoming>
  77. <bpmn2:terminateEventDefinition id="TerminateEventDefinition_0wbo0a4" />
  78. </bpmn2:endEvent>
  79. <bpmn2:endEvent id="Event_1qg3mz1">
  80. <bpmn2:incoming>Flow_1un6mui</bpmn2:incoming>
  81. </bpmn2:endEvent>
  82. <bpmn2:exclusiveGateway id="Gateway_1kqewfd" default="Flow_1ufmnuh">
  83. <bpmn2:incoming>Flow_1my72g7</bpmn2:incoming>
  84. <bpmn2:outgoing>Flow_1ufmnuh</bpmn2:outgoing>
  85. <bpmn2:outgoing>Flow_1ef1q1u</bpmn2:outgoing>
  86. <bpmn2:outgoing>Flow_0rvg1ym</bpmn2:outgoing>
  87. </bpmn2:exclusiveGateway>
  88. <bpmn2:sequenceFlow id="Flow_00etx8n" sourceRef="timer-event" targetRef="Activity_1escddn" />
  89. <bpmn2:serviceTask id="Activity_1rx1txe" name="Process">
  90. <bpmn2:incoming>Flow_1ufmnuh</bpmn2:incoming>
  91. <bpmn2:outgoing>Flow_1un6mui</bpmn2:outgoing>
  92. </bpmn2:serviceTask>
  93. <bpmn2:userTask id="Approve" name="Approve">
  94. <bpmn2:extensionElements>
  95. <camunda:executionListener event="start">
  96. <camunda:script scriptFormat="JavaScript">this.assignee='Supervisor';</camunda:script>
  97. </camunda:executionListener>
  98. <camunda:formData>
  99. <camunda:formField id="approval" label="Approval Outcome" type="enum">
  100. <camunda:value id="A" name="Approve" />
  101. <camunda:value id="Reject" name="Reject" />
  102. <camunda:value id="InformationRequired" name="Information Required" />
  103. </camunda:formField>
  104. </camunda:formData>
  105. <camunda:taskListener event="assignment">
  106. <camunda:script scriptFormat="JavaScript">console.log(' item is now assigned ',item.assignee);</camunda:script>
  107. </camunda:taskListener>
  108. </bpmn2:extensionElements>
  109. <bpmn2:incoming>Flow_1ig8mx7</bpmn2:incoming>
  110. <bpmn2:outgoing>Flow_1my72g7</bpmn2:outgoing>
  111. </bpmn2:userTask>
  112. <bpmn2:boundaryEvent id="timer-event" cancelActivity="false" attachedToRef="Approve">
  113. <bpmn2:documentation>Repeat 3 times after 2 days</bpmn2:documentation>
  114. <bpmn2:outgoing>Flow_00etx8n</bpmn2:outgoing>
  115. <bpmn2:timerEventDefinition id="TimerEventDefinition_1hfeiwy">
  116. <bpmn2:timeCycle xsi:type="bpmn2:tFormalExpression">R3P10S</bpmn2:timeCycle>
  117. </bpmn2:timerEventDefinition>
  118. </bpmn2:boundaryEvent>
  119. <bpmn2:scriptTask id="Activity_1escddn" name="Reminder" scriptFormat="JavaScript">
  120. <bpmn2:incoming>Flow_00etx8n</bpmn2:incoming>
  121. <bpmn2:script>/*appUtils.notify();*/</bpmn2:script>
  122. </bpmn2:scriptTask>
  123. </bpmn2:process>
  124. <bpmndi:BPMNDiagram id="BPMNDiagram_1">
  125. <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_04y2yh2">
  126. <bpmndi:BPMNShape id="Participant_0r7glje_di" bpmnElement="Participant_0r7glje" isHorizontal="true">
  127. <dc:Bounds x="160" y="80" width="650" height="374" />
  128. </bpmndi:BPMNShape>
  129. <bpmndi:BPMNShape id="Lane_05wy8pe_di" bpmnElement="Lane_05wy8pe" isHorizontal="true">
  130. <dc:Bounds x="190" y="320" width="620" height="134" />
  131. </bpmndi:BPMNShape>
  132. <bpmndi:BPMNShape id="Lane_0a5bph6_di" bpmnElement="Lane_0a5bph6" isHorizontal="true">
  133. <dc:Bounds x="190" y="200" width="620" height="120" />
  134. </bpmndi:BPMNShape>
  135. <bpmndi:BPMNShape id="Lane_0jmm0qb_di" bpmnElement="Lane_0jmm0qb" isHorizontal="true">
  136. <dc:Bounds x="190" y="80" width="620" height="120" />
  137. </bpmndi:BPMNShape>
  138. <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
  139. <dc:Bounds x="212" y="122" width="36" height="36" />
  140. </bpmndi:BPMNShape>
  141. <bpmndi:BPMNShape id="Activity_0jq3ugg_di" bpmnElement="Request">
  142. <dc:Bounds x="330" y="100" width="100" height="80" />
  143. </bpmndi:BPMNShape>
  144. <bpmndi:BPMNShape id="Event_11njyo2_di" bpmnElement="Event_02om8ew">
  145. <dc:Bounds x="652" y="242" width="36" height="36" />
  146. </bpmndi:BPMNShape>
  147. <bpmndi:BPMNShape id="Event_1qg3mz1_di" bpmnElement="Event_1qg3mz1">
  148. <dc:Bounds x="592" y="382" width="36" height="36" />
  149. </bpmndi:BPMNShape>
  150. <bpmndi:BPMNShape id="Gateway_1kqewfd_di" bpmnElement="Gateway_1kqewfd" isMarkerVisible="true">
  151. <dc:Bounds x="475" y="235" width="50" height="50" />
  152. </bpmndi:BPMNShape>
  153. <bpmndi:BPMNShape id="Activity_0jssmpk_di" bpmnElement="Activity_1rx1txe">
  154. <dc:Bounds x="450" y="360" width="100" height="80" />
  155. </bpmndi:BPMNShape>
  156. <bpmndi:BPMNShape id="Activity_1aanvd6_di" bpmnElement="Approve">
  157. <dc:Bounds x="330" y="220" width="100" height="80" />
  158. </bpmndi:BPMNShape>
  159. <bpmndi:BPMNShape id="Activity_12w2lic_di" bpmnElement="Activity_1escddn">
  160. <dc:Bounds x="232" y="350" width="100" height="80" />
  161. </bpmndi:BPMNShape>
  162. <bpmndi:BPMNShape id="Event_0dn083r_di" bpmnElement="timer-event">
  163. <dc:Bounds x="312" y="252" width="36" height="36" />
  164. </bpmndi:BPMNShape>
  165. <bpmndi:BPMNEdge id="Flow_1ig8mx7_di" bpmnElement="Flow_1ig8mx7">
  166. <di:waypoint x="380" y="180" />
  167. <di:waypoint x="380" y="220" />
  168. </bpmndi:BPMNEdge>
  169. <bpmndi:BPMNEdge id="Flow_0xa1hl7_di" bpmnElement="Flow_0xa1hl7">
  170. <di:waypoint x="248" y="140" />
  171. <di:waypoint x="330" y="140" />
  172. </bpmndi:BPMNEdge>
  173. <bpmndi:BPMNEdge id="Flow_1my72g7_di" bpmnElement="Flow_1my72g7">
  174. <di:waypoint x="430" y="260" />
  175. <di:waypoint x="475" y="260" />
  176. </bpmndi:BPMNEdge>
  177. <bpmndi:BPMNEdge id="Flow_1un6mui_di" bpmnElement="Flow_1un6mui">
  178. <di:waypoint x="550" y="400" />
  179. <di:waypoint x="592" y="400" />
  180. </bpmndi:BPMNEdge>
  181. <bpmndi:BPMNEdge id="Flow_1ufmnuh_di" bpmnElement="Flow_1ufmnuh">
  182. <di:waypoint x="500" y="285" />
  183. <di:waypoint x="500" y="360" />
  184. <bpmndi:BPMNLabel>
  185. <dc:Bounds x="517" y="343" width="46" height="14" />
  186. </bpmndi:BPMNLabel>
  187. </bpmndi:BPMNEdge>
  188. <bpmndi:BPMNEdge id="Flow_1ef1q1u_di" bpmnElement="Flow_1ef1q1u">
  189. <di:waypoint x="525" y="260" />
  190. <di:waypoint x="652" y="260" />
  191. <bpmndi:BPMNLabel>
  192. <dc:Bounds x="567" y="242" width="44" height="14" />
  193. </bpmndi:BPMNLabel>
  194. </bpmndi:BPMNEdge>
  195. <bpmndi:BPMNEdge id="Flow_0rvg1ym_di" bpmnElement="Flow_0rvg1ym">
  196. <di:waypoint x="500" y="235" />
  197. <di:waypoint x="500" y="140" />
  198. <di:waypoint x="430" y="140" />
  199. <bpmndi:BPMNLabel>
  200. <dc:Bounds x="512" y="136" width="56" height="27" />
  201. </bpmndi:BPMNLabel>
  202. </bpmndi:BPMNEdge>
  203. <bpmndi:BPMNEdge id="Flow_00etx8n_di" bpmnElement="Flow_00etx8n">
  204. <di:waypoint x="312" y="270" />
  205. <di:waypoint x="282" y="270" />
  206. <di:waypoint x="282" y="350" />
  207. </bpmndi:BPMNEdge>
  208. </bpmndi:BPMNPlane>
  209. </bpmndi:BPMNDiagram>
  210. </bpmn2:definitions>