State Machine - ChangeEvent after guard failure

Moderator: Moderators

State Machine - ChangeEvent after guard failure

Postby samuel.ulens@alten.com » Wed Nov 17, 2021 8:14 am

Hello,
I'm having an issue on a state machine transition triggered by a ChangeEvent and guarded with a boolean expression.

If the ChangeEvent trigger the transition and the guard is then evaluated to true then the state machine pass to the next state.
If the ChangeEvent trigger the transition and the guard is then evaluated to false then the state machine don't pass to the next state.
so far no problem...
But in the case of a precedent guard failure, it is then impossible to make the ChangeEvent occuring again (it is not detected). The only way i found to solve this is to leave and enter back in the state (transition to self for example) to reset the detection of the ChangeEvent (but it is adding some useless complexity to the model).

Their is no similar issue if the transition is triggered by a signal.

Do I have to change some parameters of the transition or do you have any best solution?


Thanks in advance for your help.


PS: In the example attached, this situation corresponds to being in state A, changing X1 to false with X being false, then changing X to true and then changing X1 back to true and then to false again.
You do not have the required permissions to view the files attached to this post.
samuel.ulens@alten.com
Forum Newbie
Forum Newbie
 
Posts: 2
Posts Rating:0
Joined: Wed Nov 17, 2021 7:44 am

Re: State Machine - ChangeEvent after guard failure

Postby saulius_p » Wed Nov 17, 2021 4:40 pm

Hello Samuel,

Good to talk to you.

This is an issue when using ChangeEvent and Guard on the same transition. When the change event is triggered (false --> true), it has been sent and consumed from the event pool, but a guard blocks it to transition. However, the change event cannot trigger again (because it thinks that it is already triggered).

We will fix this in future versions.

For workaround, should combine a guard into the change event (not allow to use both change event and guard together).

Kind regards,
Saulius
Best regards,
Saulius Pavalkis
User avatar
saulius_p
No Magic
No Magic
 
Posts: 345
Posts Rating:17
Joined: Fri Dec 04, 2009 5:37 am
Full name: Saulius Pavalkis

Re: State Machine - ChangeEvent after guard failure

Postby samuel.ulens@alten.com » Thu Nov 18, 2021 12:27 am

Hello Saulius,

Thanks a lot for your fast answer, I can now understand clearly the cause of this issue. Thank you very much also for all your demonstration videos, it helps me a lot in my work and my learning.

Kind regards,

Samuel
samuel.ulens@alten.com
Forum Newbie
Forum Newbie
 
Posts: 2
Posts Rating:0
Joined: Wed Nov 17, 2021 7:44 am


Return to Cameo Simulation Toolkits

Who is online

Users browsing this forum: No registered users and 0 guests