Global variables provide an easy way to set defaults for use throughout your project. At deploy time, you can override default values as needed. When the project is deployed all occurrences of the global variable name are replaced with the provided global variable value.
For example, you could assign the value 7474 to the global variable RvDaemon. You can then use the variable in a Rendezvous Transport resource. You can also override the value at deploytime. This section explains how to add global variables, and how to use them in project fields at design time.
In a new Studio project no global variables are predefined. When you import a project from an earlier version of BusinessEvents, however, you see predefined global variables such as the following (as well as any others defined in the project).
|
|
|
|
|
|
|
|
|
If checked, the variable is visible and settable when deploying using TIBCO Administrator. The values set at that time are saved in the project that TIBCO Administrator creates from the provided EAR file.
|
|
If this box is checked, the value of the global variable can be overwritten by defining the same variable in a properties file. At runtime, the value in properties file overrides the value set using the Global Variable editor.
For example, in the Global Variables editor you define a property jmsHostName and give it the value test-dt. At deploy time you enter a different value in the properties file, for example, jmsHostName=prod-dt, and you reference that file when deploying using the -p option.
For use when deploying with TIBCO Administrator. Used only when Deployment Settable is also checked (ignored otherwise). Used to include or exclude service-level global variables when building the EAR file.
If checked, the variable is included when the Include all service level global variables option is selected when building the enterprise archive file.
In TIBCO Administrator, a service corresponds to one PAR (for TIBCO ActiveMatrix BusinessWorks) or one agent (for BusinessEvents).
Values set at the service or service instance level are passed to the engine at runtime in the format tibco.clientVar. VariableName=value.
|
|
|
|
Optional. For String and Integer types, allows you to provide a range of allowed values. The constraint field for Strings is an enumeration, for example, one, two, three. The constraint field for Integers is for a range, for example, 1-100.
|
|
|
To use a global variable as the value for a project setting, drag it from the list of variables into the text box for the setting, or enter it manually using the syntax
%%Variable_Group/Variable_Name%%. You must include the global variable group hierarchy, if one exists. For example, to use a caching scheme global variable in a File Path field, you might enter
%%Cache/CachingSchemeLoc%%.
Where myvars/Hostname is the name of the variable group and variable, and Localhost is an optional literal value to use if the variable is not found.
You can add global variable override properties in the Cluster Deployment Descriptor editor. Add properties called tibco.clientVar.
GVName and provide the override value as the property value. Place the property at the appropriate level in the CDD: cluster, processing unit, or agent class.
You can also override variable values when starting an engine directly at the command line. You can pass the overrides directly, using the
--propVar option, or in a file, referenced using the
-p option.