How to return to a state when EventDriven and using SuperSteps?

21 views
Skip to first unread message

rabrab

unread,
Jun 24, 2021, 11:41:47 AM6/24/21
to YAKINDU User
Situation:
@EventDriven is on and 
@SuperSteps is yes.

Imagine two states. We're in state A.
There is a transition for an event, called "moveIt"
Now we're in state B.
There is a transition "always" from B to A.

This results in an endless loop.
But how can I "disarm" the "moveIt" event in my "always" transition, in order to stop any more transitions from A to B again and again and again?



Thomas Kutz

unread,
Jun 25, 2021, 2:49:16 AM6/25/21
to YAKINDU User
This is because super-steps are enabled. The event will be active as long as no state transition is taken anymore. You can check for events in guard conditions. There, events are treated like booleans, so you can use them in logical expressions, hence you can express something like this "always [!moveit]" to only take the transition when moveit is not active.

rabrab

unread,
Jul 7, 2021, 10:00:08 AM7/7/21
to YAKINDU User
Thanks, Thomas.

I guess my problem lies in the opposite direction: I need to deactivate (or discard) the event in one state to break the loop.

When I try your hint, always[!moveit] effectively disables that "always" transition, because I can't get rid of the "moveit" event. 
"moveit" is always there when I have two states pointing to each other.

Thomas Kutz

unread,
Jul 9, 2021, 5:20:34 AM7/9/21
to YAKINDU User
This should not be the case. As soon as no transition can be taken anymore, the super step ends, and all events are disabled. Do you have a model or image so I can reproduce (and better understand) the problem?
Reply all
Reply to author
Forward
0 new messages