Task states

The state of a task reflects the status of a work item in a process. Typically, a task drives and responds to state changes through events and subscriptions.

As shown in the following diagram, a task has states that indicate how the task is progressing towards completion.

State diagram for a task.

State changes are made automatically by Content Engine or manually by a client such as IBM Case Manager. A task can be promoted (left to right in the diagram) to a new state, or it can be demoted (right to left) to a previous state.

Preconditions and postconditions can be set on a task, and the conditions are tested when an attempt is made to manually promote a state. The task cannot be promoted if the condition evaluates to false. Every state change, whether manual or automatic, generates a changed state event, which you can subscribe to or configure for auditing.

Each of the states, and the transitions into and out of the states, is described in the following section.

Waiting (Precondition)

Indicates that the task has yet to satisfy its precondition, but is not blocked by any incomplete predecessors. This is the initial state for all newly created tasks, irrespective of whether the precondition is immediately satisfied, or whether there is a precondition set on the task.

This state can be reentered in the following circumstances:

The task can move from this state in the following circumstances:

Waiting (All)

Indicates that the task is blocked by both incomplete predecessors and an unsatisfied precondition.

This state can be entered in the following circumstances:

The task can move from this state in the following circumstances:

Waiting (Predecessors)

Applies when the task has satisfied its precondition but is blocked by incomplete predecessors.

This state can be entered in the following circumstances:

The task can move from this state in the following circumstances:

Ready

Indicates that the task is no longer blocked by incomplete predecessors or by a precondition, and, therefore, it is ready to be worked on.

This state can be entered in the following circumstances:

The task can move from this state in the following circumstances:

Working

Signifies that the task is now being actively worked on, such as a workflow having been launched as a result of the change into the WORKING state.

In this state, you cannot create a task relationship that specifies this task as the successor unless the state of the predecessor task for that task relationship is COMPLETE. (Blocking dependencies cannot be introduced after a task has started.)

This state can be entered in the following circumstances:

The task can move from this state in the following circumstances:

Complete

Indicates that the task has been successfully completed. This state can be reached only by a promote operation from the WORKING state, subject to validation of the post-condition.

A successful transition to COMPLETE can release successor, that is, dependent, tasks from a WAITING_ALL or WAITING_PRECONDITION state as described above.

A task in the COMPLETE state can be moved back to WORKING by a demote operation, but this is only permitted if the task has no successors that have already moved beyond READY. If permitted, successors in the READY state are moved to WAITING_PREDECESSORS, and those in WAITING_PRECONDITION are moved to WAITING_ALL.

In this state, you cannot create a task relationship that specifies this task as the successor unless the state of the predecessor task for that task relationship is COMPLETE.

Failed

Applied when execution of a task fails for some reason. If the error condition is resolved, the task can be moved back to WORKING.

In this state, an attempt to create a task relationship that references this task as successor is subject to the same constraint as specified for WORKING.

In this state, you cannot create a task relationship that specifies this task as the successor unless the state of the predecessor task for that task relationship is COMPLETE.