<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://training-course-material.com/index.php?action=history&amp;feed=atom&amp;title=UML_State_Machine_Diagram</id>
	<title>UML State Machine Diagram - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://training-course-material.com/index.php?action=history&amp;feed=atom&amp;title=UML_State_Machine_Diagram"/>
	<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=UML_State_Machine_Diagram&amp;action=history"/>
	<updated>2026-04-24T10:10:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://training-course-material.com/index.php?title=UML_State_Machine_Diagram&amp;diff=30879&amp;oldid=prev</id>
		<title>Filip Stachecki: /* Transition Execution Algorithm⌘ */</title>
		<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=UML_State_Machine_Diagram&amp;diff=30879&amp;oldid=prev"/>
		<updated>2016-04-07T12:39:52Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Transition Execution Algorithm⌘&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:UML Diagrams]]&lt;br /&gt;
==State Machine Diagram⌘==&lt;br /&gt;
[[File:StateMachineDiagram.png |500px]]&lt;br /&gt;
* State machine diagram is a behavior diagram which shows &amp;#039;&amp;#039;&amp;#039;discrete behavior&amp;#039;&amp;#039;&amp;#039; of a part of designed system through finite state transitions. &lt;br /&gt;
* State machine diagrams can also be used to express the valid interaction sequences (&amp;#039;&amp;#039;&amp;#039;protocols&amp;#039;&amp;#039;&amp;#039;) for parts of a system.&lt;br /&gt;
* Two kinds of state machines:&lt;br /&gt;
** behavior state machine,&lt;br /&gt;
** protocol state machine.&lt;br /&gt;
===Behavior State Machine⌘===&lt;br /&gt;
====Vertex⌘====&lt;br /&gt;
* Vertex is named element which is an abstraction of a node (State or Pseudostate) in a state machine graph. &lt;br /&gt;
* It can be the source or destination of any number of transitions.&lt;br /&gt;
&lt;br /&gt;
====State⌘====&lt;br /&gt;
[[File:UMLState.png]]&lt;br /&gt;
* State models a situation during which some invariant condition holds. &lt;br /&gt;
* In most cases this condition is not explicitly defined.&lt;br /&gt;
* Kinds of States:&lt;br /&gt;
** Simple State (has no internal vertices or transitions)&lt;br /&gt;
** Composite State (contains at least one region)&lt;br /&gt;
** Submachine State (refers to an entire State Machine)&lt;br /&gt;
====Transition⌘====&lt;br /&gt;
[[File:StateMachineTransition.png]]&lt;br /&gt;
* Directed relationship between a source vertex and a target vertex.&lt;br /&gt;
* Syntax: &amp;#039;&amp;#039;&amp;#039;[&amp;lt;trigger&amp;gt; [‘,’ &amp;lt;trigger&amp;gt;]* [‘[‘ &amp;lt;guard&amp;gt;’]’] [‘/’ &amp;lt;behavior-expression&amp;gt;]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;trigger&amp;#039;&amp;#039;&amp;#039; specifies events that may cause state transition, &lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;guard&amp;#039;&amp;#039;&amp;#039; is a boolean expression, &lt;br /&gt;
** optional &amp;#039;&amp;#039;&amp;#039;behavior-expression&amp;#039;&amp;#039;&amp;#039; is an expression specifying the effect (is executed when the transition fires)&lt;br /&gt;
=====Transition Kind⌘=====&lt;br /&gt;
[[File:TransitionKind.png]]&lt;br /&gt;
&lt;br /&gt;
The semantics of a Transition depend on its relationship to its source Vertex: &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;external&amp;#039;&amp;#039;&amp;#039; - transition exits its source vertex (executes exit action of source state)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;local&amp;#039;&amp;#039;&amp;#039; - transition does not exit its containing State (exit action of the containing state will not be executed)&lt;br /&gt;
** Target vertex may be different from its source Vertex. &lt;br /&gt;
** Local transition can only exist within a composite State.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;internal&amp;#039;&amp;#039;&amp;#039; is a special case of a local transition with the same source and target states, &lt;br /&gt;
** the state is never exited (and not re-entered)&lt;br /&gt;
** no exit or entry actions are executed&lt;br /&gt;
=====Internal Behaviors⌘=====&lt;br /&gt;
[[File:ClipCapIt-141128-162303.PNG]]&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;entry&amp;#039;&amp;#039;&amp;#039; - a Behavior which is performed upon entry to the State (entry Behavior).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;do&amp;#039;&amp;#039;&amp;#039; - an ongoing Behavior (doActivity Behavior) that is performed as long as the modeled element is in the State or until the computation specified by the expression is completed.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;exit&amp;#039;&amp;#039;&amp;#039; - a Behavior that is performed upon exit from the State (exit Behavior).&lt;br /&gt;
&lt;br /&gt;
=====Completion Transitions, completion events⌘=====&lt;br /&gt;
[[File:CompletionTransition.png]]&lt;br /&gt;
* Completion transition has an implicit trigger (may have a guard). &lt;br /&gt;
* Completion event enables this trigger if all actions associated with the source state have completed execution:&lt;br /&gt;
** In simple states: a completion event is generated when the associated entry and doActivity actions have completed executing.&lt;br /&gt;
** In composite or submachine states: a completion event is generated when:&lt;br /&gt;
*** all internal activities have completed execution, and&lt;br /&gt;
*** if the state is a composite state, all its orthogonal regions have reached a final state, or&lt;br /&gt;
*** if the State is a submachine State, the submachine State Machine execution has reached a final state.&lt;br /&gt;
&lt;br /&gt;
====Pseudo State⌘====&lt;br /&gt;
[[File:PseudoStates.png]]&lt;br /&gt;
* Pseudostate is an abstract vertex that describes different types of transient vertices in the state machine graph.&lt;br /&gt;
* Pseudostates are transitive - a compound transition execution simply passes through them, arriving on an incoming Transition and leaving on an outgoing Transition &amp;#039;&amp;#039;&amp;#039;without pause&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
=====Initial ⌘=====&lt;br /&gt;
[[File:PseudoStateInitial.png]]&lt;br /&gt;
* Initial Pseudostate represents a starting point for a Region.&lt;br /&gt;
* It is the source for at most one Transition, which may have an associated effect Behavior, but not an associated trigger or guard. &lt;br /&gt;
* There can be at most one initial Vertex in a Region.&lt;br /&gt;
=====Choice⌘=====&lt;br /&gt;
[[File:PseudoStateChoice.png]]&lt;br /&gt;
*Choice is used to realize a dynamic conditional branch.&lt;br /&gt;
* It allows splitting of compound transitions into multiple alternative paths.&lt;br /&gt;
* The decision on which path to take may depend on the results of Behavior executions performed in the same compound transition prior to reaching the choice point. &lt;br /&gt;
*If more than one guard evaluates to true, one of the corresponding Transitions is selected.&lt;br /&gt;
*If none of the guards evaluates to true, then the model is considered ill formed&lt;br /&gt;
&lt;br /&gt;
=====Junction ⌘=====&lt;br /&gt;
[[File:PseudoStateJunction.png]]&lt;br /&gt;
* Junction can be used to merge multiple incoming Transitions into a single outgoing Transition or, &lt;br /&gt;
* it can be used to split an incoming Transition into multiple outgoing Transition segments with different guard Constraints.&lt;br /&gt;
* Such guard Constraints are evaluated before any compound transition containing this Pseudostate is executed, which is why this is referred to as a static conditional branch.&lt;br /&gt;
&lt;br /&gt;
=====Fork⌘=====&lt;br /&gt;
[[File:PseudoStateFork.png]]&lt;br /&gt;
* Splits an incoming Transition into two or more Transitions terminating on Vertices in orthogonal Regions of a composite State. &lt;br /&gt;
* The Transitions outgoing from a &amp;#039;&amp;#039;&amp;#039;Fork&amp;#039;&amp;#039;&amp;#039; cannot have a guard or a trigger.&lt;br /&gt;
&lt;br /&gt;
=====Join⌘=====&lt;br /&gt;
[[File:PseudoStateJoin.png]]&lt;br /&gt;
* Common target Vertex for two or more Transitions originating from Vertices in different orthogonal Regions. &lt;br /&gt;
* Transitions terminating on a &amp;#039;&amp;#039;&amp;#039;Join&amp;#039;&amp;#039;&amp;#039; cannot have a guard or a trigger.&lt;br /&gt;
&lt;br /&gt;
=====Terminate ⌘=====&lt;br /&gt;
[[File:PseudoStateTerminate.png]]&lt;br /&gt;
* Execution of the State Machine is terminated immediately. &lt;br /&gt;
* The State Machine does not exit any States nor does it perform any exit Behaviors. Any executing doActivity Behaviors are automatically aborted.&lt;br /&gt;
&lt;br /&gt;
=====Entry Point ⌘=====&lt;br /&gt;
[[File:PseudoStateEntry.png]]&lt;br /&gt;
* Represents an entry point for a State Machine or a composite State that provides encapsulation of the insides of the State or StateMachine. &lt;br /&gt;
* In each Region of the StateMachine or composite State owning the Entry Point, there is at most a single Transition from the entry point to a Vertex within that Region.&lt;br /&gt;
&lt;br /&gt;
If the owning State has an associated entry Behavior, this Behavior is executed before any behavior associated with the outgoing Transition. If multiple Regions are involved, the entry point acts as a fork Pseudostate.&lt;br /&gt;
&lt;br /&gt;
=====Exit Point ⌘=====&lt;br /&gt;
[[File:PseudoStateExit.png]]&lt;br /&gt;
* Represents an exit point of a StateMachine or composite State that provides encapsulation of the insides of the State or State Machine. &lt;br /&gt;
* Transitions terminating on an exit point within any Region of the composite State or a State Machine referenced by a submachine State implies exiting of this composite State or submachine State (with execution of its associated exit Behavior). &lt;br /&gt;
&lt;br /&gt;
If multiple Transitions from orthogonal Regions within the State terminate on this Pseudostate, then it acts like a join Psuedostate.&lt;br /&gt;
=====Shallow History⌘=====&lt;br /&gt;
[[File:PseudoStateSHistory.png]]&lt;br /&gt;
* Represents the most recent &amp;#039;&amp;#039;&amp;#039;active substate&amp;#039;&amp;#039;&amp;#039; of its containing Region, but not the substates of that substate. &lt;br /&gt;
* Transition terminating on this Pseudostate implies restoring the Region to that substate. &lt;br /&gt;
* A single outgoing Transition from this Pseudostate may be defined terminating on a substate of the composite State. &lt;br /&gt;
* Shallow History can only be defined for composite States and, at most one such Pseudostate can be included in a Region of a composite State.&lt;br /&gt;
=====Deep History⌘=====&lt;br /&gt;
[[File:PseudoStateDHistory.png]]&lt;br /&gt;
* Represents the most recent &amp;#039;&amp;#039;&amp;#039;active state configuration&amp;#039;&amp;#039;&amp;#039; of its owning Region. &lt;br /&gt;
* Transition terminating on this Pseudostate implies restoring the Region to that same state configuration. &lt;br /&gt;
* The entry Behaviors of all States in the restored state configuration are performed in the appropriate order starting with the outermost State. &lt;br /&gt;
* Deep History Pseudostate can only be defined for composite States and, at most one such Pseudostate can be contained in a Region of a composite State.&lt;br /&gt;
&lt;br /&gt;
====Final State⌘====&lt;br /&gt;
[[File:FinalState.png]]&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Final State&amp;#039;&amp;#039;&amp;#039; is a special kind of State (not Pseudo State) signifying that the enclosing Region has completed. &lt;br /&gt;
* Transition to a Final State represents the completion of the behaviors of the Region containing the Final State.&lt;br /&gt;
&lt;br /&gt;
===Event Processing for State Machines⌘===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;The run-to-completion paradigm&amp;#039;&amp;#039;&amp;#039; (in general)&lt;br /&gt;
* State Machine will perform its initialization during which it executes an initial transition, after which it enters a wait point. &lt;br /&gt;
* A wait point is represented by a stable state configuration. It remains thus until an Event stored in its event pool is dispatched. &lt;br /&gt;
* This Event is evaluated and a single State Machine step is executed. &lt;br /&gt;
* A step involves executing a transition and terminating on a stable state configuration (i.e., the next wait point). &lt;br /&gt;
* This cycle then repeats until the State Machine completes its Behavior.&lt;br /&gt;
* Event occurrences are detected, dispatched, and processed by the State Machine execution, one at a time.&lt;br /&gt;
===Transition Execution Algorithm⌘===&lt;br /&gt;
[[File:SMTransitionExecutionAlgorithm.png]]&lt;br /&gt;
&amp;lt;!-- xS11; t1; xS1; t2; eT1; eT11; t3; eT111 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Protocol State Machine⌘===&lt;br /&gt;
[[File:ProtocolStateMachine.png]]&lt;br /&gt;
* Is always defined in the context of a classifier.&lt;br /&gt;
* Specify allowed invocation sequences (lifecycle of a classifier).&lt;br /&gt;
* Describes which operations of the classifier can be called in which state and under which condition.&lt;br /&gt;
====Protocol State⌘====&lt;br /&gt;
* A protocol State represents an exposed stable situation of its context Classifier.&lt;br /&gt;
* The States of a ProtocolStateMachine cannot have defined entry, exit, or doActivity actions.&lt;br /&gt;
====Protocol Transition⌘====&lt;br /&gt;
[[File:ProtocolTransition.png]]&lt;br /&gt;
* A Protocol Transition specifies a legal Transition for an operation of the context Classifier.&lt;br /&gt;
* Syntax: &amp;#039;&amp;#039;&amp;#039;[precondition] event / [postcondition]&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;</summary>
		<author><name>Filip Stachecki</name></author>
	</entry>
</feed>