Command Conditions

In some cases, you might have to run a different set of commands depending on the context of execution. You can use conditional commands to achieve this flexibility. The Condition field for a command is used to define the situation under which the associated command steps execute.

Conditions are evaluated as boolean expressions. If the expression evaluates to true, the command is executed. If false, the command is skipped and the next command is evaluated. If no condition is specified, the command is always executed. The syntax of a condition is identical to the WHERE clause of a SQL statement, which allows enormous flexibility when evaluating scenarios. Table 5-7. Example conditions lists some example conditions.

Note: Be sure to place single quotes around string literals or tokens used to evaluate strings.

Table 5-7. Example conditions

Condition

Evaluates to

BLANK

Command is executed in all situations.

`[P.P_VERSION_LABEL]' IS NOT NULL

Command is executed if the parameter with the token P_VERSION_LABEL in the package line is not null.

`[DEST_ENV.ENVIRONMENT_NAME]' = `Archive'

Command is executed when the destination environment is named "Archive."

`[AS.SERVER_TYPE_CODE]' = `UNIX'

Command is executed if the application server is installed on a UNIX® machine.

The condition can include tokens. For detailed information about using tokens, see the Commands, Tokens, and Validations Guide and Reference.