How to model going to a previous state (history state)?


#1

I have a simple job where I have to sign off on various tasks. When I get to task 2 and I encounter a problem and want to create an exception is there a way to get back to the current task (not hard coded) to a specific state in this case task 1? If say the the user cancelled the exception or they resolved it and then would like to resume where they left off (they were on Task 2 for example). I guess I could create a Task1 Exception, TaskN Exception but this would be a lot of redundancy to model this.

Basically I think this would just be a history state: http://davidkpiano.github.io/xstate/docs/#/guides/history

https://sketch.systems/abelovic/sketch/eeaf4f82b57145ccd316b4526cbf3642


#2

Your use case makes sense, but we don’t have any plans to implement history states in the near term because they raise a lot of tricky issues.

For your immediate issue, the easiest and clearest solution would probably be to make a “where did they just come from?” pseudostate that has transitions to all of the task 1 states — basically, it’s on the person interpreting the sketch to remember the history and go back to it.