UML state machine: How to exit orthogonal child regions?

浪子不回头ぞ 提交于 2019-12-05 23:48:41

A completion transition from the orthogonal state will do the trick, since it will be taken when all of the orthogonal regions have finished.

When an composite state (state with inner states and/or orthogonal regions) is entered, each region starts at its initial state, to a different state in each region using fork pseudonodes, or to the last state of each region if the state is entered through a history pseudostate. Exiting the composite state can be done through a transition that starts at one of the inner states, which exists all of the orthogonal regions from their current state. If you want to exit when a the machine has come to a set of states in different regions, you can also use join pseudostates.

As you can see, the possibilities are almost endless. I can't add an image yet, but I'll do it later when I have a good UML editor at hand.

An now the example. Suppose you have the following state machine:

  1. If both parallel regions finish (arrive at a final node), then the completion transition will take the machine from S1 to S5. If the
  2. If the machine is currently at S3 and receives e1, it will exit S1 and go to S6.
  3. If the machine is in S7 and S8 and they both finish, it will go to the join and then to S6.

This is the way I know state machines work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!