task
Adds a task with typed output and returns a reference for later tasks.
val filesTask = task("Create files") {
TaskResult.Success("Files created", data = listOf("a.txt", "b.txt"))
}
task("Upload files") {
val files = filesTask.requireData()
TaskResult.Success("Uploading ${files.size} files")
}Content copied to clipboard
Output is local to one plan execution and shared across nested groups. Success, Info, Warning and Skipped publish output; Error and cancellation do not. Skipped does not trigger error behavior and is shown as skipped in the viewer. requireData() fails the consumer on missing output; data returns null instead. Tasks returning Success, Info, Warning or Skipped without output have result type Unit. Bei Fehlern behandeln StopGroup und StopRootGroup den Plan als Gruppe.