leave-countersign.bpmn 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
  4. xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath"
  5. targetNamespace="http://www.activiti.org/test">
  6. <process id="leave-countersign" name="请假流程-会签" isExecutable="true">
  7. <documentation>请假流程演示-会签</documentation>
  8. <startEvent id="startevent1" name="Start" activiti:initiator="applyUserId">
  9. <extensionElements>
  10. <activiti:formProperty id="startDate" name="请假开始日期" type="date" datePattern="yyyy-MM-dd" required="true"></activiti:formProperty>
  11. <activiti:formProperty id="endDate" name="请假结束日期" type="date" datePattern="yyyy-MM-dd" required="true"></activiti:formProperty>
  12. <activiti:formProperty id="reason" name="请假原因" type="string" required="true"></activiti:formProperty>
  13. <activiti:formProperty id="users" name="审批参与人" type="users" required="true"></activiti:formProperty>
  14. <activiti:formProperty id="validScript" type="javascript" default="alert('表单已经加载完毕');"></activiti:formProperty>
  15. </extensionElements>
  16. </startEvent>
  17. <userTask id="countersign" name="[部门/人事]联合会签" activiti:assignee="${user}">
  18. <extensionElements>
  19. <activiti:formProperty id="startDate" name="请假开始日期" type="date" datePattern="yyyy-MM-dd" writable="false"></activiti:formProperty>
  20. <activiti:formProperty id="endDate" name="请假结束日期" type="date" datePattern="yyyy-MM-dd" writable="false"></activiti:formProperty>
  21. <activiti:formProperty id="reason" name="请假原因" type="string" writable="false"></activiti:formProperty>
  22. <activiti:formProperty id="approved" name="审批意见" type="enum" required="true">
  23. <activiti:value id="true" name="同意"></activiti:value>
  24. <activiti:value id="false" name="拒绝"></activiti:value>
  25. </activiti:formProperty>
  26. <activiti:taskListener event="complete" delegateExpression="${leaveCounterSignCompleteListener}"></activiti:taskListener>
  27. </extensionElements>
  28. <multiInstanceLoopCharacteristics isSequential="false" activiti:collection="users"
  29. activiti:elementVariable="user"></multiInstanceLoopCharacteristics>
  30. </userTask>
  31. <userTask id="reportBack" name="销假" activiti:assignee="${applyUserId}">
  32. <extensionElements>
  33. <activiti:formProperty id="startDate" name="请假开始日期" type="date" datePattern="yyyy-MM-dd" writable="false"></activiti:formProperty>
  34. <activiti:formProperty id="endDate" name="请假结束日期" type="date" datePattern="yyyy-MM-dd" writable="false"></activiti:formProperty>
  35. <activiti:formProperty id="reason" name="请假原因" type="string" writable="false"></activiti:formProperty>
  36. <activiti:formProperty id="reportBackDate" name="销假日期" type="date" default="${endDate}" datePattern="yyyy-MM-dd"
  37. required="true"></activiti:formProperty>
  38. </extensionElements>
  39. </userTask>
  40. <endEvent id="endevent1" name="End"></endEvent>
  41. <sequenceFlow id="flow2" sourceRef="startevent1" targetRef="countersign">
  42. <extensionElements>
  43. <activiti:executionListener event="take" expression="${execution.setVariable('approvedCounter', 0)}"></activiti:executionListener>
  44. </extensionElements>
  45. </sequenceFlow>
  46. <sequenceFlow id="flow8" name="销假" sourceRef="reportBack" targetRef="endevent1">
  47. <extensionElements>
  48. <activiti:executionListener event="take" expression="${execution.setVariable('result', 'ok')}"></activiti:executionListener>
  49. </extensionElements>
  50. </sequenceFlow>
  51. <sequenceFlow id="flow13" name="全部通过" sourceRef="exclusivegateway1" targetRef="reportBack">
  52. <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approvedCounter == users.size()}]]></conditionExpression>
  53. </sequenceFlow>
  54. <exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>
  55. <sequenceFlow id="flow14" sourceRef="countersign" targetRef="exclusivegateway1"></sequenceFlow>
  56. <userTask id="modifyApply" name="调整申请" activiti:assignee="${applyUserId}">
  57. <extensionElements>
  58. <activiti:formProperty id="startDate" name="请假开始日期" type="date" datePattern="yyyy-MM-dd" required="true"></activiti:formProperty>
  59. <activiti:formProperty id="endDate" name="请假结束日期" type="date" datePattern="yyyy-MM-dd" required="true"></activiti:formProperty>
  60. <activiti:formProperty id="reason" name="请假原因" type="string" required="true"></activiti:formProperty>
  61. <activiti:formProperty id="reApply" name="重新申请" type="enum" required="true">
  62. <activiti:value id="true" name="重新申请"></activiti:value>
  63. <activiti:value id="false" name="取消申请"></activiti:value>
  64. </activiti:formProperty>
  65. </extensionElements>
  66. </userTask>
  67. <sequenceFlow id="flow15" name="部分通过" sourceRef="exclusivegateway1" targetRef="modifyApply">
  68. <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approvedCounter < users.size()}]]></conditionExpression>
  69. </sequenceFlow>
  70. <exclusiveGateway id="exclusivegateway2" name="Exclusive Gateway"></exclusiveGateway>
  71. <sequenceFlow id="flow16" sourceRef="modifyApply" targetRef="exclusivegateway2"></sequenceFlow>
  72. <sequenceFlow id="flow17" sourceRef="exclusivegateway2" targetRef="endevent1">
  73. <conditionExpression xsi:type="tFormalExpression"><![CDATA[${reApply == 'false'}]]></conditionExpression>
  74. </sequenceFlow>
  75. <sequenceFlow id="flow18" name="重新申请" sourceRef="exclusivegateway2" targetRef="countersign">
  76. <extensionElements>
  77. <activiti:executionListener event="take" expression="${execution.setVariable('approvedCounter', 0)}"></activiti:executionListener>
  78. </extensionElements>
  79. <conditionExpression xsi:type="tFormalExpression"><![CDATA[${reApply == 'true'}]]></conditionExpression>
  80. </sequenceFlow>
  81. </process>
  82. <bpmndi:BPMNDiagram id="BPMNDiagram_leave-countersign">
  83. <bpmndi:BPMNPlane bpmnElement="leave-countersign" id="BPMNPlane_leave-countersign">
  84. <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
  85. <omgdc:Bounds height="35.0" width="35.0" x="10.0" y="30.0"></omgdc:Bounds>
  86. </bpmndi:BPMNShape>
  87. <bpmndi:BPMNShape bpmnElement="reportBack" id="BPMNShape_reportBack">
  88. <omgdc:Bounds height="55.0" width="105.0" x="340.0" y="20.0"></omgdc:Bounds>
  89. </bpmndi:BPMNShape>
  90. <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
  91. <omgdc:Bounds height="35.0" width="35.0" x="375.0" y="203.0"></omgdc:Bounds>
  92. </bpmndi:BPMNShape>
  93. <bpmndi:BPMNShape bpmnElement="countersign" id="BPMNShape_countersign">
  94. <omgdc:Bounds height="55.0" width="105.0" x="90.0" y="20.0"></omgdc:Bounds>
  95. </bpmndi:BPMNShape>
  96. <bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
  97. <omgdc:Bounds height="40.0" width="40.0" x="220.0" y="27.0"></omgdc:Bounds>
  98. </bpmndi:BPMNShape>
  99. <bpmndi:BPMNShape bpmnElement="modifyApply" id="BPMNShape_modifyApply">
  100. <omgdc:Bounds height="55.0" width="105.0" x="188.0" y="110.0"></omgdc:Bounds>
  101. </bpmndi:BPMNShape>
  102. <bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="BPMNShape_exclusivegateway2">
  103. <omgdc:Bounds height="40.0" width="40.0" x="220.0" y="200.0"></omgdc:Bounds>
  104. </bpmndi:BPMNShape>
  105. <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
  106. <omgdi:waypoint x="45.0" y="47.0"></omgdi:waypoint>
  107. <omgdi:waypoint x="90.0" y="47.0"></omgdi:waypoint>
  108. </bpmndi:BPMNEdge>
  109. <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
  110. <omgdi:waypoint x="392.0" y="75.0"></omgdi:waypoint>
  111. <omgdi:waypoint x="392.0" y="203.0"></omgdi:waypoint>
  112. <bpmndi:BPMNLabel>
  113. <omgdc:Bounds height="11.0" width="100.0" x="-22.0" y="-17.0"></omgdc:Bounds>
  114. </bpmndi:BPMNLabel>
  115. </bpmndi:BPMNEdge>
  116. <bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13">
  117. <omgdi:waypoint x="260.0" y="47.0"></omgdi:waypoint>
  118. <omgdi:waypoint x="340.0" y="47.0"></omgdi:waypoint>
  119. <bpmndi:BPMNLabel>
  120. <omgdc:Bounds height="11.0" width="100.0" x="-29.0" y="-17.0"></omgdc:Bounds>
  121. </bpmndi:BPMNLabel>
  122. </bpmndi:BPMNEdge>
  123. <bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14">
  124. <omgdi:waypoint x="195.0" y="47.0"></omgdi:waypoint>
  125. <omgdi:waypoint x="220.0" y="47.0"></omgdi:waypoint>
  126. </bpmndi:BPMNEdge>
  127. <bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15">
  128. <omgdi:waypoint x="240.0" y="67.0"></omgdi:waypoint>
  129. <omgdi:waypoint x="240.0" y="110.0"></omgdi:waypoint>
  130. <bpmndi:BPMNLabel>
  131. <omgdc:Bounds height="11.0" width="100.0" x="10.0" y="0.0"></omgdc:Bounds>
  132. </bpmndi:BPMNLabel>
  133. </bpmndi:BPMNEdge>
  134. <bpmndi:BPMNEdge bpmnElement="flow16" id="BPMNEdge_flow16">
  135. <omgdi:waypoint x="240.0" y="165.0"></omgdi:waypoint>
  136. <omgdi:waypoint x="240.0" y="200.0"></omgdi:waypoint>
  137. </bpmndi:BPMNEdge>
  138. <bpmndi:BPMNEdge bpmnElement="flow17" id="BPMNEdge_flow17">
  139. <omgdi:waypoint x="260.0" y="220.0"></omgdi:waypoint>
  140. <omgdi:waypoint x="375.0" y="220.0"></omgdi:waypoint>
  141. </bpmndi:BPMNEdge>
  142. <bpmndi:BPMNEdge bpmnElement="flow18" id="BPMNEdge_flow18">
  143. <omgdi:waypoint x="220.0" y="220.0"></omgdi:waypoint>
  144. <omgdi:waypoint x="142.0" y="220.0"></omgdi:waypoint>
  145. <omgdi:waypoint x="142.0" y="75.0"></omgdi:waypoint>
  146. <bpmndi:BPMNLabel>
  147. <omgdc:Bounds height="11.0" width="100.0" x="9.0" y="14.0"></omgdc:Bounds>
  148. </bpmndi:BPMNLabel>
  149. </bpmndi:BPMNEdge>
  150. </bpmndi:BPMNPlane>
  151. </bpmndi:BPMNDiagram>
  152. </definitions>