UML 状态图 + 导航栏 + 多个退出操作

UML Statechart Diagrams + Navigation Bar + Multiple exit actions

希望一切都好!我正在为网站制作 UML 状态图。如果你有一个导航栏,would/can 你有多个退出操作代表每个 link?

似乎只能定义一种退出行为(第 307 页):

14.2.3.4.3 State entry, exit, and doActivity Behaviors A State may have an associated entry Behavior. This Behavior, if defined, is executed whenever the State is entered through an external Transition. In addition, a State may also have an associated exit Behavior, which, if defined, is executed whenever the State is exited.

而且在后面的段落中,他们只用单数来谈论 exit。例如

14.2.3.4.6 Exiting a State When exiting a State, regardless of whether it is simple or composite, the final step involved in the exit, after all other Behaviors associated with the exit are completed, is the execution of the exit Behavior of that State. If the State has a doActivity Behavior that is still executing when the State is exited, that Behavior is aborted before the exit Behavior commences execution.

因此您需要测试 exit 行为中的状态转换以采取相应的操作。

N.B。我正在使用允许定义多个 exit 行为的 Enterprise Architect。无法定义任何守卫来确认我关于只允许一个 exit 的假设。所以这里的实现很可能被破坏了。

正如其他回复中所述,只有一个退出操作。

但是,您可以有多个存在状态的转换(每个导航栏项目一个),每个都有自己的触发器、守卫和行为。

根据您的工作流程,这些可能是自转换(回到相同状态)或进入另一个系统状态。这些也可以是内部的(例如,进行转换时不会退出状态。