Global Variables (Magic xpi 4.5)
Global variables are available to all flows in the same project that share the same memory address. Changes made to a global variable, in any flow, affect the variable in all flows where it is used. These variables are used in the same way as flow variables.
Since global variables are shared by all servers belonging to the same running project, these values are stored in the Space and not in each processes' memory.
You can use global variables to manage flow logic and data transfer between components for every flow in a project.
Best Practices
|
![](/PublicKnowledge/servlet/rtaImage?eid=ka2D0000000TfXw&feoid=00ND0000005rAjf&refid=0EMD0000000J7QZ)
|
Initialize global variables with values saved as environment variables at the beginning of your project.
|
|
![](/PublicKnowledge/servlet/rtaImage?eid=ka2D0000000TfXw&feoid=00ND0000005rAjf&refid=0EMD0000000J7QZ)
|
Use global variables instead of environment variables throughout the project for better performance.
|
|
|
|
|
G.sys.ServerInstance
|
A unique Magic xpi server ID given by the Space.
|
Numeric
|
5.0
|
G.sys.ComponentLogging
|
Use this variable to dynamically control the component logging. This variable overrides the C.sys.ContextLogging variable setting. When both variables are set to True (the default), logging behaves as defined in the component's Logging tab.
|
Boolean
|
1
|
To create global variables:
-
Under the Solution Explorer's Repositories folder, double-click Global Variables to open the Global Variables repository. Alternatively, you can open the Global Variables repository by pressing SHIFT+F7.
-
Click Add to create a new line in the list.
-
Define the variable's properties. For a full description of these properties, click here.
-
When you have entered the relevant properties, click Save.
-
You can remove variables by parking on the relevant line and clicking Delete, followed by Save. Before deleting an entry, you should make sure that it is not used in other places in your project. You can do this by running the Find Reference utility.
Note:
|
You cannot add duplicate names to the Global Variables repository, and the name field cannot be left empty.
|
Flow Variables
Business Process Variables
Context Variables