Pass variables from SubProcess to a task


#1

I have a sub process wich has 3 end event.
I set the same variable on this end events like the above


then on the execute method, I tried to get the value

    String status = (String) execution.getVariableLocal("leaveStatus");

But this doesn’t work. I got null as a value

Any ideas?

Thanks


#2

maybe you can try this

String status  = (String) execution.getVariable("leaveStatus");

#3

I tried it. It returns nul pointer exception


#4

You set variable in a sub-process scope so this variable is not visible outside sub-process. Consider using signals in order to determine which exit condition you reach within your sub-process. Here is a simple example of mentioned approach SignalTest.bpmn (10.8 KB)