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="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" 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.activiti.org/test">
  <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>
  </process>
</definitions>

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?

Outcomes