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 Workflow 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
-
Open the appropriate process application or toolkit in IBM® Process
Designer. Alternatively you can select
Process App Settings from the drop-down list on the toolbar in Process Designer.
-
In the Process App settings editor, click Environment Variables.
-
Click + to add a new variable. If you are using the desktop editor,
click Add.
Tip: To copy a variable from other process applications or toolkits, click
Import an environment variable. This is an easy way to add environment
variables that are referred to by artifacts copied or moved from other applications or
toolkits.
- 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
- 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.
- 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
Automation Workflow uses
the default value.
- 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
-
If you want to remove an environment variable, click the cell of the variable and then click
X. If you are using the desktop editor, click
Remove.
What to do next
Environment variables are also used to configure server connections for IBM ODM 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 Designer
view, as described in the topic Adding a server configuration.