一个模型中有多个状态机?
我有一个代表注册过程的模型,它需要跟踪几个过程的进展(背景调查、面试、信息收集......)。每个都可以由状态机表示,然后注册的整体状态可能取决于其他状态机的状态。
aasm 能处理这个吗?还有其他想法或设计考虑吗?
I have a model that represents a registration process, which needs to track the progression of several processes (background checks, interviews, information collection...). Each one can be represented by a state machine, and then the overall state of the registration might depend on the state of the others.
Can aasm handle this? Any other ideas or design considerations?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
由于当您在一个模型中搜索多个状态机时会出现这个问题,因此最好有一个答案,尽管已经有了答案。
请尝试这样做:
这将基于两列(搜索和同步)创建两个状态机。
Since this question comes up when you google multiple state machines in one model, it would be good to have an answer, although there is already an answer.
Please try doing:
This will create two state machines based on two columns, search and sync.
尝试这个插件,您甚至可以使用它从其他状态机继承:
http://api.pluginaweek.org /状态机/
Try this plugin, which you can use to even inherit from other state machines:
http://api.pluginaweek.org/state_machine/
如果您需要在一个模型中使用多个状态机,那么它可能会变得很大,并且是时候拆分模型了。
因此,在您的示例中,您应该添加背景调查、访谈、信息收集的模型......
If you need multiple statemachines in one model it's probably getting to big and it's time to split the model.
So in your example you should add models for background checks, interviews, information collection...