Raise event after n seconds?

144 views
Skip to first unread message

Brian Beckman

unread,
Mar 9, 2016, 12:36:26 PM3/9/16
to YAKINDU User
Hello -- I am trying to model a system with two concurrent regions. In one region, a timer counts down. When the timer expires, I intend for it to raise an event that causes the other region to transition. The following statechart illustrates my intent.  As you can see, the ok_to_go event for some reason does not make it over into the main region, or the event doesn't trigger the transition for some reason, I don't know.  My questions are the following:

1. Did I model my intent correctly and effectively (in good style)?
2. If the answer to question 1 is yes, do I have some syntactical or other error in my chart?
3. If the answer to question 2 is yes, how do I fix it?
4. If the answer to question 1 is no, what's a better model for my intent?
5. Finally, I'd be grateful for advice on how to debug models like this: I stared at it for a long time and I don't see my mistakes.

Brian Beckman

unread,
Mar 9, 2016, 12:41:47 PM3/9/16
to YAKINDU User
I managed to solve my problem by changing from raising an event to toggling a variable

Auto Generated Inline Image 1

Thomas Kutz

unread,
Mar 10, 2016, 5:17:56 AM3/10/16
to YAKINDU User
Hello,

the problematic aspect is not the time trigger but the communication between two different regions.

Basically, regions are executed in a deterministic order. So probably your main region is processed before the event is raised and removed from the event queue again. 

Message has been deleted
Message has been deleted

Johannes Dicks

unread,
Mar 16, 2016, 8:44:21 AM3/16/16
to YAKINDU User
Hi Brian,
you might be interested in voting for https://github.com/Yakindu/statecharts/issues/475 which deals with the same aspect.

Regards,
Johannes
Reply all
Reply to author
Forward
0 new messages