AnsweredAssumed Answered

Async continuation with subprocess-loop

Question asked by workflowuser2 on Aug 7, 2012
Latest reply on Nov 5, 2012 by frederikheremans1
Hi Group,

I know that this topic is repeated multiple times here but I still have difficulty understanding why the following case is not working.

- i have a mainprocess + subprocess repeated (multiInstanceLoopCharacteristics)
- main process has 2 java service classes, subprocess also has two java service classes

suprocess: aync="true"
first service task in subprocess: async="true"

see process attached.
I am expecting that each run of subprocess be executed in different thread. However, all is happening in the same (main) thread.

Any guidence appreciated. thanks.

pdt
<?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: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="mainprocess" name="process1">
    <startEvent id="startevent1" name="Start"></startEvent>
    <endEvent id="successEndEvent" name="End"></endEvent>

    <sequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="servicetask1"></sequenceFlow>
    <sequenceFlow id="flow2" name="" sourceRef="servicetask1" targetRef="servicetask2"></sequenceFlow>
    <sequenceFlow id="flow3" name="" sourceRef="servicetask2" targetRef="subprocess1"></sequenceFlow>
    <sequenceFlow id="flow4" name="" sourceRef="subprocess1" targetRef="successEndEvent"></sequenceFlow>
   
    <serviceTask id="servicetask1" name="Service Task" activiti:class="com.activiti.acme.delegates.ADelegate"></serviceTask>
    <serviceTask id="servicetask2" name="Service Task" activiti:class="com.activiti.acme.delegates.BDelegate"></serviceTask>
    <subProcess id="subprocess1" name="Sub Process" activiti:async="true">
   
      <multiInstanceLoopCharacteristics isSequential="false" activiti:collection="listObj" activiti:elementVariable="assignee"></multiInstanceLoopCharacteristics>
      <startEvent id="startevent2" name="Start"></startEvent>
      <endEvent id="endevent4" name="End"></endEvent>
      <serviceTask id="servicetask3" name="Service Task" activiti:async="true" activiti:class="com.activiti.acme.delegates.Sub1VariableDelegate"></serviceTask>
      <serviceTask id="servicetask5" name="Service Task" activiti:class="com.activiti.acme.delegates.Sub2Delegate"></serviceTask>
     
      <sequenceFlow id="flow9" name="" sourceRef="startevent2" targetRef="servicetask3"></sequenceFlow>
      <sequenceFlow id="flow10" name="" sourceRef="servicetask3" targetRef="servicetask5"></sequenceFlow>
      <sequenceFlow id="flow11" name="" sourceRef="servicetask5" targetRef="endevent4"></sequenceFlow>
    </subProcess>
   
  </process>
</definitions>

Outcomes