StateMachine for the Dialer class

Gallery
Tutorial
We're now ready to examine our representation of the StateMachine portion represented in UML-2.5.1 Figure 14.7 Composite State with two States, but it easiest to embed the composite state Dialing in another StateMachine (which is the classifier Behavior of the Dialer class) as shown:
Click on the image to view it full size

The composite state Dialing is entered via a Transition from an initial Pseudostate, and then in turn there is a Transition from its own initial Pseudostate to the Start state.

On entry to the Start State an Activity (Behavior) StartDialTone will be invoked (it's trivial and just prints a message using an OpaqueAction). When a Transition out of that State is taken the exit Activity (Behavior) StartDialTone will similarly be invoked to print a message.

The Transition from Start to PartialDial has a CallEvent trigger for the Operation digit(n:int), which is owned by the context class Dialer. On entry to the State PartialDial the Activity (Behavior) number.append will be invoked. (Recall the name number.append was "hacked" to try to mimic the spec figure.)

There is a nearly identical self-Transition, also with a CallEvent trigger for the Operation digit(n:int), except it will also cause the invocation of the number.print Activity each time on exit of the state PartialDial.

The Transition from PartialDial to the FinalState within Dialing can only be taken if a guard evaluates, and once again Action Language for Foundational UML (Alf) has been used.

To learn how to access an operation on a guard without Action Language for Foundational UML (Alf) using the Action Language Helper (ALH) please visit this separate tutorial slide.

If that Transition is taken, not only will it invoke the number.print Activity as exit Behavior, it will also invoke an additional effect Behavior, an Activity WhenValid (which we'll see shortly also sends a Connect signal).

But let's examine the other Activities first

Up next
Notes
Snippets (quotes/extracts)
Visit also
Visit also (backlinks)
Related slides (includes other tutorials)
Related slides (backlinks, includes other tutorials)