Loop: running example using DecisionNode and MergeNode and an Integer property in a context

Gallery
Tutorial
Apart from demonstrating DecisionNode and MergeNode used together to create a "manual" loop, this slide shows some additional aspects of Activity Diagrams and has some additional diagnostic outputs for the simulation (play also the mini video below):
Click on the image to view it full size
Watch simulation
video_sim

One could of course side-step the fiddly use of ReadSelfAction ReadStructuralFeatureAction, and AddStructuralFeatureValueAction by using Action Language Helper (ALH) or Action Language for Foundational UML (Alf). Note that Magic Cyber-Systems Engineer ® (Cameo Systems Modeler®) is smart enough here to detect the attribute Property v in the guard v < 5 (so there's no need to use a decisionInputFlow or decisionInput Behavior on the DecisionNode).

For some simpler examples that use the Magic Model Analyst® (Cameo Simulation Toolkit®) popup value entry dialog and the fUML ReadLine CLI visit:

We'll see next how to use the dedicated (and somewhat dreaded) UML LoopNode structured action.

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