itemisCREATE / statecharts

YAKINDU Statechart Tools (http://www.statecharts.org)
Eclipse Public License 1.0
175 stars 85 forks source link

Possible outgoing transitions from history states #3101

Closed z3rone closed 4 years ago

z3rone commented 4 years ago

observation When hovering with the cursor over a history state, it gives the option to add an outgoing transition. Also there is no suggestion to add an incoming transition, as there is with simple states.

Outgoing transitions from history states do not make sense. Even though they seem to be completely ignored during execution, they could be confusing.

expected behavior The editor should give a warning, similar to the 'Initial entry should not have incoming transition.' warning, that history states should not have outgoing transitions. Also the outgoing transition option should not appear when hovering over a history state.

Software version: 3.5.11 OS: Windows 10 Java version: 1.8.0_251 Java(TM) SE Runtime Environment (build 1.8.0_251-b08) Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)

tkutz commented 4 years ago

A history state may have one outgoing transition. This transition denotes the default state that is activated when there is no state history yet. See also the description from UML (https://www.uml-diagrams.org/state-machine-diagrams.html#shallow-history-pseudostate):

At most one transition may originate from the history connector to the default shallow history state. This transition is taken in case the composite state had never been active before.

In Yakindu Statechart Tools, history nodes are just special entry nodes. In fact, you can also have just a history node without any incoming transition. Then, this history node acts as the default entry for its composite state when it is entered the first time. Bildschirmfoto 2020-06-03 um 13 28 51