What are local variables?

Hi @Amir_Roshan ,

personally I did not know of any automatic clean up of local variables. As far as I know there is no difference in the variable lifetime depending on its scope. Obviously all runtime data will be deleted on execution or activity instance end. Please correct me, if I am wrong, @WilliamR.Alves .

Also “global variables” updated via setVariable are global in context of the root process instance and all its child executions.They are not available across multiple root process intances.

To me, the only difference between, setVariable and setLocalVariable and respectively global or local variables is as follows:

  • Global variables are available throughout all executions and activity instances within the root process instance as global variables
  • Local variables are available to its execution or activity instance as local variable
  • Local variables are available to all child executions and activity instances as global variable

For some illustration check out my post here: LocalVariable API not work

In consequence local variables aim to not pollute the global variable scope and are useful as temporary variables for some local calculation or parameters for sub executions or activity instances.

Kind regards
Adagatiya

2 Likes