我们在学校学习行为状态图的转换具有语法:
list of events [guard condition] / list of actions
但是我在 Internet 上找不到任何使用多个事件进行转换的示例。真的有可能吗?如果是,它的行为如何?这是否意味着当此事件之一发生时(当然条件已满足),交易就实现了?
最佳答案
是的,转换可以由列表中的许多事件之一触发。您将使用这样的构造来避免状态之间的多条线,从而制作更整洁的图表。
这是 2.5 规范所说的:
14.2.3.9.2 Enabled Transitions
A Transition is enabled if and only if:
[ . . . ]
At least one of the triggers of the Transition has an Event that is matched by the Event type of the dispatched Event occurrence.
这些逻辑 OR 的转换以文本形式指定为转换上的逗号分隔列表,如 §14.2.4.9 中所述:
[<trigger> [‘,’ <trigger>]* [‘[‘ <guard>’]’] [‘/’ <behavior-expression>]]
关于uml - UML 状态图中具有多个事件的一种转换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40327871/