AnsweredAssumed Answered

setVariable makes the variable local to a task?

Question asked by lmollea on Feb 20, 2014
Latest reply on Feb 20, 2014 by lmollea
Hi all,

I have a process with two task (A and B) in sequence. When task B completes, there are two possible routes based on value of a process variable (X). If X has a certain value, then the process continue, else it goes into a signal catching event which will loop back the process into task A again when the signal is raised.

Task B sometimes sets a value of another variable (Y). The subsequent execution of task A always find the value of variable Y unchanged.

Is that the expected behaviour?

To set the value of variable Y, in Task B (a ServiceTask) I call setVariable(String, Object) on the DelegateExecution context.
Should I instead use
DelegateExecution.getEngineServices().getRuntimeService().setVariable(executionId, variableName, value)
to achieve this?

Using Activiti 5.14