Variables are defined for a particular element, such as, module, process, sub-process, expression, form, etc. Depending on this element, we distinguish the following:
Global variables, or module variables are available throughout the entire model, that is, anywhere from its parent module and from any module that imports it, unless the access is restricted by their visibility.
They are defined in a variable definition file, a module resource file. One module can contain multiple variable definition files; however, the variable names even if in different files must not be identical.
To define a new global variable, do the following:
In the Initial Value text box specify the initial value of the variable: Type the initial value as an expression in the Expression Language directly into the Initial Value field. If no initial value is specified, the value is set to null
.
Click Edit to open the Value Dialog dialog box.
myGlobalVariable := "string variable value"
Important: Global variables are instantiated in the order they are defined in. Therefore, if you want a variable to use another variable from the same file in its initial value, make sure the variable is defined below the initialization variable.
These variables are defined on Forms, Processes and some of their elements, that create their own context, that is Processes, Plans, Sub-Processes, forms, and model update Processes.
To define such local variables, right-click the element in the Outline view, and go to New -> Variable.
In expressions, you can define local variables as def <TYPE> <VARNAME>
. Since each property definition, such as, goal condition, event duration, initial value, etc. represent an expression block, it can define its local variables.