Package io.kestra.core.tasks.flows
Class Switch
java.lang.Object
io.kestra.core.models.tasks.Task
io.kestra.core.tasks.flows.Switch
- All Implemented Interfaces:
FlowableTask<Switch.Output>
@Plugin(examples=@Example(full=true,code={"id: switch","namespace: io.kestra.tests","","inputs:"," - name: string"," type: STRING"," required: true","","tasks:"," - id: switch"," type: io.kestra.core.tasks.flows.Switch"," value: \"{{inputs.string}}\""," cases:"," FIRST:"," - id: 1st"," type: io.kestra.core.tasks.debugs.Return"," format: \"{{task.id}} > {{taskrun.startDate}}\""," SECOND:"," - id: 2nd"," type: io.kestra.core.tasks.debugs.Return"," format: \"{{task.id}} > {{taskrun.startDate}}\""," THIRD:"," - id: 3th"," type: io.kestra.core.tasks.debugs.Return"," format: \"{{task.id}} > {{taskrun.startDate}}\""," defaults:"," - id: default"," type: io.kestra.core.tasks.debugs.Return"," format: \"{{task.id}} > {{taskrun.startDate}}\""}))
@Introspected
public class Switch
extends Task
implements FlowableTask<Switch.Output>
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchildTasks(RunContext runContext, TaskRun parentTaskRun) Resolve child tasks of a flowable task.outputs(RunContext runContext, Execution execution, TaskRun parentTaskRun) resolveNexts(RunContext runContext, Execution execution, TaskRun parentTaskRun) Resolve next tasks to run for an execution.resolveState(RunContext runContext, Execution execution, TaskRun parentTaskRun) Resolve the state of a flowable task.Create the topology representation of a flowable task.Methods inherited from class io.kestra.core.models.tasks.Task
findById, findById, isFlowable, isSendToWorkerTaskMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.kestra.core.models.tasks.FlowableTask
getErrors
-
Field Details
-
errors
-
-
Constructor Details
-
Switch
public Switch()
-
-
Method Details
-
allChildTasks
- Specified by:
allChildTasksin interfaceFlowableTask<Switch.Output>- Returns:
- all child tasks including errors
-
tasksTree
public GraphCluster tasksTree(Execution execution, TaskRun taskRun, List<String> parentValues) throws IllegalVariableEvaluationException Description copied from interface:FlowableTaskCreate the topology representation of a flowable task.A flowable task always contains subtask to it returns a cluster that displays the subtasks.
- Specified by:
tasksTreein interfaceFlowableTask<Switch.Output>- Throws:
IllegalVariableEvaluationException
-
childTasks
public List<ResolvedTask> childTasks(RunContext runContext, TaskRun parentTaskRun) throws IllegalVariableEvaluationException Description copied from interface:FlowableTaskResolve child tasks of a flowable task.For a normal flowable, it should be the list of its tasks, for an iterative flowable (such as EachSequential, ForEachItem, ...), it should be the list of its tasks for all iterations.
- Specified by:
childTasksin interfaceFlowableTask<Switch.Output>- Throws:
IllegalVariableEvaluationException
-
resolveState
public Optional<State.Type> resolveState(RunContext runContext, Execution execution, TaskRun parentTaskRun) throws IllegalVariableEvaluationException Description copied from interface:FlowableTaskResolve the state of a flowable task.- Specified by:
resolveStatein interfaceFlowableTask<Switch.Output>- Throws:
IllegalVariableEvaluationException
-
resolveNexts
public List<NextTaskRun> resolveNexts(RunContext runContext, Execution execution, TaskRun parentTaskRun) throws IllegalVariableEvaluationException Description copied from interface:FlowableTaskResolve next tasks to run for an execution.For a normal flowable, it should be the subsequent task, for a parallel flowable (such as Parallel, ForEachItem, ...), it should be a list of the next subsequent tasks of the size of the concurrency of the task.
- Specified by:
resolveNextsin interfaceFlowableTask<Switch.Output>- Throws:
IllegalVariableEvaluationException
-
outputs
public Switch.Output outputs(RunContext runContext, Execution execution, TaskRun parentTaskRun) throws IllegalVariableEvaluationException - Specified by:
outputsin interfaceFlowableTask<Switch.Output>- Throws:
IllegalVariableEvaluationException
-