UML 状态图:交叉正交区域触发器 [英] UML state diagram: cross-orthogonal region triggers
问题描述
我正在分析 UML 状态图,同时分析我们的一位客户可能拥有的状态.我正在尝试使用具有正交区域的复合状态,其中一个原因中的一种状态是另一个正交原因中至少一种状态更改的触发器.
I'm in the process of getting my head around UML state digrams while analysing the states that one of our customers can have. I'm attempting to use a composite state with orthogonal regions in which one state in one reason is the trigger for at least one state change in another orthogonal reason.
我意识到我可能正在尝试使用错误的范式来对此进行建模,因此请随时在此基础上纠正我,但出于此问题的目的,对情况进行了简化但稍微详细的解释:
I realise that I might be trying to use the wrong paradigm to model this, so feel free to correct me on that basis, but there is a simplified but slightly more detailed explanation of the situation for the purposes of this question:
- 客户的活动"状态有 3 个正交区域,我将它们称为 R1、R2 和 R3
- R1 具有帐户提款已禁用"和提款已启用"状态
- R2 具有ID 未验证"和ID 已验证"状态
- R3 有仅限现金账户"和信用账户"
R3 从只收现金"到信用"的变化只能在 R1 处于已启用提款"状态且 R2 处于身份验证"状态 - 加上另一个触发器时发生.
The change in R3 from "cash-only" to "credit" can only occur once R1 is in "withdrawal enabled" state and R2 is in "ID verified" state - plus another trigger.
在绘制状态图时,是否有一种有效的方法可以使一个正交区域中的状态转换(至少部分)依赖于其他正交区域中的一组状态?如果不是,我还能用什么其他方式来表示这一点?
When drawing the state diagram, is there a valid way to make one state transition in one orthogonal region (at least partially) dependent on a set of states in other orthogonal regions? If not, what other ways could I represent this?
(顺便说一句,我曾想过单独对帐户状态进行建模,但领域中的讨论如此之多以至于将其集成为客户状态的一部分感觉更有用)
(By the way, I had thought of modelling the account states separately but the discussions in the domain is such here that it feels more useful to integrate that as part of a customer's state)
预先感谢您的帮助.
推荐答案
我会使用这样的警卫
假设 R1
和 R2
本身就是状态机.
assuming that R1
and R2
are state machines on their own.
也许有更正式的正确方式来描述守卫.但我想读者可以理解它背后的想法.
Maybe there is a more formally correct way to describe the guard. But I guess a reader can grasp the idea behind it.
这篇关于UML 状态图:交叉正交区域触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!