Hi folks,
I’m looking for a solution to add some global variables which can be later shared and reused by different process instaces instead of passing variables In and Out Mapping in the BPMN files.
Thanks
Hi folks,
I’m looking for a solution to add some global variables which can be later shared and reused by different process instaces instead of passing variables In and Out Mapping in the BPMN files.
Thanks
Hi
Could you explain a little more about your use case - fx what kind of data needs to be available to all process instances?
BR
Michael
I need to define a variable in a root process instance and access to its content in sub process instance without mapping it explicitily in the BMPN files.
In another word, I want to set it globally, I can’t find a solution with Camunda Java API that let me able to do this.
Hi @Amine_Safi,
Variables defined in process instance level are accessible from within all embedded scopes including sub-processes.
Below docs might be of help to you
This does not apply to processes started via a “call activity”. In that case, variabled must be passed explicitly.
Hi @fml2,
Exactly, this only applies to expanded sub-processes as call activities create new separate process instances of the called definitions so variables need to be passed explicitly in that case.
If I understood correctly, it is not possible to use shared variables between a process and a sub-process and I need to pass them explicitly in the BPMN using In/Out mapping.
Thanks.
Hi @Amine_Safi,
This is true if you are using call activity
But if expanded sub-process is used then process instance variables are accessible from within the sub-process