Tags and keywords
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'?
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").