The number.print Activity as exit Behavior for the PartialDial State

Gallery
Tutorial
Recall that:
The Activity name number.print was contrived to match the (seemingly equally contrived) notation used in the UML-2.5.1 spec Figure 14.7, it is NOT a recommended Activity name!
Click on the image to view it full size

This Activity is called as the exit Behavior of the State Dialing. It will be invoked both on firing of the self-Transition used to append new digits and on firing of the final "exit" Transition when the accumulated digits are judged to be valid.

If you've been following this tutorial you'll already know the sequence of InitialNode, ReadSelfAction, and ReadStructuralFeatureAction to get at number:Number - noting that the context class here is Dialer. Then a CallOperationAction is used to execute the operation print(), which just uses as method an OpaqueBehavior printNumber that uses BeanShell as the action language:


print("Number:+n);

Note how it "magically" has access to n:int[0..*] within class Number!

Now let's see how to check whether the accumulated digits are valid (so we can try to connect)

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