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


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


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:


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:


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.

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 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 (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 remote web training seminars and workshops
Up next
Snippets (quotes/extracts)
Visit also
Visit also (backlinks)
Related slides (other tutorials)
Related slides (other tutorials, backlinks)