-
Notifications
You must be signed in to change notification settings - Fork 86
firing of transition with guard only ? #3209
Comments
From my understanding, Yakindu does not behave differently from SCXML nor Rhapsody in that regard. Setting a variable is not triggering a run-to-completion step (or what is called macrostep in the SCXML doc). I think the Rhapsody documentation is just not clear in their wording. They also say "...all guards without triggers are tested every time an event happens". And further down, "Each time this event occurs, the state machine evaluates the two guards...". Omitting the event on the transition just means that it is checked for every event that occurs, but it still needs some event to occur. If you don't want to have events triggering a run-to-completion step, you can use the |
Dear Thomas, thanks for the answer. I'm still not sure since in the SCXML spec, at the link I provided, you can read (excerpt)
From this I understood that it should be fired. Also in Rhapsody since "The low-to-high transition of the condition (or Boolean value) is considered to be the triggering event" then the bold part of your comment should also encompass the low-to-high transition of the condition. I know I can use Finally, the very same model in the SCXML Qt editor (https://doc.qt.io/qt-5/qtscxml-index.html) provides a different result (it ends in |
Okay, I read the SCXML docs again and my understanding now is that event-less (NULL) transitions are taken at the end of a macrostep when all other events are consumed. Consider this example: When In Rhapsody, things might be different. I don't know enough about Rhapsody, but it is possible that changing a property value is considered being an event that triggers a step. So yes, Yakindu behaves differently. In That said, you can do the following to get closer to the desired behavior: |
Dear Thomas, thanks for the clear explanations. I'll read about superstep semantics. A last minor question to see if it is a workaround. Considering changing a value in an event-less guard from the code (the setter from the SCInterface). Is it safe to explicitly invoke the thanks again |
Yes, that sounds like a valid workaround for me. |
Providing triggers derived from variable changes makes sense. Here is an excerpt of an internal task (which is not scheduled yet):
|
thanks for the complementary answer. This is quite interesting. just a personal feeling: I'm not sure if there are situations where this is not the case and where we want to choose transition by transition the semantics to be applied. It is also worth noticing that in this case it seems that we can always specify explicitly the trigger (e.g., my two cents |
Dear Yakindu experts,
I have an issue with simple statecharts like this one:
In Yakindu
@EventDriven
mode, even iftest
is initialized totrue
then the state charts stays instateA
. When initialized atfalse
and changed totrue
then it still rests instateA
.I'm wondering what is the expected behavior. In the SCXML specifications transitions with guard only are enabled if the condition is becoming true: https://www.w3.org/TR/2015/REC-scxml-20150901/#SelectingTransitions ; and is fired during any macro step.
In Rhapsody the semantics seems to be the one of SCXML also and is resumed as: "A transition can consist of only a guard. The low-to-high transition of the condition (or Boolean value) is considered to be the triggering event" (https://www.ibm.com/support/knowledgecenter/SSB2MU_8.3.0/com.ibm.rhp.uml.diagrams.doc/topics/rhp_t_dm_spfing_guard.html). All my students are actually expecting this behavior and myself too.
In the generated java code, it is always possible to as explicitly for a run cycle after each variable set but my intuitive understanding is that it should be done in the setter.
Could you please clarify the semantics followed by Yakindu and its rational ?
thanks in advance
The text was updated successfully, but these errors were encountered: