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 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.
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:
WAITING_ALL
when the last incomplete predecessor task enters COMPLETE
state, or upon deletion of the task relationship that associates the task to the last remaining incomplete predecessor.READY
by a demote operation.The task can move from this state in the following circumstances:
WAITING_ALL
upon the creation of a task relationship that specifies this task as the successor, and the state of the predecessor task is not COMPLETE
, or by a state change of any predecessor task from COMPLETE
to WORKING
.READY
by a promote operation, if the precondition has been satisfied.Indicates that the task is blocked by both incomplete predecessors and an unsatisfied precondition.
This state can be entered in the following circumstances:
WAITING_PRECONDITION
upon the creation of a task relationship that specifies this task as the successor, and the state of the predecessor task is not COMPLETE
.WAITING_PREDECESSORS
by a demote operation.The task can move from this state in the following circumstances:
WAITING_PRECONDITION
when the last incomplete predecessor task enters the COMPLETE
state, or upon deletion of the task relationship that associates the task to the last remaining incomplete predecessor.WAITING_PREDECESSORS
by a promote operation, if the precondition has been satisfied.Applies when the task has satisfied its precondition but is blocked by incomplete predecessors.
This state can be entered in the following circumstances:
READY
upon creation of a task relationship that specifies this task as the successor, and the state of the predecessor task is not COMPLETE
, or by a state change of any predecessor task from COMPLETE
to WORKING
.WAITING_ALL
by a promote operation, if the precondition has been satisfied. The task can move from this state in the following circumstances:
READY
when the last incomplete predecessor task enters the COMPLETE
state, or upon the deletion of the task relationaship that associates the task to the last remaining incomplete predecessor.WAITING_ALL
by a demote operation.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:
WAITING_PREDECESSORS
when the last incomplete predecessor task enters the COMPLETE
state, or upon the deletion of the task relationship that associates the task to the last remaining incomplete predecessor.WAITING_PRECONDITION
by a promote operation, if the precondition has been satisfied.WORKING
by a demote operation.The task can move from this state in the following circumstances:
WAITING_PREDECESSORS
upon the creation of a task relationship that specifies this task as the successor, and the state of the predecessor task is not COMPLETE
, or by a state change of any predecessor task from COMPLETE
to WORKING
.WAITING_PRECONDITION
by a demote operation.WORKING
by a promote operation.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:
READY
by a promote.COMPLETE
by a demote operation.FAILED
by a clear exception operation.The task can move from this state in the following circumstances:
READY
by a demote operation.COMPLETE
by a promote operation.FAILED
by a set exception operation.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
.
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
.