Problem/Motivation

It can be very handy for training and auditing to have visual representation of workflows.

Ideally Mermaid could be used to show the relationship between states and transitions.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

swirt created an issue. See original summary.

swirt’s picture

Issue summary: View changes
StatusFileSize
new83.22 KB

Example:

    A -->|Edit| A
    A(Draft) -->|Review| B(In review)
    B -->|Review|B
    B -->|Approve| C(Approved)
    C -->|Publish| D(Published)
    D -->|Archive| E(Archived)
    E -->|Restore from Archive|D
    B -->|Edit| A
    D -->|Edit| A
    E -->|Edit| A
    A -->|Publish| D
    B -->|Publish| D
    D -->|Publish| D
    E -->|Publish| D
    A -->|Archive| E
    B -->|Archive| E
    C -->|Archive| E

results in

sample workflow mermaid

davidmpickett’s picture

Modeling this on the Entity Relationship Diagram, here's a series of drop downs that might power workflow diagrams:

  • Chose Workflow to diagram
    • Workflow #1
    • Workflow #2
    • Workflow #3
  • Chose starting Workflow Element
    • Workflow State
    • Workflow Transition
  • Chose starting Workflow State/Transition
    • Draft
    • In Review
    • Published
  • Chose depth

Starting from the Approved workflow state might look like this:
Diagram of Approved state
flowchart LR
A1(Draft)
A2(Draft)
B1(In review)
B2(In review)
C1(Approved)
C2(Approved)
C3(Approved)
D1(Published)
D2(Published)
E1(Archived)
E2(Archived)

A1 ~~~ C2 ~~~ A2
B1 -->|Approve| C2 ~~~ B2
C1 ~~~ C2 ~~~ C3
D1 ~~~ C2 -->|Publish| D2
E1 ~~~ C2 -->|Archive| E2

Starting from the Edit workflow transition might look like this:
Diagram of Edit transition

Mermaid markdown:
flowchart LR
A(Draft)
B(In review)
D(Published)
E(Archived)
A -->|Edit| A
B -->|Edit| A
D -->|Edit| A
E -->|Edit| A

swirt’s picture

That is great @davidmpickett thank you for the guidance.

swirt’s picture

Assigned: Unassigned » swirt

I am working on this now.

  • swirt committed d729734d on 1.0.x
    Issue #3357232: Add diagram workflow states and transitions
    
swirt’s picture

The initial take on this has merged. It will go out with 1.0.6

It is missing the diagram that shows a current state and the entry and exit points for that state. It needs some different logic from the other two variants.

swirt’s picture

Status: Active » Fixed

Closing this and will add the third display as a new issue.

swirt’s picture

Here is the new issue I created for the missing diagram
https://www.drupal.org/project/content_model_documentation/issues/3360981

swirt’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.