Set environment variables to ensure that process implementations
use correct values in each deployment environment.
About this task
Each workflow
automation and toolkit 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 runs. 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 workflow automation or toolkit in the designer and click Environment
Variables.
-
Click + to add a new variable.
Tip: To copy a variable from other workflow automation 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 workflow automation 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 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, the default is used.
-
To use one of the preceding variables in a script in the current workflow automation, you can 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
-
To remove an environment variable, click the cell of the variable and then
X.