What do local variables represent in Camunda?

Can someone tell me what do local variables refer to in Camunda? For example, I can send variables with Signal Throw Event, but there is also a checkbox with the name Local which I don’t get. I’ve read the docs, still, it is not clear to me. Can someone give an example that could actually help me?

Hello @stefanpg ,

local refers to the scope of variable visibility/existance. The principle can be compared to scopes in a servlet appliation.

Default scope is the global scope. A variable living there will be available in the whole process.

The local scope only applies on the current activity. If you want to use it after the activity is ended, you can use the output mapping of the activity.

The variable will then be exported to the parent activity scope.

This can be great for reusable implementations like delegates or External Workers who set variables with a name. You are then able to determine the name of the variable for yourself. It can also be great to keep your variables clean if you want to save a variable that is only relevant for an activity for example.

Another use case is a multi-instance subprocess that can carry different variables with the same name for each instance without overriding each other.

The variable list of a process instance in the cockpit has a column for the scope. If you are interested, you can play around there.