Task context structure
Provides a list and explanation of all fields in the task context structure.
When a task runs, it generates a certain amount of information, which is stored in JSON format and is available for querying and manipulating with JSONata.
This topic provides a list and an explanation of all supported fields in the task context
structure.
| Field name | Explanation | Notes |
|---|---|---|
| RC | Task return code. Present only if the task has completed. | |
| var | Variables defined in the workflow. | If a task can retrieve variables from several resources, the following
hierarchy applies:
|
| js | Workflow data | |
| js.key | The full workflow key, consisting of submission time and workflow ID | |
| js.start | The earliest time a workflow can be launched. | |
| js.actualStart | The time the workflow actually started. | |
| js.latestStart | The latest time a workflow can be launched. | |
| js.deadline | The time within which a workflow should complete. | |
| js.defId | Workflow definition ID | |
| js.wksId | Workflow workstation ID | |
| js.name | Workflow folder and base name | |
| js.schedTime | Workflow scheduled time | |
| js.id | Workflow ID | |
| js.wks | Workflow workstation name and folder | |
| jobs | Tasks data | |
| jobs.job_name.wa.key | The full task key, consisting of submission time and job stream ID | |
| jobs.job_name.wa.start | The earliest time a task can be launched. | |
| jobs.job_name.wa.actualStart | The time the task actually started. | |
| jobs.job_name.wa.latestStart | The latest time a task can be launched. | |
| jobs.job_name.wa.deadline | The time within which a task should complete. | |
| jobs.job_name.wa.runId | The ID the task after it is submitted | |
| jobs.job_name.jobDef | Task definition name and folder | |
| jobs.job_name.wksId | Task workstation ID | |
| jobs.job_name.wa.logon | Task logon user | |
| jobs.job_name.wa.name | Task base name | |
| jobs.job_name.rerunNum | Task rerun number (if any) | |
| jobs.job_name.wa.RC | Task return code | |
| jobs.job_name.wa.id | Task ID | |
| jobs.job_name.wa.jobDefId | Task definition ID | |
| jobs.job_name.wa.wks | Task workstation | |
| ...output properties | ||
| ... output conditions | In case of conflict, output conditions are overridden by output properties |
You can specify the task context
formatting as follows:
- T:
- Text format. This is the default value.
- J:
- JSON format
- Y:
- YAML format
For example, to print the whole task context in
JSON format, use the following notation:
${J:$}Note: Special characters, such as - + * / %, must be enclosed in single
or double quotes so that they can be parsed correctly. Consider the following
examples:
${jobs.TASK1_DEFINITION_161603134.'Transfer-Encoding'}${jobs.TASK1_DEFINITION_161603134."Transfer-Encoding"}The following is an example of the empty task context
structure:
{
RC
var: {
key:val... },
"js" : {
"defId" : "",
"wksId" : "",
"name" : "",
"schedTime" : "",
"id" : "",
"wks" : ""
},
"jobs" : {
"job_name" : {
"wa" : {
"jobDef" : "",
"wksId" : "",
"logon" : "",
"name" : "",
"rerunNum" : ,
"id" : "",
"jobDefId" : "",
"wks" : ""
... output properties
... output conditions
},
...
}
}
For an example populated with data from several tasks, see Task context structure example.