Package io.kestra.core.tasks.flows
Class Template
java.lang.Object
io.kestra.core.models.tasks.Task
io.kestra.core.tasks.flows.Template
- All Implemented Interfaces:
FlowableTask<Template.Output>
- Direct Known Subclasses:
Template.ExecutorTemplate
@Plugin(examples=@Example(full=true,code={"id: template","namespace: io.kestra.tests","","inputs:"," - name: with-string"," type: STRING","","tasks:"," - id: 1-return"," type: io.kestra.core.tasks.debugs.Return"," format: \"{{task.id}} > {{taskrun.startDate}}\""," - id: 2-template"," type: io.kestra.core.tasks.flows.Template"," namespace: io.kestra.tests"," templateId: template"," args:"," my-forward: \"{{ inputs.with-string }}\""," - id: 3-end"," type: io.kestra.core.tasks.debugs.Return"," format: \"{{task.id}} > {{taskrun.startDate}}\"\n"}))
@TemplateEnabled
public class Template
extends Task
implements FlowableTask<Template.Output>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classUgly hack to provide the ApplicationContext on {allChildTasks()} & {tasksTree(io.kestra.core.models.executions.Execution, io.kestra.core.models.executions.TaskRun, java.util.List<java.lang.String>)} We need to inject a way to fetch Template ...static classstatic classstatic classstatic interface -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchildTasks(RunContext runContext, TaskRun parentTaskRun) Resolve child tasks of a flowable task.protected TemplatefindTemplate(io.micronaut.context.ApplicationContext applicationContext) static FlowinjectTemplate(Flow flow, Execution execution, org.apache.commons.lang3.function.TriFunction<String, String, String, Template> provider) outputs(RunContext runContext, Execution execution, TaskRun parentTaskRun) resolveNexts(RunContext runContext, Execution execution, TaskRun parentTaskRun) Resolve next tasks to run for an execution.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, resolveState
-
Field Details
-
errors
-
-
Constructor Details
-
Template
public Template()
-
-
Method Details
-
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<Template.Output>- Throws:
IllegalVariableEvaluationException
-
allChildTasks
- Specified by:
allChildTasksin interfaceFlowableTask<Template.Output>- Returns:
- all child tasks including errors
-
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<Template.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<Template.Output>- Throws:
IllegalVariableEvaluationException
-
outputs
public Template.Output outputs(RunContext runContext, Execution execution, TaskRun parentTaskRun) throws IllegalVariableEvaluationException - Specified by:
outputsin interfaceFlowableTask<Template.Output>- Throws:
IllegalVariableEvaluationException
-
findTemplate
protected Template findTemplate(io.micronaut.context.ApplicationContext applicationContext) throws IllegalVariableEvaluationException -
injectTemplate
public static Flow injectTemplate(Flow flow, Execution execution, org.apache.commons.lang3.function.TriFunction<String, String, throws InternalExceptionString, Template> provider) - Throws:
InternalException
-