cancel
Showing results for 
Search instead for 
Did you mean: 

Clearing the execution variables before completing the task

nirvana
Champ in-the-making
Champ in-the-making

Hi,

I'm setting the few variables in serviceTask before starting the userTask. On some condition in the flow I want to clear the delegateExecution variables and set the new one's.

Ex : execution.setVariable("name","Jhon");

how do I clear this ?

even If I'm overwriting it I'm only getting the previously set value.

Tried removing the variables with execution.removeVariables() and removeVariablesLocal() but no luck.

Can anyone help me out…

Regards,
Nirvana.
4 REPLIES 4

jbarrez
Star Contributor
Star Contributor
removeVariable should do the trick. Where are you calling this code?

nirvana
Champ in-the-making
Champ in-the-making
Thanks for the reply.

I'm using this in ServiceTask - JavaDelegate.execute() method before completing the task.

nirvana
Champ in-the-making
Champ in-the-making
Thanks for the reply.

I'm using this in ServiceTask - JavaDelegate.execute() method before completing the task.

frederikherema1
Star Contributor
Star Contributor
Setting variables from within a service-task should just work. Make sure you're using the right scope - setVariableLocal() and setVariable() are different. Local set a variable on the local execution, the latter will set the variable higher in the execution-tree (most of the times, on process-scope).