A quick look at accessing an Operation on a Transition or ActivityEdge guard with Alf vs ALH

Gallery
Tutorial

Recall that in the top-level Controller Activity we had a final ActivityEdge with this guard in Action Language for Foundational UML (Alf):


[this.dialer.number.isValid()]

Sweet! Direct UML-friendly access to an Operation, even when it is owned by a deeply nested child part. So how might this look if we instead used the vendor-specific Action Language Helper (ALH) API directly on the guard?

Click on the image to view it full size

Mmmm. Not quite as elegant:


[ALH.callOperation(ALH.getValue(ALH.getValue(self,"dialer"),"number"),"isValid")]

To avoid all of that clumsy navigation we could of course encapsulate it in an OpaqueBehavior and assign it as the 'method' of an additional Operation isNumberValid() on the Controller class, and then slightly less awkwardly access that:


[ALH.callOperation(self,"isNumberValid")]

But it's kind of "cheating", or at best not as elegant as with Action Language for Foundational UML (Alf). Nevertheless, ALH can handle a wide range of cases that the other basic action scripting languages can't.

— END OF TRAIL —
There's only so much that can be shown using slides, so don't miss the matching screencast video that shows it all brought to life using simulation in Magic Model Analyst® (Cameo Simulation Toolkit®) Screencast: Tutorial: UML/SysML: StateMachines vs Activities: Operation-driven Transition case study - UML-2.5.1 'Figure 14.7 Composite State with two States' in Cameo Simulation Toolkit

You may wish to visit one of these tutorials next:

Visit more Systems Modeling Language v1 (SysML®) tutorial trails here.
Visit also these screencast tutorial videos

Please email or phone Webel IT Australia on +61 405 029 008 to arrange On-Site, Off-Site, or Live Online remote web training seminars and workshops.
Up next
Notes
Snippets (quotes/extracts)
Visit also
Visit also (backlinks)
Related slides (includes other tutorials)
Related slides (backlinks, includes other tutorials)