并行审核.bpmn 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  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" 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:camunda="http://camunda.org/schema/1.0/bpmn" id="sample-diagram" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.22.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
  3. <bpmn2:process id="ProcessApprove" name="审批流程" isExecutable="true" camunda:versionTag="1.0">
  4. <bpmn2:startEvent id="event_start">
  5. <bpmn2:outgoing>Flow_15zn1tu</bpmn2:outgoing>
  6. </bpmn2:startEvent>
  7. <bpmn2:userTask id="task_request" name="申请立项" camunda:assignee="owner">
  8. <bpmn2:extensionElements>
  9. <camunda:formData />
  10. <camunda:inputOutput>
  11. <camunda:inputParameter name="show_in_my_works">${true}</camunda:inputParameter>
  12. <camunda:inputParameter name="task_type">${1}</camunda:inputParameter>
  13. <camunda:inputParameter name="target_url">/workplace/project-detail/</camunda:inputParameter>
  14. <camunda:inputParameter name="relation_id">${environment.variables.prj_id}</camunda:inputParameter>
  15. <camunda:inputParameter name="url">${"test"+environment.variables.prj_id}</camunda:inputParameter>
  16. </camunda:inputOutput>
  17. </bpmn2:extensionElements>
  18. <bpmn2:incoming>Flow_1t45qnv</bpmn2:incoming>
  19. <bpmn2:incoming>Flow_0gyvyyo</bpmn2:incoming>
  20. <bpmn2:outgoing>Flow_1rg4oob</bpmn2:outgoing>
  21. <bpmn2:outgoing>Flow_0bhibn0</bpmn2:outgoing>
  22. </bpmn2:userTask>
  23. <bpmn2:sequenceFlow id="Flow_15zn1tu" sourceRef="event_start" targetRef="task_create" />
  24. <bpmn2:sequenceFlow id="Flow_1rg4oob" sourceRef="task_request" targetRef="task_approve" />
  25. <bpmn2:userTask id="task_approve" name="审核立项" camunda:assignee="top">
  26. <bpmn2:extensionElements>
  27. <camunda:formData>
  28. <camunda:formField id="pass" label="是否通过" type="boolean">
  29. <camunda:properties />
  30. <camunda:validation />
  31. </camunda:formField>
  32. </camunda:formData>
  33. </bpmn2:extensionElements>
  34. <bpmn2:incoming>Flow_1rg4oob</bpmn2:incoming>
  35. <bpmn2:outgoing>Flow_193tusd</bpmn2:outgoing>
  36. <bpmn2:multiInstanceLoopCharacteristics camunda:collection="${environment.variables.handlers}" camunda:elementVariable="handler">
  37. <bpmn2:loopCardinality xsi:type="bpmn2:tFormalExpression">${environment.variables.handlers.length}</bpmn2:loopCardinality>
  38. <bpmn2:completionCondition xsi:type="bpmn2:tFormalExpression">${content.output.break}</bpmn2:completionCondition>
  39. </bpmn2:multiInstanceLoopCharacteristics>
  40. </bpmn2:userTask>
  41. <bpmn2:exclusiveGateway id="gateway_approved" default="Flow_0nwaga3">
  42. <bpmn2:incoming>Flow_1fodcvc</bpmn2:incoming>
  43. <bpmn2:outgoing>Flow_0zubkyw</bpmn2:outgoing>
  44. <bpmn2:outgoing>Flow_0nwaga3</bpmn2:outgoing>
  45. </bpmn2:exclusiveGateway>
  46. <bpmn2:sequenceFlow id="Flow_193tusd" sourceRef="task_approve" targetRef="task_check" />
  47. <bpmn2:endEvent id="event_end">
  48. <bpmn2:incoming>Flow_02taytj</bpmn2:incoming>
  49. <bpmn2:incoming>Flow_1ucg773</bpmn2:incoming>
  50. </bpmn2:endEvent>
  51. <bpmn2:sequenceFlow id="Flow_0zubkyw" name="通过" sourceRef="gateway_approved" targetRef="event_throw_approved">
  52. <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="JavaScript">next(null, this.environment.services.get_value('passed')===true);</bpmn2:conditionExpression>
  53. </bpmn2:sequenceFlow>
  54. <bpmn2:sequenceFlow id="Flow_0nwaga3" name="驳回" sourceRef="gateway_approved" targetRef="event_throw_approved_back" />
  55. <bpmn2:sequenceFlow id="Flow_0bhibn0" sourceRef="task_request" targetRef="task_with_draw" />
  56. <bpmn2:userTask id="task_with_draw" name="撤回立项" camunda:formKey="cancel">
  57. <bpmn2:extensionElements>
  58. <camunda:formData>
  59. <camunda:formField id="withdraw" label="是否撤回" type="boolean" defaultValue="false" />
  60. </camunda:formData>
  61. <camunda:inputOutput>
  62. <camunda:outputParameter name="Output_2mfmjbe">
  63. <camunda:script scriptFormat="JavaScript">{"withdraw":true}</camunda:script>
  64. </camunda:outputParameter>
  65. </camunda:inputOutput>
  66. </bpmn2:extensionElements>
  67. <bpmn2:incoming>Flow_0bhibn0</bpmn2:incoming>
  68. <bpmn2:outgoing>Flow_0tj9nd6</bpmn2:outgoing>
  69. </bpmn2:userTask>
  70. <bpmn2:sequenceFlow id="Flow_0tj9nd6" sourceRef="task_with_draw" targetRef="Event_throw_withdraw" />
  71. <bpmn2:boundaryEvent id="Event_catch_withdraw" name="撤回" attachedToRef="task_approve">
  72. <bpmn2:outgoing>Flow_0nzbvpg</bpmn2:outgoing>
  73. <bpmn2:signalEventDefinition id="SignalEventDefinition_111s194" signalRef="Signal_0hhmd7l" />
  74. </bpmn2:boundaryEvent>
  75. <bpmn2:intermediateThrowEvent id="Event_throw_withdraw" name="撤回事件">
  76. <bpmn2:incoming>Flow_0tj9nd6</bpmn2:incoming>
  77. <bpmn2:signalEventDefinition id="SignalEventDefinition_1tt7p06" signalRef="Signal_0hhmd7l" />
  78. </bpmn2:intermediateThrowEvent>
  79. <bpmn2:sequenceFlow id="Flow_02taytj" sourceRef="event_throw_approved" targetRef="event_end" />
  80. <bpmn2:intermediateThrowEvent id="event_throw_approved">
  81. <bpmn2:incoming>Flow_0zubkyw</bpmn2:incoming>
  82. <bpmn2:outgoing>Flow_02taytj</bpmn2:outgoing>
  83. <bpmn2:signalEventDefinition id="SignalEventDefinition_07jfo4t" signalRef="Signal_0828f9d" />
  84. </bpmn2:intermediateThrowEvent>
  85. <bpmn2:sequenceFlow id="Flow_1ucg773" sourceRef="event_catch_approved" targetRef="event_end" />
  86. <bpmn2:boundaryEvent id="event_catch_approved" name="已审核" attachedToRef="task_with_draw">
  87. <bpmn2:outgoing>Flow_1ucg773</bpmn2:outgoing>
  88. <bpmn2:signalEventDefinition id="SignalEventDefinition_02ri5rf" signalRef="Signal_0828f9d" />
  89. </bpmn2:boundaryEvent>
  90. <bpmn2:intermediateThrowEvent id="event_throw_approved_back">
  91. <bpmn2:incoming>Flow_0nwaga3</bpmn2:incoming>
  92. <bpmn2:outgoing>Flow_06cxzjx</bpmn2:outgoing>
  93. <bpmn2:signalEventDefinition id="SignalEventDefinition_0y27jk5" signalRef="Signal_0828f9d" />
  94. </bpmn2:intermediateThrowEvent>
  95. <bpmn2:manualTask id="task_modify" name="修改项目信息">
  96. <bpmn2:incoming>Flow_0nzbvpg</bpmn2:incoming>
  97. <bpmn2:incoming>Flow_06cxzjx</bpmn2:incoming>
  98. <bpmn2:outgoing>Flow_1t45qnv</bpmn2:outgoing>
  99. </bpmn2:manualTask>
  100. <bpmn2:sequenceFlow id="Flow_1t45qnv" sourceRef="task_modify" targetRef="task_request" />
  101. <bpmn2:sequenceFlow id="Flow_0nzbvpg" sourceRef="Event_catch_withdraw" targetRef="task_modify" />
  102. <bpmn2:sequenceFlow id="Flow_06cxzjx" sourceRef="event_throw_approved_back" targetRef="task_modify" />
  103. <bpmn2:manualTask id="task_create" name="创建项目">
  104. <bpmn2:incoming>Flow_15zn1tu</bpmn2:incoming>
  105. <bpmn2:outgoing>Flow_0gyvyyo</bpmn2:outgoing>
  106. </bpmn2:manualTask>
  107. <bpmn2:sequenceFlow id="Flow_0gyvyyo" sourceRef="task_create" targetRef="task_request" />
  108. <bpmn2:sequenceFlow id="Flow_1fodcvc" sourceRef="task_check" targetRef="gateway_approved" />
  109. <bpmn2:scriptTask id="task_check" name="检查是否通过" scriptFormat="Javascript" camunda:resultVariable="passed">
  110. <bpmn2:extensionElements />
  111. <bpmn2:incoming>Flow_193tusd</bpmn2:incoming>
  112. <bpmn2:outgoing>Flow_1fodcvc</bpmn2:outgoing>
  113. <bpmn2:script>var passed = false;
  114. for (var i = 0; i &lt; this.environment.output.task_approve.length; i++) {
  115. var value = this.environment.output.task_approve[i];
  116. if (value &amp;&amp; value.pass) {
  117. passed = true;
  118. break;
  119. }
  120. }
  121. this.environment.services.set_value('passed', passed);
  122. next();</bpmn2:script>
  123. </bpmn2:scriptTask>
  124. </bpmn2:process>
  125. <bpmn2:signal id="Signal_0hhmd7l" name="cancel_sign" />
  126. <bpmn2:message id="Message_0fh9t3e" name="msg_cancel" />
  127. <bpmn2:message id="Message_1qtzp8g" name="Message_0q7qbc4" />
  128. <bpmn2:signal id="Signal_0828f9d" name="Signal_2sf6vik" />
  129. <bpmndi:BPMNDiagram id="BPMNDiagram_1">
  130. <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="ProcessApprove">
  131. <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="event_start">
  132. <dc:Bounds x="142" y="132" width="36" height="36" />
  133. </bpmndi:BPMNShape>
  134. <bpmndi:BPMNShape id="Activity_09wmdbt_di" bpmnElement="task_request">
  135. <dc:Bounds x="330" y="110" width="100" height="80" />
  136. <bpmndi:BPMNLabel />
  137. </bpmndi:BPMNShape>
  138. <bpmndi:BPMNShape id="Activity_0ds6ym0_di" bpmnElement="task_approve">
  139. <dc:Bounds x="490" y="110" width="100" height="80" />
  140. <bpmndi:BPMNLabel />
  141. </bpmndi:BPMNShape>
  142. <bpmndi:BPMNShape id="Gateway_06baw71_di" bpmnElement="gateway_approved" isMarkerVisible="true">
  143. <dc:Bounds x="795" y="125" width="50" height="50" />
  144. </bpmndi:BPMNShape>
  145. <bpmndi:BPMNShape id="Event_15877ow_di" bpmnElement="event_end">
  146. <dc:Bounds x="992" y="132" width="36" height="36" />
  147. </bpmndi:BPMNShape>
  148. <bpmndi:BPMNShape id="Activity_0fonc56_di" bpmnElement="task_with_draw">
  149. <dc:Bounds x="400" y="410" width="100" height="80" />
  150. <bpmndi:BPMNLabel />
  151. </bpmndi:BPMNShape>
  152. <bpmndi:BPMNShape id="Event_0mceau4_di" bpmnElement="Event_throw_withdraw">
  153. <dc:Bounds x="542" y="432" width="36" height="36" />
  154. <bpmndi:BPMNLabel>
  155. <dc:Bounds x="538" y="475" width="44" height="14" />
  156. </bpmndi:BPMNLabel>
  157. </bpmndi:BPMNShape>
  158. <bpmndi:BPMNShape id="Event_0tntlum_di" bpmnElement="event_throw_approved">
  159. <dc:Bounds x="922" y="132" width="36" height="36" />
  160. </bpmndi:BPMNShape>
  161. <bpmndi:BPMNShape id="Event_1gjhb1n_di" bpmnElement="event_throw_approved_back">
  162. <dc:Bounds x="802" y="222" width="36" height="36" />
  163. </bpmndi:BPMNShape>
  164. <bpmndi:BPMNShape id="Activity_1d8u98g_di" bpmnElement="task_modify">
  165. <dc:Bounds x="410" y="240" width="100" height="80" />
  166. <bpmndi:BPMNLabel />
  167. </bpmndi:BPMNShape>
  168. <bpmndi:BPMNShape id="Activity_0isolrc_di" bpmnElement="task_create">
  169. <dc:Bounds x="200" y="110" width="100" height="80" />
  170. <bpmndi:BPMNLabel />
  171. </bpmndi:BPMNShape>
  172. <bpmndi:BPMNShape id="Activity_0ehf5li_di" bpmnElement="task_check">
  173. <dc:Bounds x="650" y="110" width="100" height="80" />
  174. <bpmndi:BPMNLabel />
  175. </bpmndi:BPMNShape>
  176. <bpmndi:BPMNShape id="Event_06bs6js_di" bpmnElement="event_catch_approved">
  177. <dc:Bounds x="432" y="392" width="36" height="36" />
  178. <bpmndi:BPMNLabel>
  179. <dc:Bounds x="463" y="386" width="33" height="27" />
  180. </bpmndi:BPMNLabel>
  181. </bpmndi:BPMNShape>
  182. <bpmndi:BPMNShape id="Event_0s1xb2l_di" bpmnElement="Event_catch_withdraw">
  183. <dc:Bounds x="552" y="172" width="36" height="36" />
  184. <bpmndi:BPMNLabel>
  185. <dc:Bounds x="559" y="215" width="22" height="14" />
  186. </bpmndi:BPMNLabel>
  187. </bpmndi:BPMNShape>
  188. <bpmndi:BPMNEdge id="Flow_15zn1tu_di" bpmnElement="Flow_15zn1tu">
  189. <di:waypoint x="178" y="150" />
  190. <di:waypoint x="200" y="150" />
  191. </bpmndi:BPMNEdge>
  192. <bpmndi:BPMNEdge id="Flow_1rg4oob_di" bpmnElement="Flow_1rg4oob">
  193. <di:waypoint x="430" y="150" />
  194. <di:waypoint x="490" y="150" />
  195. </bpmndi:BPMNEdge>
  196. <bpmndi:BPMNEdge id="Flow_193tusd_di" bpmnElement="Flow_193tusd">
  197. <di:waypoint x="590" y="150" />
  198. <di:waypoint x="650" y="150" />
  199. </bpmndi:BPMNEdge>
  200. <bpmndi:BPMNEdge id="Flow_0zubkyw_di" bpmnElement="Flow_0zubkyw">
  201. <di:waypoint x="845" y="150" />
  202. <di:waypoint x="922" y="150" />
  203. <bpmndi:BPMNLabel>
  204. <dc:Bounds x="873" y="132" width="22" height="14" />
  205. </bpmndi:BPMNLabel>
  206. </bpmndi:BPMNEdge>
  207. <bpmndi:BPMNEdge id="Flow_0nwaga3_di" bpmnElement="Flow_0nwaga3">
  208. <di:waypoint x="820" y="175" />
  209. <di:waypoint x="820" y="222" />
  210. <bpmndi:BPMNLabel>
  211. <dc:Bounds x="824" y="183" width="22" height="14" />
  212. </bpmndi:BPMNLabel>
  213. </bpmndi:BPMNEdge>
  214. <bpmndi:BPMNEdge id="Flow_0bhibn0_di" bpmnElement="Flow_0bhibn0">
  215. <di:waypoint x="380" y="190" />
  216. <di:waypoint x="380" y="450" />
  217. <di:waypoint x="400" y="450" />
  218. </bpmndi:BPMNEdge>
  219. <bpmndi:BPMNEdge id="Flow_0tj9nd6_di" bpmnElement="Flow_0tj9nd6">
  220. <di:waypoint x="500" y="450" />
  221. <di:waypoint x="542" y="450" />
  222. </bpmndi:BPMNEdge>
  223. <bpmndi:BPMNEdge id="Flow_02taytj_di" bpmnElement="Flow_02taytj">
  224. <di:waypoint x="958" y="150" />
  225. <di:waypoint x="992" y="150" />
  226. </bpmndi:BPMNEdge>
  227. <bpmndi:BPMNEdge id="Flow_1ucg773_di" bpmnElement="Flow_1ucg773">
  228. <di:waypoint x="450" y="392" />
  229. <di:waypoint x="450" y="340" />
  230. <di:waypoint x="1010" y="340" />
  231. <di:waypoint x="1010" y="168" />
  232. </bpmndi:BPMNEdge>
  233. <bpmndi:BPMNEdge id="Flow_1t45qnv_di" bpmnElement="Flow_1t45qnv">
  234. <di:waypoint x="460" y="240" />
  235. <di:waypoint x="460" y="215" />
  236. <di:waypoint x="400" y="215" />
  237. <di:waypoint x="400" y="190" />
  238. </bpmndi:BPMNEdge>
  239. <bpmndi:BPMNEdge id="Flow_0nzbvpg_di" bpmnElement="Flow_0nzbvpg">
  240. <di:waypoint x="570" y="208" />
  241. <di:waypoint x="570" y="280" />
  242. <di:waypoint x="510" y="280" />
  243. </bpmndi:BPMNEdge>
  244. <bpmndi:BPMNEdge id="Flow_06cxzjx_di" bpmnElement="Flow_06cxzjx">
  245. <di:waypoint x="820" y="258" />
  246. <di:waypoint x="820" y="280" />
  247. <di:waypoint x="510" y="280" />
  248. </bpmndi:BPMNEdge>
  249. <bpmndi:BPMNEdge id="Flow_0gyvyyo_di" bpmnElement="Flow_0gyvyyo">
  250. <di:waypoint x="300" y="150" />
  251. <di:waypoint x="330" y="150" />
  252. </bpmndi:BPMNEdge>
  253. <bpmndi:BPMNEdge id="Flow_1fodcvc_di" bpmnElement="Flow_1fodcvc">
  254. <di:waypoint x="750" y="150" />
  255. <di:waypoint x="795" y="150" />
  256. </bpmndi:BPMNEdge>
  257. </bpmndi:BPMNPlane>
  258. </bpmndi:BPMNDiagram>
  259. </bpmn2:definitions>