如何保留 Webflow 的状态
假设我有一个包含 N 个状态的网络流。我怎样才能将用户的状态保存到数据库中,以便如果他将流程留在中间的某个地方,他可以在下次登录系统时从他离开的地方开始,无论他使用什么机器。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一般问题,您本质上是在处理长事务。
这通常是一个非常困难的问题,因为您必须处理并发问题。但是,如果您想这样做,您可能必须拥有与所涉及的实体相对应的域对象
您可以使用 状态模式封装状态,并在每个网页流转换。
如果您用例更简单,您可以使用审核日志记录来执行某些操作。
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.