ProcessMIX User Guide
Categories

Global Variables

Updated on October 10, 2023
Print

The Global Variables component allows you to define constants available in different parts of the system. These variables are set outside of any function. The scope of a variable is determined by you and indicates if it can be accessed within the system or not.

With Global Variables, you can save and transfer data between different components of the system, providing centralized access to this data.

There are two types of Global variables in the system — Variables and Passwords.

Variables — can store different types of data with the ability to configure the availability of their use in flows.

Passwords — used to store passwords, secret keys or other confidential information.

How to add Global Variables?

To add a new Global Variable, click on the Global Variables icon located in the left vertical panel of the IDE. The system displays the Global Variables pop-up window with an active Variables tab. Within the pop-up, select your desired tab (Variables or Passwords) and click on the Add button in the Name field.

Note:

When creating a variable, it’s recommended to assign a name that corresponds to its intended purpose for future use.

For Variables:

Enter a name for a variable, select a data type, and provide a value. You can also check the “Accessible in flows” checkbox if needed (this checkbox is disabled by default). The new variable will then appear in the list.

Supported data types for Variables:

  • Boolean — “true” or “false” value.
  • String — text, for example, “John Doe”.
  • Integer — number, for example, “38”.
  • Float — floating-point or decimal number, for example, “0.1234”.

For Passwords:

In a pop-up window, enter a name and a value for a variable. Click on the Add button. A variable will appear in a table.

Supported data types for Passwords:

  • String — text, for example, “John Doe”.

Click the CONFIRM button. New Global Variables are saved in the system and are ready for use.

How to work with Global Variables?

You can use Global Variables when creating flows, deployments, configuring connectors, and other system components. For example, they can be used to store the URL for the database connector.

IDE:

The availability of variables in the IDE depends on whether the “Accessible in all flows” checkbox was enabled when the variable was created:

  1. Accessible in flows is checked.
    You can use a variable in expressions when creating flows. Variables are available for selection in a list of variables within the Expression Editor (on the left panel).
  2. Accessible in flows is unchecked.
    You cannot use a variable for creating flows. Variables are available for selection in connector settings.

The Passwords variables are not available for creating flows in the IDE. Passwords are available for selection in connector settings.

HOME:

Global Variables are used in HOME during the deployment creation process to determine a set of variables that will be available during the deployment process.

The administrator can change a variable’s value during the deployment process in Step 3 “Global Variables”. To change value, click on the New value field and enter the desired value. If the value of the variable is not changed, the default value set in the IDE will be used.

Note:

You should remember that changing the value of a variable can affect the functioning of other parts of the system that already use this variable.

Operations with Global Variables

  • Add — allows you to add a new global variable.
  • Clone — allows you to create a clone of a global variable. The cloned variable has a name as a Name of the global variable + Clone(n).
  • Delete — allows you to delete a global variable.
  • Editing or simply clicking on the name and the value — allows you to change the name and the value of a global variable by clicking on the Name and Value field.
  • Selection of a data type — allows you to change the type of a global variable.

Overriding Global Variables

You can override the values of Global Variables for projects uploaded using export artifacts (for example, JAR, WAR) when working with it.

Global Variables can be overridden at several levels with different priorities.

Priority (variables naming)

1 Predefined variables that can be used in some ProcessMIX connectors:

For example:

DB Connector
project.connector.<connector name>.connection.jdbcUrl
project.connector.<connector name>.connection.username
project.connector.<connector name>.connection.password

REST Connector
project.connector.<connector name>.connection.baseurl

2 For other variables and EVM Blockchain connector.

For example:

prmix.project.var.<project id>.<variable name>

Note:

The ProcessMIX uses the Spring mechanism of defining properties.