Managing a subflow task from the OCLI
You can run the new command to create a subflow task. Configure the mandatory and optional parameters to create a unique subflow task.
Prerequisites
Before creating subflow tasks, you must have the USE permission on the workflow that needs to be referenced in the subflow task.
Syntax and commandline options
Run the following command to create a subflow task:
ocli model newAfter running the command, fill in the following template to create a subflow
task:
kind: JobDefinition
def:
folder: Folder_name
name: Subflow task_name
workstation: Workstation_name
type: subflow
subType: nestWorkflow
task:
subflow:
Action:
nestWorkflow:
[variables:
key: value]
workflow: workflow_key
workflowId: workflow_ID
recovery:
action: STOP
repeatAffinity: false
The mandatory attributes to create a task are
follows:- Folder_name
- The name must start with a letter or a number, and can contain alphanumeric characters, dashes, and underscores. The name of the folder cannot contain spaces. You must include a forward slash (/) before the folder name if you want to define an absolute path, while it is not required for relative paths.
- Subflowtask_name
- The name must start with a letter or a number, and can contain alphanumeric characters, dashes, and underscores. The name cannot contain spaces.
- Workstation_name
- You can specify the name of the workstation and also the name of the folder in which the workstation is defined, if any. The name must start with a letter, and can contain alphanumeric characters, dashes, and underscores. The name cannot contain spaces.
The specific attributes to create a subflow task definition
are as follows:
- Workflow or workflow ID
- Mandatory attribute. Specify a valid workflow key (workstation name with workflow name separated by a number sign (#)) or workflow ID. You can specify both or any one of them to create the task.
- Variables
- Specify key-value pairs as variables. The values can be a JSONata expression that is resolved while the task is running. Any terms in the subflow task definition that matches the key in the key-value pair is replaced with their corresponding values, effectively resolving the subflow task definition.
Examples
-
The following example shows the subflow task SEND_NOTIFICATIONS with the nested workflow /WS_AGT_0#/SEND_NOTIFICATIONS and variables (TOTAL REVENUE and TOTAL EXPENDITURE) used to resolve the definition.
--- kind: JobDefinition def: folder: / name: SEND_NOTIFICATIONS workstation: /WS_AGT_0 type: subflow subType: nestWorkflow task: subflow: Action: nestWorkflow: workflow: /WS_AGT_0#/SEND_NOTIFICATIONS workflowId: 9c0242ab-d515-4a4e-b55c-78d5972e6ca8 variables: TOTAL_REVENUE: "${jobs.RETRIEVE_STATISTICS.TOTAL_REVENUE}" TOTAL_EXPENDITURE: "${jobs.RETRIEVE_STATISTICS.TOTAL_EXPENDITURE}" recovery: action: STOP repeatAffinity: false