Designing and Implementing Composite Applications : webMethods CAF and OpenCAF Development Help : Developing CAF Applications : Setting Environment Variables
Setting Environment Variables
Environment variables are variables you can add as default values in a web application. The environment variable values are used at run time, but the server administrator can alter them as needed. You can use environment variables to customize the behavior of a web application, either to display a value or use it in a binding expression.
Unlike application initialization parameters, environment variables enable you to use primitive and object data types, and to share these variables with other web applications. For more information about application initialization parameters, see Setting Application Initialization Parameters.
Note:  
For primitive data types, you can specify a default value, and change it at run time either programmatically or manually, as an administrator. You must programmatically put object data types in to the JNDI tree.
Environment variables operate in the Java Naming and Directory Interface (JNDI) environment. While use of JNDI is widespread in application servers, you should make sure a specific application server supports JNDI before attempting to deploy a web application that uses environment variables. The current web application, or another application, can programmatically update environment variables providing a way to share services between web applications in the same container.
Common configuration parameters to define as environment variables are anything that might differ for an application deployed in different environments, for example, variables that will have separate values for development, staging and production environments. When you add a web service connector, doing so automatically adds common web service configuration values such as endpoint, user name, and password to the application environment variables.
To create an environment variable for a web application
1. In the UI Development perspective, click the Solutions view, expand the User Interfaces folder, expand the project, and then expand the WebContent folder that contains the web application views.
2. Double-click the view you want to work with to open it in the editor.
3. In the Bindings view, expand Implicit Variables > Environment Variables to view the existing environment variables.
4. Right-click Environment Variables and click Add > Data.
5. In the Add New Property dialog box, type a name for the environment variable in the Property Name field.
6. In the Property Type field, type a primitive or object data type, or click the Browse button to select an existing data type.
7. Click an option to specify if the data type is to be scalar, a modifiable list, or a read-only array and then click Finish.
The new environment variable appears in the Bindings view under the Environment Variables node.
8. In the Bindings view, select the newly created environment variable property.
9. In the Properties view, click the Data Binding tab.
10. On the Data Binding tab, in the Value field, type a variable for the property.
11. Save the web application project.
You can drag the new environment variable property from the Bindings view to a control on the design canvas to bind the control to the property.
Copyright © 2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback