AnsweredAssumed Answered

Process Gets stuck when parallel branch has no parallel join

Question asked by mhanrahan on Jan 30, 2017
Latest reply on Jan 31, 2017 by gdharley

We recently updated our Activiti version from 5.16.3 to 5.21, and we have found a scenario in one of our existing processes where a process will get stuck with no way to recover the process.


Basically if you have a parallel gateway, one of the branches has a service task that is asynchronous, and the other branch is not asynchronous and flows through to an end event straight away, the branch that is asynchronous will never have a job fired to process the async continuation and be stuck forever.


This is a sample process that illustrates the issue:

<definitions xmlns="" xmlns:xsi="" xmlns:xsd="" xmlns:activiti="" xmlns:bpmndi="" xmlns:omgdc="" xmlns:omgdi="" typeLanguage="" expressionLanguage="" targetNamespace="">
  <process id="ParallelGatewayTest" name="My ParallelGatewayTest" isExecutable="true">
    <startEvent id="startevent1" name="Start"></startEvent>
    <serviceTask id="servicetask1" name="Asynchronous Task" activiti:async="true" activiti:class="com.example.SomeListener"></serviceTask>
    <parallelGateway id="parallelgateway1" name="Parallel Gateway"></parallelGateway>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="parallelgateway1"></sequenceFlow>
    <sequenceFlow id="flow2" sourceRef="parallelgateway1" targetRef="servicetask1"></sequenceFlow>
    <serviceTask id="shouldAlwaysRun" name="Is Never Run" activiti:class="com.example.SomeOtherListener"></serviceTask>
    <sequenceFlow id="flow3" sourceRef="servicetask1" targetRef="shouldAlwaysRun"></sequenceFlow>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow4" sourceRef="shouldAlwaysRun" targetRef="endevent1"></sequenceFlow>
    <sequenceFlow id="flow5" sourceRef="parallelgateway1" targetRef="servicetask2"></sequenceFlow>
    <serviceTask id="servicetask2" name="Flow Through task" activiti:class="com.example.SomeThirdListener"></serviceTask>
    <sequenceFlow id="flow6" sourceRef="servicetask2" targetRef="endevent1"></sequenceFlow>

Adding a parallel join at the end resolves the issue, but the process I am working with is much more complicated than this example.


Any other suggestions?