addTask

fun addTask(id: String, definition: Class<out Task>): Dag

Registers a task with this Dag.

The class must have a public no-argument constructor and implement Task. Task IDs must be unique within a Dag.

Return

This Dag, for chaining.

Parameters

id

Task identifier, unique within this Dag.

definition

Class that implements Task. Must have a public no-arg constructor.

Throws

if a task already exists in the Dag with the same ID.