cancel
Showing results for 
Search instead for 
Did you mean: 

assign parallel generated task to multiple user

skverma02
Confirmed Champ
Confirmed Champ

how to assign parallel generated task to multiple user?

lets assume  start  a workflow which have a subProcess . Subprocess executed parallely. so when start subprocess then a userTask in subprocess assigne mutiple user. how can i do this. genre ted 

2 REPLIES 2

skverma02
Confirmed Champ
Confirmed Champ

here is an example of my situation

2nd userTask is the part of subProcess and subprocess have 3 cardinality and executed parallel .

i want to assign 2nd task to multiple user like userA,userB,userC
how can i resolve this problem.

<?xml version="1.0" encoding="UTF-8"?>
<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" xmlnsSmiley Surprisedmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsSmiley Surprisedmgdi="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/processdef">
<process id="test" isExecutable="true">
<startEvent id="sid-84EF1826-E6B3-4B4A-ADEF-DFA769634AD3"></startEvent>
<userTask id="first" name="1st" activiti:assignee="kermit"></userTask>
<sequenceFlow id="sid-AE224C93-4F27-4808-81D8-1F88470C3840" sourceRef="sid-84EF1826-E6B3-4B4A-ADEF-DFA769634AD3" targetRef="first"></sequenceFlow>
<subProcess id="sid-81867B78-184A-4D84-8C2B-67506B546800" name="subProcess">
<multiInstanceLoopCharacteristics isSequential="false">
<loopCardinality>3</loopCardinality>
</multiInstanceLoopCharacteristics>
<startEvent id="sid-07799DC6-C2C4-4AB8-8CDA-2970C621213F"></startEvent>
<userTask id="sid-DD5D73AF-BD2C-4C2B-866F-CDE0A7DA6EF8" name="2nd"></userTask>
<endEvent id="sid-FCB7AB8A-7CC6-4887-A137-66AB9FEFE601"></endEvent>
<sequenceFlow id="sid-5A93F6A6-7176-4713-96F7-2A460C822900" sourceRef="sid-07799DC6-C2C4-4AB8-8CDA-2970C621213F" targetRef="sid-DD5D73AF-BD2C-4C2B-866F-CDE0A7DA6EF8"></sequenceFlow>
<sequenceFlow id="sid-5349AB8F-66DF-42C7-8166-92BBA56C7D00" sourceRef="sid-DD5D73AF-BD2C-4C2B-866F-CDE0A7DA6EF8" targetRef="sid-FCB7AB8A-7CC6-4887-A137-66AB9FEFE601"></sequenceFlow>
</subProcess>
<endEvent id="sid-19590685-6F65-4B13-AD92-87FD11F871CE"></endEvent>
<sequenceFlow id="sid-844ADA12-CECD-48F9-960C-3AEBB4FCE740" sourceRef="sid-81867B78-184A-4D84-8C2B-67506B546800" targetRef="sid-19590685-6F65-4B13-AD92-87FD11F871CE"></sequenceFlow>
<sequenceFlow id="sid-F40223AB-C341-4D69-92F7-A69F007A40C9" sourceRef="first" targetRef="sid-81867B78-184A-4D84-8C2B-67506B546800"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_test">
<bpmndi:BPMNPlane bpmnElement="test" id="BPMNPlane_test">
<bpmndi:BPMNShape bpmnElement="sid-84EF1826-E6B3-4B4A-ADEF-DFA769634AD3" id="BPMNShape_sid-84EF1826-E6B3-4B4A-ADEF-DFA769634AD3">
<omgdc:Bounds height="30.0" width="30.0" x="105.0" y="191.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="first" id="BPMNShape_first">
<omgdc:Bounds height="80.0" width="100.0" x="226.25" y="166.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-81867B78-184A-4D84-8C2B-67506B546800" id="BPMNShape_sid-81867B78-184A-4D84-8C2B-67506B546800">
<omgdc:Bounds height="187.0" width="446.0" x="410.25" y="114.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-07799DC6-C2C4-4AB8-8CDA-2970C621213F" id="BPMNShape_sid-07799DC6-C2C4-4AB8-8CDA-2970C621213F">
<omgdc:Bounds height="30.0" width="30.0" x="440.25" y="191.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-DD5D73AF-BD2C-4C2B-866F-CDE0A7DA6EF8" id="BPMNShape_sid-DD5D73AF-BD2C-4C2B-866F-CDE0A7DA6EF8">
<omgdc:Bounds height="80.0" width="100.0" x="520.25" y="166.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-FCB7AB8A-7CC6-4887-A137-66AB9FEFE601" id="BPMNShape_sid-FCB7AB8A-7CC6-4887-A137-66AB9FEFE601">
<omgdc:Bounds height="28.0" width="28.0" x="715.25" y="192.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-19590685-6F65-4B13-AD92-87FD11F871CE" id="BPMNShape_sid-19590685-6F65-4B13-AD92-87FD11F871CE">
<omgdc:Bounds height="28.0" width="28.0" x="959.25" y="193.5"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sid-5349AB8F-66DF-42C7-8166-92BBA56C7D00" id="BPMNEdge_sid-5349AB8F-66DF-42C7-8166-92BBA56C7D00">
<omgdi:waypoint x="620.25" y="206.0"></omgdi:waypoint>
<omgdi:waypoint x="715.25" y="206.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-F40223AB-C341-4D69-92F7-A69F007A40C9" id="BPMNEdge_sid-F40223AB-C341-4D69-92F7-A69F007A40C9">
<omgdi:waypoint x="326.25" y="206.0"></omgdi:waypoint>
<omgdi:waypoint x="410.25" y="206.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-AE224C93-4F27-4808-81D8-1F88470C3840" id="BPMNEdge_sid-AE224C93-4F27-4808-81D8-1F88470C3840">
<omgdi:waypoint x="135.0" y="206.0"></omgdi:waypoint>
<omgdi:waypoint x="226.25" y="206.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-844ADA12-CECD-48F9-960C-3AEBB4FCE740" id="BPMNEdge_sid-844ADA12-CECD-48F9-960C-3AEBB4FCE740">
<omgdi:waypoint x="856.25" y="207.5"></omgdi:waypoint>
<omgdi:waypoint x="959.25" y="207.5"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-5A93F6A6-7176-4713-96F7-2A460C822900" id="BPMNEdge_sid-5A93F6A6-7176-4713-96F7-2A460C822900">
<omgdi:waypoint x="470.25" y="206.0"></omgdi:waypoint>
<omgdi:waypoint x="520.25" y="206.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>

vhelmut
Confirmed Champ
Confirmed Champ

Hi, skverma02 _‌!

One of examples of parallel workflow you can find Alvex extension repository. In this workflow executes parallel subprocesses of different types and one is of the tasks assigned to multiple users by next code:

execution.setVariable('assigneeName', alvexwfat_assistants.get(loopCounter));

where "assigneeName" is variable of assignee and "alvexwfat_assistants" variable, which contains array with list of users who must be assign to multi instance task.

This code set as the listener on the sequence flow which target is multi-task. You can look closer on 121 of Alvex extension repository.

 Hope it helps! Good luck!