Remove Variable via Groovy script used into Modeler

Hi guys,
I need to remove always the process variable when start an execution. I’d like to remove it from BPMN and not delegare removing to developer into listener or delegate.

I’d like to create a Groovy listener into Camunda Modeler. Is it possible?

Thanks

Hi,

The short answer is yes;

In modeller, select the BPMN element where you want the process variable removed.
In the properties panel select the listener tab.
Add a listener and select the trigger (start, end) from the event type.
Change listener type to script and set the script format to groovy
Set the script type to inline script

Then in the script text box enter your script such as;

execution.removeVariable(“myVariableName”)

Is this what you mean, or do you want to actually model the removal of the process variable as a BPMN task. If that were the case you could use a script task again with inline groovy similar to above.

regards

Rob

2 Likes

PErfect. It Works. Thanks a lot