Interactions between env and server values

Suppose that you define three environment-specific parameters with at most either a server attribute value or an env attribute value but not both. Thus:
  • The first version of the parameter contains a server attribute value only.
  • The second version of the parameter contains an env attribute value only.
  • The third version of the parameter contains neither a server attribute value nor an env attribute value.
PolicyCenter processes server startup options against the parameter versions in the following manner:
  • If the runtime env value resolves to a value that the parameter env attribute expressly specifies, PolicyCenter uses that version of the configuration parameter.
  • If the runtime env value does not resolve to the env value of a configuration parameter, PolicyCenter applies the first corresponding parameter setting in which the runtime server attribute resolves to a known value.
  • If neither of the two attributes resolves to known values, PolicyCenter applies the parameter setting corresponding to the parameter with neither a server attribute value nor an env attribute value.
The following code provides multiple definitions for the same configuration parameter.
  • <param name="BusinessDayStart" value="7:00 AM" env="test, test2, …" />
  • <param name="BusinessDayStart" value="8:00 AM" server="#batch, ui" />
  • <param name="BusinessDayStart" value="9:00 AM"/>

Keep these parameter definitions in mind as you consider the following examples.

Example 1

Suppose that you start the server with the following command:
  • gwb runServer -Denv=test

In this case, PolicyCenter starts the application server and sets the value of configuration parameter BusinessDayStart to 7:00 a.m.

Example 2

Suppose that you start the application server and set both the environment and the server role to the following values:
  • gwb runServer -Denv=test -Dserver=#batch

In this case, PolicyCenter still sets BusinessDayStart to the 7:00 a.m. value as the environment value is the controlling factor.

Example 3

Suppose that you start the application server and set the server value only:
  • gwb runServer -Dserver="#batch"

In this case, PolicyCenter sets BusinessDayStart to the 8:00 a.m. value.

Example 4

Suppose that start the application server and set neither an env value or a server role (server) value. In this case, PolicyCenter sets BusinessDayStart to the 9:00 a.m. value.

Example 5

Suppose that you define a parameter with both env and server attribute values. In such a case, PolicyCenter applies the corresponding parameter setting if both the env and the server attributes resolve to known values. For example, specify the BusinessDayStart parameter as follows:
  • <param name="BusinessDayStart" value="9:00 AM" env="test" server="ui" />
  • <param name="BusinessDayStart" value="8:00 AM" />

Consistent with this code, PolicyCenter sets BusinessDayStart to 9:00 a.m. if env resolves to test and server resolves to ui. Otherwise, PolicyCenter sets BusinessDayStart to 8:00 a.m.

Note: You cannot use multiple <param> elements that share common values for both the server and env attributes. The value or values of at least one of the attributes must differ.

For a list of configuration parameters, including information about which parameters can be set by environment, see Application configuration parameters.

See also