Designer 10.7 | webMethods Service Development Help | Mapping Data in Flow Services | About Assigning Values to Pipeline Variables | Assigning Global Variables to Pipeline Variables
 
Assigning Global Variables to Pipeline Variables
A global variable is a key/value pair that you define using Integration Server Administrator. You can use a global variable in a flow service by assigning the global variable to a variable in the pipeline (specifically a variable in Service In or Pipeline Out). At run time, Integration Server uses the value of the global variable as the value of the pipeline variable.
Using global variables makes it easy to change the value assigned to a pipeline variable at run time or after you deploy a solution to a different Integration Server. Instead of changing the hard-coded value of a pipeline variable, you change the value of the global variable. For example, you could create global variables for the connection parameters required by pub.client:ftp service. You might create global variables for the FTP server name, a user on the FTP server, and password for that user. In flow services that invoke pub.client:ftp you could assign the global variables to the serverhost, username, and password input parameters. After deploying the flow service to different servers, you may need to use different values for the serverhost, username, and password input parameters. You can use Integration Server Administrator to change the value of the global variables on the target servers. This is more efficient than editing the services to change the hard-coded values.
Keep the following points in mind when using global variables in flow services:
*You can use global variables to specify values for variables of type String, String List, and String Table only.
*To specify a global variable as the value for a pipeline variable, you enclose the name of the global variable in % symbols (for example, %myFTPServer%).
*You must select the Perform global variable substitution check box for the variable substitution to occur at run time.
*If the specified global variable has the same name as a pipeline variable name and you select the Perform global variable substitution check box and the Perform pipeline variable substitution check box, Integration Server uses the value of the pipeline variable at run time.
*If the global variable that you specified for performing a variable substitution is not defined in Integration Server, at run time Integration Server throws an exception and service execution fails.
*You can mix literal and global variables. For example, if you specify (%areaCode%) %Phone%, the resulting String would be formatted to include the parentheses and space. If you specify %firstName% %initial%. %lastName%, the period and spacing would be included in the value.
*You can assign a pipeline variable a value comprised of a global variable and a pipeline variable. For more information, see Assigning String Variables and Global Variables to the Same Pipeline Variable.
For more information about defining global variables, see webMethods Integration Server Administrator’s Guide.