Configuring runtime environment variables

During development, process authors can set environment variables for each process application. In some cases, the correct value for a particular environment (test or production) might not be known during process design. In those cases, you need to provide the value after installing the process application in the new environment.

You can use the Process Admin Console or REST API calls to manage environment variables.

Using the Process Admin Console

  1. Log in to the Process Admin Console, and then click Installed Apps to show the list of current snapshots on the server.
  2. Click the snapshot that you want to work with.
  3. From the menu bar, click Environment Vars.
  4. For the variables listed, provide a value or ensure that the value shown is accurate for the current server. If no variables are listed, no variables were established during process development.

Using a REST API call

Call the operations REST API ACTION: https://hostname.automationcloud.ibm.com/environment/ops/std/dba/containers/container_acronym/versions/version_acronym/env_vars or REST API ACTION: https://hostname.automationcloud.ibm.com/environment/ops/std/dba/containers/container_acronym/branches/branch_acronym/env_vars where
  • container_acronym is the acronym of the application or toolkit that contains the targeted snapshot, version_acronym is the acronym of the targeted snapshot, and branch_acronym is the acronym of the targeted track.
  • environment has the value dev for the development system, test for the test system, or run for the production (runtime) system.
Important: For details about the operations REST APIs and to try invoking them from a browser, use the Swagger interface. The Swagger interface is available at https://hostname:ops/explorer where hostname is the is the name of your offering subscription, for example, https://vhost123.mycloud.com/ops/explorer.
The following examples illustrate how to use the REST API to manage environment variables.
  • Retrieve a list of environment variables for snapshot S1 of process application APP1:
    GET http://host:port/ops/std/bpm/containers/APP1/versions/S1/env_vars
  • For process application APP1, snapshot S1, set the environment variable DEBUG to the value of true:
    POST http://host:port/ops/std/bpm/containers/APP1/versions/S1/env_vars
    {
      "pairs": [
        {
          "name": "DEBUG",
          "value": "true"
        }
      ]
    }
    
  • Copy the environment variable from snapshot S1 to snapshot S2 of process application APP1:
    POST http://host:port/ops/std/bpm/containers/APP1/versions/S1/env_vars/sync?target_version=S2
  • For the tip snapshot of track T1 of process application APP1, set the environment variable TRACE to the value of true:
    POST http://host:port/ops/std/bpm/containers/APP1/branches/T1/env_vars
    {
      "pairs": [
        {
          "name": "TRACE",
          "value": "true"
        }
      ]
    }
    
Important: All calls to the Operations REST API require that the HTTP header BPMCSRFToken is set with every request. For information about how to obtain a token, see Preventing cross site request forgery.