UML State Machine ShallowHistory
I would like to know if I understood the ShallowHistory syntax correctly or not.
Is this the right way to use it?
The UML specification. it is said to be used in place of the initial psuedo state. My guess is that in this case there will be no memory reset of State1, while in this case the transition from State0 always starts from State1.1. I'm right?
source to share
Your interpretation seems correct. From the add-in:
When entering a composite state, the following cases are differentiated:
• Default entry: This is graphically indicated by an incoming transition that ends at the outer edge of the composite state. In this case, the default input rule is applied (see Semantic variation point (default input rule)).
AND
Semantic Change Point (Default Input Rule)
If the transition ends in an enclosing state, and the enclosed regions do not have an initial pseudostat, the interpretation of this situation is a semantic variation point. In some interpretations, this is considered a poorly formed model. That is, in these cases, the original pseudo-stat is required. An alternative interpretation allows this situation, which means that with such a transition, the state machine remains in a composite state, without entering any of the regions or their substations.
Finally:
Invalid history entry: if the transition ends on a shallow history pseudostat, the active substation becomes the most recent active subtest before this entry, unless the last active substation is the final state or if it is the first entry to this state. In the last two cases, the default history state is entered. It is a substation that is the target of a transition originating from the history pseudo-stat. (If no such transition is specified, the situation is undefined and its handling is undefined.) If the active subnets identified by history is a composite state, then it continues with its default.
Note that from the last paragraph, it looks like you should ALWAYS have a transition from the pseudo-stat H
to at least the same state indicated by the pseudo-stat initial
, otherwise you might have a flawed machine.
I didn't find where it says you can use H * instead of the initial pseudo-state. Where did you see this?
source to share