Skip to main content

Module workflow

Module workflow 

Source
Expand description

The Task workflowStatus and progress rule (docs/design/DECISIONS.md decision 42; jmapio/jmap #465 against draft-ietf-jmap-tasks-06 §4).

-06 says only “Must be one of the TaskList’s workflowStatuses. If set, progress MUST null”, which leaves a task completed through workflowStatus looking unfinished to a JSCalendar or iCalendar reader. Decision 42 replaces it:

  • A workflowStatus that is one of the RFC 8984 §5.2.5 progress values is mirrored into progress by the server; any other value (pending, a list-defined one) leaves progress null. A changed progress, including one the mirror clears, also sets progressUpdated (RFC 8984 §5.2.6) to the current time, unless the client set it.
  • Setting progress to anything else while workflowStatus is set is invalidProperties naming progress.
  • A workflowStatus not in the task list’s workflowStatuses is invalidProperties naming workflowStatus, on create, when the update sets it, and when the update moves the task to another list.
  • Changing a list’s workflowStatuses does not touch its tasks: an update that neither sets workflowStatus nor moves the task is not checked against the list.

apply_workflow_status is the whole rule, on the Task as it would be stored. A TasksBackend runs it in the same critical section as the write, so a concurrent change of the list’s workflowStatuses cannot slip a value past it.

Enums§

WorkflowWrite
How a write reached apply_workflow_status.

Constants§

DEFAULT_WORKFLOW_STATUSES
draft-ietf-jmap-tasks-06 §3: a TaskList’s workflowStatuses default, used when the list has none.
PROGRESS_VALUES
The RFC 8984 §5.2.5 progress values that a workflowStatus mirrors.

Functions§

apply_workflow_status
Apply decision 42 to task, the Task as it would be stored, in a list whose workflowStatuses is list_statuses (None: the list has none, or none is stored, so DEFAULT_WORKFLOW_STATUSES). now is the UTCDate a server-changed progress gives progressUpdated.