leave-countersign.bpmn 10 KB

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