cancel
Showing results for 
Search instead for 
Did you mean: 

process variables and their scope

heymjo
Champ on-the-rise
Champ on-the-rise
Hi,

We have a process hierarchy with about 6 levels of nested call activities, and in the lowest level we would need access to a process variable that is created when the process is started so on the very top level. Am i right that our two options are

1) pass the process variable all the way along from callactivity to callactivity using <activiti:in source="param1" target="param1"/>

2) create a listener that automatically propagates the needed parent variables to the child callactivity

In fact we found it slightly surprising that variableScope.getVariable stops recursing when the current process boundary is reached, but maybe that's just our limited understanding of how bpmn2 process variables and their scope works.

Thanks
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
Call-activities are indeed the "boundary" for traversing up the tree of variables. When using regular subprocesses, these boundaries aren't there and you can access top-level variables from the bottom-level scope. That's the way it's intended to work in activiti.

So you're be using in/outs or the listener-approch, indeed…