Summary

This document describes the life cycle of a Task. It describes how the following Task properties change as the task moves through its life cycle:

  • Task status and result

  • Task is_ready

Task status and result

At the most basic level, a task's status indicates the current state of the task:

  • WAITING: Nobody is working on the task.

  • IN_PROGRESS: An assignee is working on the task.

  • DONE: No more work needs to be done on the task. The task's result, which must be non-null, specifies whether the task has been COMPLETED or SKIPPED.

  • DISABLED: The task is treated as though it does not exist. The assignees cannot interact with it at all.

The following figure depicts how a task's status may change over time. The solid lines in the figure are the transitions that a client may request for the task. The dotted lines are transitions that occur automatically when the client changes the status of a parent task or other ancestor.

WAITING

When a task is WAITING, the following status changes may occur:

  • When an actor starts a task, the task's status changes to IN_PROGRESS.

  • When an actor completes the task, the task starts (status = IN_PROGRESS) and then completes (status = DONE, result = COMPLETED).

  • When the task's parent is skipped or becomes DISABLED, the task's status changes to DISABLED.

IN_PROGRESS

When a task is IN_PROGRESS, the following status changes may occur:

  • When an actor completes the task, the task's status changes to DONE and its result becomes COMPLETED.

  • When an actor skips the task, the task's status changes to DONE and its result becomes SKIPPED. All of its subtasks – and all of their descendants – become DISABLE

  • When an actor pauses the task, the task's status changes back to WAITING.

DONE

When a task is DONE, the following status changes may occur:

  • When an actor reopens the task, the task's status changes to WAITING and MAY automatically change from WAITING to IN_PROGRESS.

  • When the task's parent is skipped or becomes DISABLED, the task's status changes to DISABLED.

DISABLED

When a task is DISABLED, the following status changes may occur:

  • If the task's skipped ancestor is reopened, then the status of the task (along with the statuses of all of the ancestor's other descendants) changes to WAITING.

Task is_ready

Task status is the most visible sign of the task's state, but every task in a running process has a second, equally important, state property. This is the task's is_ready flag.

What does it mean for a task to be "ready to be started"?

When a list of tasks must be performed in sequence, Tasks 1 and 2 must usually be completed before you can perform Task 3. For example, you need to (1) open an account and (2) deposit money in it before you can (3) withdraw money from the account. Task 3 is "ready to be started" if all preceding tasks are DONE or DISABLED.

A task's is_ready flag is true if the task is "ready to be completed", and false otherwise.

A client or user can NEVER directly set a task's is_ready flag. TeamworkIQ automatically sets a task's is_ready property based on the statuses of all previous tasks.

What does "previous task" mean?

A Numbered List like the following specifies a sequential flow:

  1. Task 1

  2. Task 2

  3. Task 3

Task 3's "previous tasks" include Task 1 and Task 2. Task 3 only becomes ready when both Task 1 and Task 2 have been either completed or skipped.

A Bulleted List like the following does not require any sequence; Tasks 1, 2 and 3 may be performed in any order, or in parallel:

  • Task 1

  • Task 2

  • Task 3

Thus, Task 3's "previous tasks" do NOT include Task 1 or Task 2. Task 3 becomes ready as soon as the parent list starts.

What does is_ready do?

is_ready has a number of effects:

  • Certain types of tasks auto-start when they become ready. For example, both Numbered List and Bulleted List tasks auto-start.

  • A task that does not auto-start ("manual task") becomes actionable when it becomes ready and is not DONE.

  • When a task becomes actionable, the assignees are prompted to complete the task. Notifications may be sent.

  • When a task becomes actionable, an event is added to the activity stream, which may trigger client applications to perform actions.

  • If a Numbered List is configured to strictly enforce its sequence, then assignees are forbidden to start, skip or complete a subtask in the list until that subtask is ready. If strictness is turned off, then TeamworkIQ allows assignees to "work ahead," completing tasks even before those tasks become ready.

  • Reopening task 1 in a Numbered List will cause all subsequent tasks to become unready. The wave of unreadiness will cascade down the list. This will NOT happen for a Bulleted List, because subtasks in a Bulleted List do not depend on each other.

What happens when a task auto-starts?

When a Numbered List task becomes ready, it automatically starts. Its status changes from WAITING to IN_PROGRESS. When a Numbered List starts, its first subtask that is not DISABLED automatically becomes ready.

When a Bulleted List task becomes ready, it automatically starts. Its status changes from WAITING to IN_PROGRESS. When a Bulleted List starts, all its subtasks that are not DISABLED automatically become ready.

Thus, changes in task status cause changes in is_ready, and changes in is_ready can activate list tasks, which in turn can cause their subtasks to become ready. is_ready plays a critical role in the flow of control within a running process.

As a developer, do you need to understand is_ready?

If you are developing robots that perform certain automated tasks, your robots should activate when these tasks become actionable, which means that they are (1) ready and (2) either WAITING or IN_PROGRESS.

If you are using task completion to trigger an action, then you should understand that by the time your trigger is fired, not only will the task already be complete, but the is_ready flags of downstream tasks might already be set to true. Some of these downstream tasks might have auto-started in response to those changes.

Did this answer your question?