Variables
You can use IBM® Cognos® Command Center variables to dynamically substitute values into processes, tasks, and file resources at run time.
Variables are expanded at run time just before the Cognos Command Center server streams task
definitions and file resources to agents. The syntax for a variable
is $(VarName).
Variables can be nested recursively. For example, if you have two variables:
FIRST = A
SECOND = x$(FIRST)x
Then $(SECOND) is expanded to xAx.
- Environment variables that are defined on the ecosystem view. They are visible to all processes and file resources within the ecosystem.
- Process variables that are defined on the process view. Process variables are only visible inside the parent process.
- System variables that are visible to all processes and file resources.
Environment variables
- Encrypt
- Causes the values in the Cognos Command Center repository to be encrypted. Typically, you encrypt passwords or other sensitive data. Encrypted text is not visible to users that have read-only access to the system.
- Prompt
- Makes the variable a required input field when a process in this ecosystem is manually run. For example, a prompt for password and host opens when the user manually starts the list directory process:
Process variables
- Encrypt
- Causes the values in the Cognos Command Center repository to be encrypted. Typically, you encrypt passwords or other sensitive data. Encrypted text is not visible to users that have read-only access to the system.
- Prompt
- Makes the variable a required input field when a process in this ecosystem is manually run. For example, a prompt for password and host opens when the user manually starts the list directory process.
System variables
$(Process[LastSuccess].Start) . The following table shows the set of available system variables.
| Variable | Description | Examples |
|---|---|---|
| Date{format} | Provides the current date and time. The output format is specified by the optional {format} argument. |
$(Date) => "11/30/11"
|
| Process[name].Environment | The name of the environment that the process
is running in. To reference a different process, the optional [name] indexer can be used. In the example, PROD is the name the user gave the environment in the ecosystem. |
$(Process.Environment) => PROD |
| Process[name].Duration{format} | The duration of the process. The output format is specified by the optional {format} argument. The {format} argument can have the following values: seconds - formats the duration as the number of seconds. long - formats the duration as hh:mm:ss. To reference a different process than the current one, the optional [name] indexer can be used. |
$(Process.Duration) => "00:12:48"
|
| Process[name].JobId | A unique identifier of the process. To reference a different process than the current one, the optional [name] indexer can be used. |
$(Process.JobId) => 18654 |
| Process[name].Name | The name of the process that is running. To reference a different process than the current one, the optional [name] indexer can be used. |
$(Process.Name) => "Stop Hyperion
Services" |
| Process.NextRun{format} | The next scheduled run of the process. Expands to an empty string if the process is not scheduled. |
$(Process.NextRun) => "11/30/11
14:35:00 |
| Process[name].Start{format} | The start time of the process. The output format is specified by the optional {format} argument. To reference a different process than the current one, the optional [name] indexer can be used. |
$(Process.Start) => "11/30/11 14:35:44" |
| Process[name].State | The state of the last run of the process. To reference a different process, the optional [name] indexer can be used. |
$(Process.State) ==> "Running"
|
| Process[name].User | The name of the user that started the process.
Use the $(User) variables for access to the user's email, phone, or
other fields. To reference a different process than the current one, the optional [name] indexer can be used. |
$(Process.User) => "John Doe" |
| Process[name].Url | A URL to the process details page of Cognos Command Center web. To reference a different process than the current one, the optional [name] indexer can be used. |
$(Process.Url)=> "https://localhost:8180/Process/
Details/42" |
| Task[Name].Duration{format} | The duration of the task. To reference a different task than the current one, the optional [name] indexer can be used. See the Process.Duration{format} variable for the usage of the format argument. |
$(Task.Duration) => "00:12:48"
|
| Task[name].ExitCode | The exit code of a task. To reference a different task than the current one, the optional [name] indexer can be used. |
$(Task[My Name].ExitCode) => "1" |
| Task[name].End {format} | The end time of a task. | $(Task.End) => "11/30/11 14:35:44" |
| Task.Name | The name of the current task. | $(Task.Name) = "Start Essbase" |
| Task[name].Start {format} | The start time of the task. To reference a different task than the current one, the optional [name] indexer can be used. The output format is specified by the optional {format} argument. |
$(Task[My Name].Start{hh:mm}) =>
"07:22 PM" |
| Task[name].State | The state of a task. To reference a different task than the current one, the optional [name] indexer can be used. The variable expands to one of the following strings: NotStarted, Running, Pausing, Paused, Canceling, Canceled, Failed, Completed |
$(Task.State) => "Completed"
|
| Task[name].Url | A URL to the task details page of IBM Cognos Command Center Web. | $(Task.Url) => "https://localhost:8180/ |
| User | Shorthand for User.Email. | $(User) => "john.doe@acme.com" |
| User.Email | The email field for the user that started the process | $(User.Email) => "john.doe@acme.com" |
| User.Name | The name field for the user that started the process. | $(User.Name) => "John Doe" |
| User.Phone | The phone field for the user that started the process. | $(User.Phone) => "866.756.7827" |
Access previous process runs
$(Process[indexer].Variable{format}), where indexer can be one of the following:- Last - the last run of the process. For example,
$(Process[Last].Duration)returns the duration of the last run of the process. - LastSuccess - the last successful run of the process. For example,
$(Process[LastSuccess].Start)returns the start time of the last successful run of the process.
Date and time value variables format
For date and time value variables, the optional {format} argument is a format specifier that determines the output format.
The following table shows the most common format specifiers
| Format Specifier | Description |
|---|---|
| d | Day, 1 digits: 1-31 |
| dd | Day, 2 digits: 01-31 |
| h | Hours, 12 hour clock, 1 digit: 1-12 a.m./p.m. |
| hh | Hours, 12 hour clock, 2 digits: 01-12 a.m./p.m. |
| H | Hours, 24 hour clock, 1 digit: 0-23 |
| HH | Hours, 24 hour clock, 2 digits: 00-23 |
| m | Minutes, 1 digit: 0-59 |
| mm | Minutes, 2 digits: 00-59 |
| M | Month, 1 digit: 1-12 |
| MM | Month, 2 digits: 01-12 |
| s | Seconds, 1 digit: 0-59 |
| ss | Seconds, 2 digits: 00-59 |
| utc | Universal time coordinates in the format yyyy-MM-dd'T'HH:mm:ss'Z'. For example, 2015-10-23T21:33:42Z |
| yy | Year 2 digits: 00-99 |
| yyyy | Year 4 digits: 0000-9999 |
Separator characters, such as . , : /, are copied to the
output. For example, $(Date{yyyy/MM/dd}) => 2011/12/31 or $(Date{HH:mm})=> 21:08.