Author Topic: Automatic transition using guard  (Read 7413 times)

linexc

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Automatic transition using guard
« on: November 02, 2021, 11:30:25 pm »
Dear Community,

I got a problem when I tried simulating a state machine using EA14. As what you can find in the 1st link below, the state machine cannot switch from state3 to state2 automatically, if I fired the trigger "start" and afterwards altered the [guard1] to true.
In the 2nd link, after the simulation starts, the superstate state1 cannot switch to state2, even when[guard1] is true.

1st link: https://imgur.com/a/cSCC7cK
2nd link: https://imgur.com/a/P5FET3t

Based on my understanding, this transition can occur anytime automatically, if the [guard1] is true. But it does not work on my laptop.

Thanks in advance if you have any idea.

BG
Linexc
« Last Edit: November 02, 2021, 11:42:26 pm by linexc »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Automatic transition using guard
« Reply #1 on: November 03, 2021, 09:09:48 am »
I don't believe the UML specification intends for this transition to be traversed if the guard becomes true after the previous state is complete.

A transition without an explicit trigger specified is considered a completion Transition. It has an implicit trigger for the completion event of the source state. However, if that event behaves like every other event it will be discarded if it doesn't cause a transition to be traversed. Normal triggers can be added to the states deferrableTrigger list, but because the completion event is implicit I don't think it can.

I imagine a UML way of handling that would be to raise an event in the entry behavior (of an empty state) and specify that the event is deferrable.

Today's episode of Eve's lectures is brought to by UML 2.5.1 and Sections 14.2.3.8 and 14.5.9.6. ;)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Automatic transition using guard
« Reply #2 on: November 03, 2021, 09:22:23 am »
You should be on StackOverflow as well. There are really few people that have deep knowledge of state machines. Honestly there are not sooo many questions, but it would be nice to see them answered profoundly.

q.