Global variables
Global variables are set at the level of the configuration file and are shared between all processes and tasks.
To refer to a global variable, for example in a variable task property (see: About Tasks), use its name preceded by "global." and surrounded by curly brackets, for example: %{global.myGlobalVariable}
.
Global variables are generally used to keep information that applies to multiple locations but needs to be changed easily. For example, a lot of users use them to set a server's IP, a printer name, or folder location that is used by multiple processes. This is useful when moving the configuration file to another installation of the Workflow tools where this information is different, or to quickly modify specific information if something changes on the server. You can have as many global variables as you want in any given configuration.
Adding a global variable
To add a global variable from the Configuration Components pane:
- Right-Click on Global Variables.
- Click Insert, then Insert Global Variable.
The new variable will appear asGlobalVar
orGlobalVarX
(the name is automatically incremented).
To add a global variable from the Ribbon:
- Click on the Home tab of the Connect Workflow Ribbon:
- Click Global Variable in the Variables group.
The new variable will appear asGlobalVar
orGlobalVarX
(the name is automatically incremented).
To set the value of a global variable from the Configuration Components pane:
- Double-click on the global variable in the Configuration Components pane. (Right-clicking then clicking Properties also works.)
- Enter the new value for your global variable.
- Click OK to save the new value.
Deleting a variable
- Right-click on the variable name in the Configuration Components pane and click Delete.
Note: Deleting a variable does not delete any reference to it. In both the case where a script refers to a variable and it is renamed, and the case of deleting a variable, any task or script that refers to it will cease to function and will generate an error.
Renaming a variable
- Right-click on the variable name in the Configuration Components pane.
- Click Rename.
- Type in the new name of the variable, then press Enter on your keyboard.
Note: While renaming a variable will correctly rename all references to it in task properties or wherever else it is used in a task, it will not change the references in any script within a Run Script task.
Setting a variable value within a process
You can set the value of a variable within your process in two ways:
- Use the Set Job Info and Variable action task. See Set Job Infos and Variables.
- You can use Scripts. See the chapter Using Scripts.
Tip: Variables may be used as variable properties in Task Properties (see Variable task properties).