Setting environment variables

Set environment variables to ensure that process implementations use correct values in each deployment environment.

About this task

Each process application and toolkit created in the Process Center repository includes environment variables. You can set these environment variables to ensure that your process implementations are using correct values, whatever environment you deploy to or whatever change occurs at run time in the environment. Suppose your process includes an implementation that requires the port number for an external application. By using an environment variable, you can set the port number for each environment in which the process will run. Plus, administrators can verify and adjust environment variable values from the Process Admin Console after a process application is installed.

To set environment variables:

Procedure

  1. Open the appropriate process application or toolkit in the Designer view. You will see the Settings view when you first click Open in Designer from a newly created process application or toolkit in the Process Center. Alternately you can select Process App Settings or Toolkit Settings from the drop-down list on the toolbar in Process Designer.
  2. In the settings editor, click the Environment Variable tab.
  3. Click Add to add a new variable.
  4. Click the <NEW VARBL> placeholder in the Key cell, type the name of the new environment variable, and press Enter. Environment variable names must be valid JavaScript identifiers (they must begin with a letter or a '_' and can contain only letters, digits or the '_' character). The following examples are all valid names: ecmsystem_port , ecmSystem_port , and ecm_system_port
  5. Click the Default cell for the newly entered variable, type in a value, and press Enter. If you do not provide values for the other environments, the default value is used for all environments.
  6. If you know the value for the Development, Test, Staging, or Production environment, click the appropriate cell, type in the value, and press Enter. If you do not know the appropriate value for each environment, you can leave the setting blank and an administrator can provide the correct value after installation. If you do not provide a value for an environment and an administrator does not provide a value after installation, IBM® Business Process Manager uses the default value.
  7. To use one of the preceding variables in a script in the current process application, you can simply use the variable key preceded by tw.env. For example, to set the value of a process variable to an environment variable in a JavaScript, you can type: "tw.local.port = tw.env.ecmsystem_port" If the environment variable you want to use in your script is in a toolkit, you can precede the variable key with tw.env.toolkit.[toolkit_acronym]. So, to use the same environment variable from a toolkit with an acronym of BA, you can type: "tw.local.port = tw.env.toolkit.BA.ecmsystem_port"
  8. If you want to remove an environment variable, click any cell to remove it and then click Remove.

What to do next

Environment variables are also used to configure server connections for ILOG Rules Server, IBM Content Integrator Server, IBM Case Manager Server, and Enterprise Content Management (ECM) Server. However, the environment variables are automatically set when you create a server configuration in the Settings page of the Designers view, as described in the topic Adding a server configuration.