SysMLv1: Cameo Simulation Toolkit: StateMachine simulation: Transition with a guard tested against a value property [with mini video]

Gallery
Tutorial
In the following BDD fragment, Activity Diagram, and StateMachine setup, if the state machine is initialised and in 'StateA', what stable state will the state machine be in after receiving the following signal events: 'AtoB', 'BtoA', 'AtoB', 'BtoA', 'AtoB', 'BtoA'?
Click on the image to view it full size
Watch simulation
video_sim
Watch a high resolution version of the video on Vimeo.
Each time the statemachine transitions to 'StateB' the value property 'i' (which starts at i=0) from the context block 'HasValueAndSTM' is incremented. The 'StateB' is entered 3 times via 'AtoB' Transitions. After the 3rd 'BtoA' Transition back to 'StateA', the guard condition [i > 2] for the Transition from 'StateB' to 'StateC' will evaluate True, so a Transition will be immediately taken from 'StateB' to the stable 'StateC'. The guarded Transition to 'StateC' has an OpaqueBehavior as effect Behavior with body print("i > 2").
Up next
Notes
Snippets (quotes/extracts)
Related slides (includes other tutorials)
Related slides (backlinks, includes other tutorials)
Visit also
Visit also (backlinks)
External links