The Controller Activity (classifierBehavior of the Controller class)

Gallery
Tutorial
This is the top-level Activity - the classifier Behavior of the Controller class of the same name - that coordinates our demo.
Click on the image to view it full size

It deals ultimately with 2 different kinds of signal events, some for the dialed numbers via a CallBehaviorAction :CatchDialN, and it also watches for attempts to Connect, subject to the dialed number being valid.

Note that there is nothing to explicitly stop the "loop" through :CatchDialN; we are relying on receiving a Connect signal once the number is valid (later we'll see how this is sent from a separate StateMachine).

One can however attempt to Connect at any time, subject to this validation guard, which employs here the Action Language for Foundational UML (Alf) (which requires an additional commercial Alf Plugin):


[this.dialer.number.isValid()]

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 the guard passes, a CallBehaviorAction invokes a usage of the Connect Activity. If, however, the validation guard fails, the ControlEdge with the special [else] guard is taken, and an OpaqueExpression prints a simple warning, before reactivating the CallEventAction for the Connect signal via a shared MergeNode.

Getting this to work properly is tricky due to an "idiosyncrasy" of Magic Model Analyst® (Cameo Simulation Toolkit®) : To get synchronisation of multiple AcceptEventAction "loops" to work in Cameo Simulation Toolkit one sometimes needs an additional ForkNode

We're nearly ready to see the promised StateMachine, but let's look quickly first at the Connect Activity

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