Say I have a webflow with N states. How can I persist a user’s state to a database so that if he leaves the flow somewhere in the middle, he can start where he left off, next time he logs into the system, no matter what machine he uses when he does.
Share
General question, you’re essentially dealing with a long transaction.
This is generally a really hard problem, as you have to deal with concurrency issues. However, if you wanted to do this, you’d probably have to have Domain objects that correspond to the entities involved
You could use the State pattern to encapsulate the state, and save it to the DB at the end of every web flow transition.
If your use case is simpler, you may be able to do something with Audit Logging.