Using Commands

Commands are at the heart of the execution layer within PPM. They determine which actions are executed at specific workflow steps. Actions performed at workflow steps can include file migration, script execution, data analysis, field behavior, or code compilation. The following PPM entities use commands:

  • Object types

  • Request types

  • Report types

  • Validations

  • Workflow step sources

  • Special commands

Object Type Commands and Workflows

Object type commands are tightly integrated with the workflow engine. The commands in an object type are executed at execution workflow steps in Deployment Management package lines.

Keep in mind the following concepts regarding command and workflow interaction:

  • To execute object type commands at a given workflow step, configure the workflow step as follows:

    • Make the workflow step an execution type step.

    • Set the following parameter values:

      • Workflow Scope = Packages

      • Execution Type = Built-in Workflow Event

      • Workflow Command = execute_object_commands

  • When the object reaches the workflow step (Workflow Command = execute_object_commands), all object type commands with conditions satisfied are run in the order in which they are listed on the command field for the object type.

  • You can configure the object type to run only certain commands at a given step. To do this, specify command conditions. For information about how to specify command conditions, see Command Conditions.

Request Type Commands and Workflows

Like object type commands, request type commands define the execution layer within Demand Management. While most of the resolution process for a request is analytically based, cases may arise for specific request types for which system changes are required. In such cases, you can use request type commands to make these changes automatically.

Request type commands are tightly integrated with the workflow engine. The commands in a request type are executed at execution workflow steps. Keep in mind the following concepts regarding the interactions between command and workflow:

  • To execute request type commands at a given workflow step, configure the workflow step as follows:

    • Make the workflow step an execution type step.

    • Set the following parameter values:

      • Workflow Scope = Requests

      • Execution Type = Built-in Workflow Event

      • Workflow Command = execute_request_commands

  • When the request reaches the workflow step (Workflow Command = execute_request_commands), all commands with all conditions satisfied are run in the listed order in which they are listed on the command field for the request type.

  • To set up command conditions so that the request type runs only certain commands at a given step, specify command conditions. For information about how to specify command conditions, see Command Conditions

Special Commands

Object types, request types, report types, workflows and validations all use commands to access the execution layer. To simplify the use of command executions, PPM provides a predefined set of special commands.

Special commands are commands with variable parameters, and are used in object type, request type, report type, workflow, and validation command steps. These command steps perform a variety of functions, such as copying files between environments and establishing connections to environments for remote command execution.

PPM features the following two types of special commands:

  • System special commands are shipped with PPM. System special commands are read-only and have the naming convention ksc_command_name.

  • User-defined special commands have the naming convention sc_command_name.

Special commands act as modules that you can reuse. It it often more efficient to create a special command for a program that you can reuse than to place an individual command into every object type or request type that requires it.

Note: For more information about special commands, see Using Special Commands.

Command Language

The command steps in a command define the system-level executions that must be performed to realize the command function. Command steps can be UNIX commands, third-party application commands, or special commands. Special commands are reusable routines defined in PPM.

PPM also supplies several system special commands that you can use to perform common events (such as connecting to environments or copying files).

Note: For more information about special commands, see Using Special Commands.

Command Conditions

In many situations, it may be necessary to run a different set of commands, depending on the context of execution. To achieve this flexibility, you use conditional commands. To define the situation under which the associated command steps execute, you use the Condition field in the Edit Command or New Command window.

Conditions are evaluated as boolean expressions. If the expression evaluates to TRUE, the command is executed. If it evaluates to 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 in an SQL statement. It provide enormous flexibility in evaluating scenarios. Table 2-1. Example conditions lists some example conditions. The condition can include tokens. For more information, see Using Tokens.

Table 2-1. 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.

Note: You must place single quotes around string literals or tokens that are used to evaluate strings.

About the Commands Tab

Within PPM, commands are configured using the Commands tab for the following entities:

  • Object types

  • Request types

  • Report types

  • Validations

  • Workflow step sources

  • Special commands

You can access the tab by opening one of the listed entities, and then selecting the Commands tab. Figure 2-1. Commands tab shows the Commands tab in the Object Type window.

Figure 2-1. Commands tab

The Commands tab is divided into two sections. The Commands section defines the command-line directive or special command to be issued. The Command Steps section displays the steps specified to execute the commands. A command step can be an actual command-line directive that is sent to the PPM Server or target machine, or it can be one of the many special commands.

Note: The execution engine executes the commands and command steps in the order in which they listed on the Commands tab. To change the order of the commands or the command steps:

  • On the Commands tab, click the command or command step.

  • Use the up and down arrow buttons to change the placement of the selected item.