Global variables are used for mapping source elements, mapping functions or constants to target elements. They are declared and used globally for all target elements.
To use a global variable in a mapping activity, you need to map it to a target element. This will successfully execute the global variable when you execute the mapping activity in the process flow.
A global variable differs from a context variable, in the respect that it is available only within the selected mapping activity. Context variables are available in the process designer too.
...
Steps to declare a Global Variable
- Ensure that the source and destination layout are loaded and all their elements are listed under their respective nodes.
- Click the Add Parameters icon and select Variables to display Create New Variable tab.
Select Global Variables to enter the details of global variables.
- Enter the name of the global variable you want to create (e.g. emp_age). Press the Tab key. This takes the control to the Global Variable Value field.
- Enter the value of the global variable in the Global Variable Value field. You can enter the value of the global variable using one of the listed methods:
- Click required source element
- Select the required Mapping function
- Type the required value manually
Select a Custom Method
Info To select a Custom Method as the value of a global variable, click the Custom Method in the Parameters Panel. To learn how to declare a Custom Method, refer to section Using Custom Method. Enter comments for the global variable in the Comment field. For example, if the global variable value contains complex XSLT logic, you can enter its description in this field.
Click Save button to save the global variable. This global variable is added to the list of existing variables in the Global field. It is also displayed under Global Variables in the Parameters Panel.
...
Once you have created a global variable, you can map it to a target element.