Create a content entity type to track the state of a task, and its history of state changes

Created on 26 September 2024, 3 months ago

Problem/Motivation

Now that we've done ✨ Checklist tasks should be content entities Active , we need to start thinking about how to track the state of a task in a checklist.

I propose that we create a new content entity type, called TaskState, to do this. Here are some aspects of this, in no particular order:

  • Each Task must have exactly one TaskState associated with it, by UUID. This is enforceable by validation constraints.
  • The TaskState for a task is created when the task is, and deleted when a task is deleted. It cannot be deleted if its associated task still exists; this will be enforced by the storage handler.
  • TaskStates are not translatable, but they are revisionable, and hold ownership information. This means that they can store the history of a task's progression through various states.
  • TaskStates have a field called "state", which is the ID of the task's current workflow state. The value of this field will be read and written by the storage plugins being built in ✨ [PP-1] Convert storage backends into plugins Postponed (that issue is not a blocker for this one, though) -- therefore, it'll use custom storage.
  • TaskStates, being content entities, are fieldable -- although not in the UI -- which might be useful for certain advanced use cases.
  • There is some precedent in core for this pattern - Content Moderation has an internal content entity type to store workflow states for moderated entities. (The entity is called ContentModerationState.)
✨ Feature request
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024