LSPS documentation logo
LSPS Documentation
Variables

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 Variable

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:

  1. In the GO-BPMN Explorer, double-click the respective variable definition.
  2. In the activated form-like Variable Editor, click Add.
  3. In the Name text box, type the variable name.
  4. In the Type text box, type the data type of the value that the variable is going to store.
  5. Define the variable visibility:
    • Select the Public checkbox to make the variable available to the importing modules.
    • Clear the Public checkbox to make the variable private (available only within the Module).
  6. 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.

  7. To use the variable in an expression, enter the variable name; for example, to assign a value to a variable: 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.

globalVariableDefinition.png
Editing variable definitions

Process, Forms, and Sub-Process 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.

Local 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.