Sparx Systems Forum

Enterprise Architect => Bugs and Issues => Topic started by: linexc on November 02, 2021, 11:30:25 pm

Title: Automatic transition using guard
Post by: linexc 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 (https://imgur.com/a/cSCC7cK)
2nd link: https://imgur.com/a/P5FET3t (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
Title: Re: Automatic transition using guard
Post by: Eve 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. ;)
Title: Re: Automatic transition using guard
Post by: qwerty 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.