Deepika
Deepika

Reputation: 31

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

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

<definitions id="definitions"
         targetNamespace="http://activiti.org/bpmn20"
         xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:activiti="http://activiti.org/bpmn">

<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"/>
</process>
</definitions>

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.

Graphical rendering: Graphical rendering of BPMN process

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

Upvotes: 3

Views: 706

Answers (1)

mrgrechkinn
mrgrechkinn

Reputation: 908

You should specify activiti:async="true" for "join" parallel gateway too.

Upvotes: 3

Related Questions