cancel
Showing results for 
Search instead for 
Did you mean: 

Share variables between workflows

ojaro
Champ in-the-making
Champ in-the-making
Hi all,

I am new to activiti and starting to get into scripting. Does anyone know if it is possible to define a global variable that can be used between workflows somehow?

I am using the Eclipse plugin.

Regards,

Olli
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
You mean sharing a variable between multiple process-instances? This is not possible using activiti-variables, however, you can always use a static/singleton containing the values you want to share and hook it into the ExpressionManager of activiti (for example, by adding it to the "beans" map in processEngineConfiguration). If you do this, you can reference the "shared" variables from within expressions in your process-xml, e.g: "${globalVariables.get("someFlag" == true}".

If you want to have the global variables persisted, you'll have to handle this yourself. You can always leverage the existing transactions of activiti if required.