I have a set of tables that defines the workflow. Say possible states are New, InProgress, Cancelled, Complete. I have a worfklow steps table that defines which new state the current state goes to using a user response such as approve, decline, cancel, complete.

My question is how would you turn this data into a flow chart graph, using basically any programming language.

ID | Description
1 | New
2 | InProgress
3 | Complete
4 | Cancelled

UniqueID | CurrentWorkflowState | Response | NewWorkflowState
 1           1(New)               "Work"         2(InProgress)
 2           1(New)               "Cancel"       4(Cancelled)
 3           1(New)               "Complete"     3(Complete)
 4           2(InProgress)        "Complete"     3(Complete
 5           2(InProgress)        "Cancel"       4(Cancel)

mermaid is a great tool for generating flow charts from textual data.

Go to the mermaid online editor and enter this

graph TD
    New --> |Work| InProgress
    New --> |Complete| Complete
    InProgress --> |Complete| Complete
    InProgress --> |Cancel| Cancelled
    New --> |Cancel| Cancelled

and you'll get something like this

enter image description here

How you get from your data to the graph data is left as an exercise.

  • I had no idea this tool existed. Thank you very much. – DidIReallyWriteThat Oct 2 '18 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.