Consider the following History state machine:
When the code below is run ...
machine.create();
machine.check();
machine.stop();
machine generates the following output:
01 DEBUG : current state is now .History.Outer
02 DEBUG : execute entry behavior of .History.Outer
03 Entry behavior Outer
04 DEBUG : current state is now .History.Outer.Inner
05 DEBUG : execute entry behavior of .History.Outer.Inner
06 Entry behavior Inner
07 DEBUG : fire trigger check
08 DEBUG : execute exit behavior of .History.Outer
09 Exit behavior Outer
10 DEBUG : current state is now .History
11 DEBUG : current state is now .History.Outer
12 DEBUG : fire trigger stop
13 DEBUG : execute exit behavior of .History.Outer
14 Exit behavior Outer
15 DEBUG : current state is now .History
16 DEBUG : final state reached
I see two issues with this output.First, according to the UML specification, paragraph 14.2.3.4.6 Exiting a State
When exiting from a composite State, exit commences with the innermost State in the active state configuration. This means that exit Behaviors are executed in sequence starting with the innermost active State.
But after trigger check is fired (line 07), only Outer's state exit behavior is executed (lines 08 and 09). Exit behaviour of Inner never executes.
Second, according to paragraph 14.2.3.4.4 State History
Deep history ( deepHistory ) represents the full state configuration of the most recent visit to the containing Region. The effect is the same as if the Transition terminating on the deepHistory Pseudostate had, instead, terminated on the innermost State of the preserved state configuration, including execution of all entry Behaviors encountered along the way.
Thus I would expect to see a copy of lines 02-06 after line 11.
Am I right?
