AnsweredAssumed Answered

Activiti 6: Parallel gateway with Async Executor is not working while joining two parallel tasks

Question asked by deepikanms on Jul 25, 2018

<?xml version="1.0" encoding="UTF-8" ?>

<definitions id="definitions"

    <process id = "Process1" name = "Process1" isExecutable="true">

        <startEvent id="start"/>
        <serviceTask id="joinFlow" activiti:class= "joinFlowClass"  />
        <serviceTask id="SubProcess1" activiti:class= "SubProcess1Class" activiti:async="true" activiti:exclusive="false"  />
        <serviceTask id="SubProcess2" activiti:class= "SubProcess2Class" activiti:async="true" activiti:exclusive="false" />

        <sequenceFlow id="flow1" sourceRef="start" targetRef="parallelGtw" />

        <parallelGateway id = "parallelGtw" activiti:async="true" activiti:exclusive="false" />
        <sequenceFlow sourceRef="parallelGtw" targetRef="SubProcess1" />
        <sequenceFlow sourceRef="parallelGtw" targetRef="SubProcess2" />

        <sequenceFlow sourceRef="SubProcess1" targetRef="join" />
        <sequenceFlow sourceRef="SubProcess2" targetRef="join" />

        <parallelGateway id="join" />
        <sequenceFlow sourceRef="join" targetRef="joinFlow" />
        <sequenceFlow sourceRef="joinFlow" targetRef="end" />

        <endEvent id = "end"/>


In the above activiti xml......

Parallel gateway forked two tasks and they were executed in two different threads(activiti:async="true" activiti:exclusive="false") But  what happened was the overall process got completed before joining the result of the two parallel tasks.


Can u please tell me how to join the parallel tasks and continue with the rest of the flows?