Task properties
The following task properties are defined in the process body:
task.attempt
The current task attempt.
task.exitStatus
Available only in script: and shell: blocks
The exit code returned by the task script.
The exit code is only available after the task has been executed (e.g., the errorStrategy directive).
task.hash
Available only in exec: blocks
The task hash.
task.index
The process-level task index.
task.name
Available only in exec: blocks
The task name.
task.previousException
The exception reported by the previous task attempt.
Since the exception is available after a failed task attempt, it can only be accessed when retrying a failed task execution, i.e., when task.attempt is greater than 1.
task.previousTrace
The trace record associated with the previous task attempt.
Since the trace record is available after a failed task attempt, it can only be accessed when retrying a failed task execution, i.e., when task.attempt is greater than 1. See Trace file for a list of available fields.
The trace fields %cpu and %mem can be accessed as pcpu and pmem, respectively.
task.process
The name of the process that spawned the task.
task.workDir
Available only in exec: blocks
The unique directory path for the task.
Directive values for a task can be accessed via task.<directive>. See Task directive values for more information.