All outgoing steps are executed in subworkflow using Call Activity

cancel
Showing results for 
Search instead for 
Did you mean: 
alokreturns
Member II

All outgoing steps are executed in subworkflow using Call Activity

Hi,

In my process I use Call Activity which references a sub process and this subprocess has two outgoing sequence flows. 

When the Call Activiti subprocess completed, all the outgoing sequence flow executed. But i want the execution to happen based on the subprocess results.

Please can you help me how to resolve this ?

Activiti XML looks like below :

<?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://activiti.org/bpmn20">
<process id="SUBF" name="SUBF" isExecutable="true">
<extensionElements>
<activiti:executionListener xmlns:activiti="http://activiti.org/bpmn" class="com.datagenic.gwf.activiti.ProcessStartInterceptor" event="start"/>
<activiti:executionListener xmlns:activiti="http://activiti.org/bpmn" class="com.datagenic.gwf.activiti.ProcessEndInterceptor" event="end"/>
</extensionElements>
<sequenceFlow id="Start-start" name="Start-start" sourceRef="Start" targetRef="CF11"/>
<startEvent id="Start" name="Start"/>
<serviceTask id="LOGGERFAILED" name="LOGGERFAILED" activiti:class="com.datagenic.gwf.activiti.ActivitiAction"/>
<sequenceFlow id="LOGGERFAILED-ok" name="LOGGERFAILED-ok" sourceRef="LOGGERFAILED" targetRef="End"/>
<sequenceFlow id="LOGGERFAILED-Failure" name="LOGGERFAILED-Failure" sourceRef="LOGGERFAILED" targetRef="Failure"/>
<serviceTask id="LOGGERSUCCESS" name="LOGGERSUCCESS" activiti:class="com.datagenic.gwf.activiti.ActivitiAction"/>
<sequenceFlow id="LOGGERSUCCESS-ok" name="LOGGERSUCCESS-ok" sourceRef="LOGGERSUCCESS" targetRef="MAINEND"/>
<sequenceFlow id="LOGGERSUCCESS-Failure" name="LOGGERSUCCESS-Failure" sourceRef="LOGGERSUCCESS" targetRef="Failure"/>
<callActivity id="CF11" name="CF11" calledElement="CF1">
<documentation>CF1</documentation>
<extensionElements>
<activiti:executionListener class="com.datagenic.gwf.activiti.ProcessStartInterceptor" event="start"/>
<activiti:executionListener class="com.datagenic.gwf.activiti.ProcessEndInterceptor" event="end"/>
<actitivi:in xmlns:actitivi="http://activiti.org/bpmn" source="ROOT" target="ROOT"/>
<actitivi:in xmlns:actitivi="http://activiti.org/bpmn" source="JOB_EXECUTION_ID" target="JOB_EXECUTION_ID"/>
<actitivi:in xmlns:actitivi="http://activiti.org/bpmn" source="CURRENT" target="CURRENT"/>
</extensionElements>
</callActivity>
<sequenceFlow id="CF11-COPYFILESUCCESS" name="CF11-COPYFILESUCCESS" sourceRef="CF11" targetRef="LOGGERSUCCESS"/>
<sequenceFlow id="CF11-COPYFILEFAILED" name="CF11-COPYFILEFAILED" sourceRef="CF11" targetRef="LOGGERFAILED"/>
<endEvent id="End" name="End">
<documentation>failure</documentation>
</endEvent>
<endEvent id="MAINEND" name="MAINEND">
<documentation>success</documentation>
</endEvent>
<endEvent id="Failure" name="Failure">
<documentation>failure</documentation>
</endEvent>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_SUBF">
<bpmndi:BPMNPlane bpmnElement="SUBF" id="BPMNPlane_SUBF"/>
</bpmndi:BPMNDiagram>
</definitions>

1 Reply
afaust
Master

Re: All outgoing steps are executed in subworkflow using Call Activity

That is the normal behaviour AFAIK - you should typically not have two outgoing sequence flows on a normal behaviour. Instead, have a single sequence flow go to a exclusive gateway, and from there you can have two outgoing sequence flows. The exclusive gateway knows how to handle multiple sequence flows, specifically that it can take your configuration (condition on sequence flow + default flow) to decide which one to take...