Class: Context
Object to manage deployment call context
Constructors
new Context()
new Context(workflow: Workflow): Context
Initialize a new context
Parameters
Parameter | Type | Description |
---|---|---|
| Workflow object |
Returns
Properties
workflow
workflow: Workflow;
Methods
payload()
payload(inputs: RawTaskIO[]): Payload
Generate the payload to be sent to the deployment call
Parameters
Parameter | Type | Description |
---|---|---|
| A list of input data |
Returns
Payload data
Throws
OutputsNotDefinedException if no output is defined
setOutput()
setOutput(taskName, outputIndex)
setOutput(taskName: string, outputIndex?: number): void
Mark a task output as a wanted output to be returned by the deployment call
Parameters
Parameter | Type | Description |
---|---|---|
|
| A task name |
|
| Zero-based index of the output to be returned among all task outputs (if not set, all task outputs will be returned) |
Returns
void
Throws
TaskNotFoundError if no task with the given name is found
Throws
MultipleTaskFoundError if multiple tasks are found with the same given name
setOutput(taskId, outputIndex)
setOutput(taskId: number, outputIndex?: number): void
Mark a task output as a wanted output to be returned by the deployment call
Parameters
Parameter | Type | Description |
---|---|---|
|
| Task id |
|
| Zero-based index of the output to be returned among all task outputs (if not set, all task outputs will be returned) |
Returns
void
Throws
TaskNotFoundError if no task with the given id is found
setParameters()
setParameters(taskName, parameters)
setParameters(taskName: string, parameters: Record<string, string | number | boolean>): void
Set parameters for a task
Parameters
Parameter | Type | Description |
---|---|---|
|
| A task name |
|
| parameters values for given task |
Returns
void
Throws
TaskNotFoundError if no task with the given name is found
Throws
MultipleTaskFoundError if multiple tasks are found with the same given name
Throws
TaskParameterNotFoundException if a given parameter name is not found in the task parameters
setParameters(taskId, parameters)
setParameters(taskId: number, parameters: Record<string, string | number | boolean>): void
Set parameters for a task
Parameters
Parameter | Type | Description |
---|---|---|
|
| Task id |
|
| parameters values for given task |
Returns
void
Throws
TaskNotFoundError if no task with the given id is found
Throws
TaskParameterNotFoundException if a given parameter name is not found in the task parameters