I am using a GraphMachine to model a workflow of a MongoDB record.
I am only storing the state in MongoDB and when I am reloading at a later time, I use the set_state()
option on the machine to force it back to where it was left off.
This all works correctly except when I try to show the state machine graph.
After loading it always shows itself in the initial state even though it seems it did accept the set_state
because transitions are accepted as if it was in the restored state.
Lets say I have a simple linear FSM like: S0 -> S1 -> S2 -> S3 -> S3 -> S0.
S0 is the initial state, and S2 is where it was saved.
When I restore, it always graphs itself in S0, but if I try to make the S2->S3 transition, it accepts it. When I make the graph afterwards, it is in the correct S3 state.
Is there a way I can make the GraphMachine 'initialize' to the correct state?
Thanks