有的时候,一个任务节点会存在多个候选人,例如 zhangsan
提交一个任务,这个任务既可以 lisi
处理,又可以 wangwu
处理,那么针对这种多个任务候选人的情况,我们该如何处理?今天一起来看看
首先我们使用的流程图如上,但是在为 提交请假申请
设置分配用户的时候,我们设置多个用户,如下图
设置完成后,我们下载这个流程文件,来看下对应的 XML
文件
<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:flowable="http://flowable.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.flowable.org/processdef" exporter="Flowable Open Source Modeler"
exporterVersion="6.7.2">
<process id="Leave2" name="Leave2" isExecutable="true">
<documentation>公司请假申请流程documentation>
<startEvent id="sid-EDEC0102-C387-4F9A-B5EF-157587793A4D" flowable:formFieldValidation="true">startEvent>
<userTask id="userId" name="请假申请" flowable:candidateUsers="${candidate1},${candidate2},${candidate3}"
flowable:formFieldValidation="true">userTask>
<sequenceFlow id="sid-A62E0666-ABAF-4A31-B7A6-43157D7F59B2" sourceRef="sid-EDEC0102-C387-4F9A-B5EF-157587793A4D"
targetRef="userId">sequenceFlow>
<sequenceFlow id="sid-0EED4703-83C6-4B57-9015-A75B06927C0C" sourceRef="userId"
targetRef="sid-FF0BB60C-47D5-4DB5-8C3E-C21A1DFC1F81">sequenceFlow>
<parallelGateway id="sid-FF0BB60C-47D5-4DB5-8C3E-C21A1DFC1F81">parallelGateway>
<userTask id="xmjlId" name="项目经理审批" flowable:assignee="${ProjectManager}" flowable:formFieldValidation="true">
<extensionElements>
<modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler">
modeler:initiator-can-complete>
extensionElements>
userTask>
<userTask id="jsjlId" name="技术经理审批" flowable:assignee="${TechnicalManager}" flowable:formFieldValidation="true">
<extensionElements>
<modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler">
modeler:initiator-can-complete>
extensionElements>
userTask>
<sequenceFlow id="sid-7A21D68A-3115-447A-B147-CDC6144D6D71" sourceRef="sid-FF0BB60C-47D5-4DB5-8C3E-C21A1DFC1F81"
targetRef="jsjlId">sequenceFlow>
<sequenceFlow id="sid-EF7EDB7C-3719-485D-85C6-EDF2DA8DBE33" sourceRef="sid-FF0BB60C-47D5-4DB5-8C3E-C21A1DFC1F81"
targetRef="xmjlId">sequenceFlow>
<sequenceFlow id="sid-25F6DB53-F695-4A0D-BBFC-6B8A45371EDF" sourceRef="jsjlId"
targetRef="sid-B961DC17-1F54-4B6B-BCA9-9EA15DEFDC29">sequenceFlow>
<parallelGateway id="sid-B961DC17-1F54-4B6B-BCA9-9EA15DEFDC29">parallelGateway>
<sequenceFlow id="sid-C7AA05DF-F958-476D-8710-F9B8DD51BE85" sourceRef="xmjlId"
targetRef="sid-B961DC17-1F54-4B6B-BCA9-9EA15DEFDC29">sequenceFlow>
<exclusiveGateway id="sid-3C064FB3-2132-4C38-88E0-F1AD3CA14A1C">exclusiveGateway>
<sequenceFlow id="sid-4C96EBB0-7EAC-4FD5-BF06-6551F53C9D0D" sourceRef="sid-B961DC17-1F54-4B6B-BCA9-9EA15DEFDC29"
targetRef="sid-3C064FB3-2132-4C38-88E0-F1AD3CA14A1C">sequenceFlow>
<userTask id="zjlId" name="总经理审批" flowable:assignee="${boss}" flowable:formFieldValidation="true">
<extensionElements>
<modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler">
modeler:initiator-can-complete>
extensionElements>
userTask>
<endEvent id="sid-94B5337F-CEDF-4FF3-A051-C90E82D4E670">endEvent>
<sequenceFlow id="sid-3E165D65-0F3E-4BE1-A3A4-980746B9B473" sourceRef