# 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<br>needed.<br><br><ul> <li> <p> <kbd>NAME</kbd>: Give a name to the variable.</p> </li> <li> <p> <kbd>TYPE</kbd>: Specify the type of the variables. Acceptable                  values:</p> <ul> <li> <kbd>id_Boolean</kbd> </li> <li> <kbd>id_Character</kbd> </li> <li> <kbd>id_Date</kbd> </li> <li> <kbd>id_Double</kbd> </li> <li> <kbd>id_Float</kbd> </li> <li> <kbd>id_Integer</kbd> </li> <li> <kbd>id_Long</kbd> </li> <li> <kbd>id_Short</kbd> </li> <li> <kbd>id_String</kbd> </li> <li> <kbd>id_Object</kbd> </li> <li> <kbd>id_BigDecimal</kbd> </li> <li> <kbd>id_File</kbd> </li> <li> <kbd>id_Directory</kbd> </li> <li> <kbd>id_List Of Value</kbd> </li> <li> <kbd>id_Password</kbd> </li> </ul> </li> <li> <kbd>VALUE</kbd>: Type in the value of the variables.</li> <li> <kbd>COMMENT</kbd>: Type in a text comment.</li> <li> <kbd>PROMPT</kbd>: Type in the prompt message.</li> <li> <kbd>PROMPTNEEDED</kbd>: Set this parameter to                  <kbd>true</kbd> to trigger a prompt for this variable at Job                execution.</li> </ul> | 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
	}
}
```