MultiInstance Call activity variables

Hello everyone,

I’m new at Flowable and BPMN 2.0, and I’m having a problem.

The diagram bellow representes the flow that I want. First I obtain the number of times that Call Activity will be instanciated, next the Call Activity will execute the instances in this step for each called process is generated a variable that contains a value that I need to use in Evaluate Values task.

image

I can’t return the variables from the sub process (process called in Call activity) to the main process in other words in the Evaluate values task doesn’t see the variables.

I already tried this but the variables are always null. It appears that the each instance can’t change variables in the main process.

<callActivity id="callMultiplesInstances" name="Call Multiples Instances" calledElement="subprocess" flowable:inheritVariables="true" flowable:useLocalScopeForOutParameters="true">
        <extensionElements>
            <flowable:out source="text1" target="text1"/>
            <flowable:out source="text2" target="text2"/>
        </extensionElements>
        <multiInstanceLoopCharacteristics  flowable:collection="${assigneeList}" flowable:elementVariable="head" isSequential="false">
           <loopCardinality>3</loopCardinality>
       </multiInstanceLoopCharacteristics>
    </callActivity>

Can someone give me some light?
Thank you

If you set the variable ‘text1’ and ‘text2’ in the child process, then it should work. How does your ‘evaluate values’ step look like?

Also, take in account that the last instance of the multi instance will override the variables set by the previous ones.

Thank for answer.

this is a test case. The evaluate values step only do math like text1+text2.

Also, take in account that the last instance of the multi instance will override the variables set by the previous ones.
I thought that it’ll happen :slight_smile: .

Is possible that using something like this: processEngine.getRuntimeService().createProcessInstanceQuery() I can get the local variables for each sub process called from Call Activity?

I already tried some times using createProcessInstanceQuery but only get the variables from main process.

Can you help me?

Thanks

hi,I face the same problem,is there any solutions?thank you very much.