My workflow has two process instances(A & B) .Process A has a User Task and then a service task , after completion of this , flow goes to Process B’s service task ,where variables passed from User Task in Process A are accessed. But I am getting “null” in execution.getvariable(“x”) .
Although all processes have in & out variables set as “all”
This scenario works sometimes , but gives error most of the times.
@Sonali could you provide the bpmn file? It might be cause of the variables set in usertask was not saved in the db during service task execution if it’s execution is synchronous. By setting asyn before flag for service task might solve the issue
You are using call activities to call a separate process model for the sub processes. Each time you enter a call activity, a new process instance will be spawned, with a completely isolated set of variables. In order to ensure that the second execution of ABC has access to variables created or used in the first execution, you need to explicitely map the inputs and outputs to/from the call activities and the main process.
Yes, that’s what I meant. But I see now that you mentioned you already map them all.
It could be related to threads. To figure out if it is, I’d suggest marking the call activities and the start events of those subprocesses as async before. That would prevent a sub process from trying to access something that’s mapped in, but maybe not available at the higher level.