Local variables for external tasks in multi-instance subprocess

Hello,

I’ve found a solution to change the scope for a local variable set with the complete rest call .
The complete has localVariables, but the scope seems to be only the external task and not the sub-process.

By attaching a listener on the end event for the service task I invoke the following code:
var localVariable = execution.getVariable(“aVariable”);
execution.setVariable(“aVariable”, localVariable ,“subprocessId”);

This will change the scope to the mentioned sub-process.
It works, but I have to make a listener for each external task that sets variables inside the sub-process.

Is there a better way to do this?

Best regards,
Cosmin

2 Likes