UML 状态机,本地与外部转换 [英] UML State Machines, Local vs. External Transition

查看:77
本文介绍了UML 状态机,本地与外部转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如在 http://www.eclipse.org/forums 中所问的那样/index.php/t/452409/我不确定我是否正确理解了局部转换的含义,我想知道我是否以正确的语义使用它们

As already asked in http://www.eclipse.org/forums/index.php/t/452409/ I am not sure I correctly got the meaning of local transition and I'd like to know whether I am using them with the right semantics or not

这两个状态机是否相等?

Are these two state machines equal?

推荐答案

在 UML 2.4.1 下,第一个图显示了在接收到 trigger 时从 State1 的本地转换,其中第二个显示子之间的转换- 收到触发时的状态.从 State1 的外部转换将通过指向 State1 外然后弯曲回它的箭头表示(上层建筑规范的图 15.48).

Under UML 2.4.1, the first diagram shows a local transition from State1 on receipt of trigger where the second shows transitions between sub-states on receipt of trigger. An external transition from State1 would be shown by the arrow pointing out of State1 then curving back into it (Figure 15.48 of the superstructure specification).

UML 上层结构 2.4.1 的第 15.3.15 节 TransitionKind 给出了内部、局部和外部转换的语义:

Section 15.3.15 TransitionKind of the UML Superstructure 2.4.1 gives the semantics of internal, local and external transitions:

kind=local 意味着转换,如果被触发,将不会退出复合(源)状态,但它会应用于复合状态内的任何状态,并且这些将被退出和进入.

kind=local implies that the transition, if triggered, will not exit the composite (source) state, but it will apply to any state within the composite state, and these will be exited and entered.

由于子状态之间的本地或转换都不会导致退出 State1,图中显示了类似的状态机 - 不同之处在于从 State1.3 开始,第一台机器将重新进入 State1.3(导致其退出和进入要调用的行为),而第二个在触发时不会从 State1.3 执行任何操作.

As neither local nor transitions between sub-states will cause State1 to be exited, the diagrams show similar state machines - the difference being that from State1.3 the first machine will re-enter State1.3 (causing its exit and entry behaviours to be invoked) whereas the second will do nothing from State1.3 on trigger.

这篇关于UML 状态机,本地与外部转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆