Wen setting a variable, I can either set it in a local scope or in the global (usually process instance) scope.
There are many usecases where the global scope is not appropiate (multi instance, ...)
There are also many usecases where the local scope is not appropriate (for instance if a task is a scope, local variables will destroyed at the end of the scope).
What we are looking for is a solution which allows users to specify the target scope for a variable with greater flexibility.
One possibility would be to add a "targetScope" attribute to output mappings which allow users to provide the id of a parent activity.
Users could then set variables "local" and map them to the correct scope using the mapping.
Note that not all operations currently allow users to pass local variables:
- Message correlation
- resultVariable attribute for service tasks
There may be other solutions, input is welcome.