Tags and keywords
Dialing
in another StateMachine (which is the classifier Behavior of the Dialer
class) as shown: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.
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).