SwitchRef

A switch registered with a Dag: list the tasks it can choose between.

dag.Switch(PickPath.class).Case(handleLong).Case(handleShort);

A case runs after the switch, so naming it records that edge, as Deps.Flow.before would. The switch chooses exactly one case and skips every other, so a task that runs after several cases needs a trigger rule that tolerates a skipped upstream, such as none_failed_min_one_success.

See also

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val id: String

Airflow task ID of the deciding task.

Functions

Link copied to clipboard
open override fun after(vararg previous: Deps.Flow): SwitchRef

Runs the tasks here after each of previous, carrying no value.

Link copied to clipboard
open override fun before(vararg next: Deps.Flow): SwitchRef

Runs the tasks here before each of next, carrying no value.

Link copied to clipboard
fun Case(task: TaskRef<*>): SwitchRef

Adds a task this switch can choose. Every other case is skipped when the switch chooses this one.

Link copied to clipboard
fun config(key: String, value: Any?): SwitchRef

Sets one task-level configuration value on the deciding task.

Link copied to clipboard
open fun endpoints(): List<Endpoint>

The ends an edge drawn here attaches to. A task stands for itself, so the default is nodes; a task group stands for the group rather than for the tasks it holds today.

Link copied to clipboard
open override fun nodes(): List<TaskDef>

The tasks at this point in the flow.