Defining contexts and variables in a Job script
Use the DEFAULT_CONTEXT to specify the default context, and
use the ContextType {} function to define contexts and their
parameters.
ContextType {} properties
Function/parameter | Description | Mandatory? |
---|---|---|
NAME |
Give a name to the context. |
Yes |
addContextParameter {} |
Define a variable for the context. Use this function to define as many variables as needed.
|
Yes |
Example
The following Job script example defines two contexts: Test (default context) and Prod, each with one variable named child_job of type String. For context Test, the predefined variable value is child_1, while for context Prod it is child_2. When the Job is executed, a text message Specify the Job to run: is displayed.
DEFAULT_CONTEXT: Test,
ContextType {
NAME: Test
addContextParameter {
NAME: child_job,
TYPE: "id_String",
VALUE: "child_1",
PROMPT: "Specify the Job to run:",
PROMPTNEEDED: true
}
}
ContextType {
NAME: Prod
addContextParameter {
NAME: child_job,
TYPE: "id_String",
VALUE: "child_2",
PROMPT: "Specify the Job to run:",
PROMPTNEEDED: true
}
}