3

This is not a problem but more of a fundamental question, that I know will have been implemented differently by each of the tool suppliers, so I want what people believe to be the intended behaviour by the OMG UML/SysML working groups.

In the following image of a complex state, and I know there are a lot of untriggered and only guarded transitions. Is the do behaviour of the state Motion::Active::Debounce trigger if the guard on the exiting transition is true before the entry behaviour is completed?

enter image description here

Or, would you model this in a different manner?

1
  • any by-passers: read Axel's answer. Commented Jan 4, 2024 at 10:31

2 Answers 2

1

Yes. The do-behavior will be executed completely.

Here is the explanation: What you call an "untriggered" transition is in fact a transition without explicit trigger.

UML 2.5.: A special kind of Transition is a completion Transition, which has an implicit trigger. The event that enables this trigger is called a completion event and it signifies that all Behaviors associated with the source State of the completion Transition have completed execution.

All behaviors means:

UML 2.5: a completion event is generated when the associated entry and doActivity Behaviors have completed executing.

The time when the guard becomes true has no significance for the transition. It is a guard and as such will be evaluated only once at the moment the event triggering the transition is dispatched. Since this event is the completion of the do-behavior, the do-behavior will complete before the guard is evaluated.

Sign up to request clarification or add additional context in comments.

Comments

0

The UML 2.5.1 spec states on p. 309:

14.2.3.4.3 State entry, exit, and doActivity Behaviors

[...]

A State may also have an associated doActivity Behavior. This Behavior commences execution when the State is entered (but only after the State entry Behavior has completed) and executes concurrently with any other Behaviors that may be associated with the State, until:

  • it completes (in which case a completion event is generated) or
  • the State is exited, in which case execution of the doActivity Behavior is aborted.

The execution of a doActivity Behavior of a State is not affected by the firing of an internal Transition of that State.

So: the doActivity will be triggered but aborted immediately since the exit condition is true. In other words: it will not run.

10 Comments

Specs "commences execution when the State is entered (but only after the State entry Behavior has completed)" vs narrative "if the guard on the exiting transition is true before the entry behaviour is completed". Doesn't this mean that the do behavior is not even started in this situation?
@Christophe Well, that's what I said. I you shoot the sprinter at the start he's not really running a millimeter. I amended the last sentence.
The emphasis wad on "(but only after state entry behavior has completed)". Let me reformulate the question: isn't the entry activity aborted if the exit conditions are met? (i.e. then the entry behavior would never complete and hence the do would never start - which I agree, is very similar to your conclusion, although with a slightly different reasoning).
@Christophe No, the entry is completed. Only the doActivity is aborted. The OP asked about the latter.
Ok! Now I get it ! Thanks :)
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.