Betty Crokker
Betty Crokker

Reputation: 3351

UML State Diagram - Enter State without invoking Entry Functions

I'm trying to draw a UML state diagram with these features:

  1. State A transitions to State B on Trigger X
  2. State B has an Entry Action "OnEntry"
  3. When in State B and you receive Trigger Y, you stay in State B (without invoking the Entry Action)

I want to include Trigger Y in the state diagram so it's explicit that it's valid during State B.

How can I do this?

Upvotes: 1

Views: 136

Answers (1)

qwerty_so
qwerty_so

Reputation: 36313

I have to confess that state machines are not really my strength. However,

enter image description here

trigger Y does not exit state B. Thus the state stays the same. And thus the onEntry will not be executed.

The specs state (p. 307):

14.2.3.4.3 State entry, exit, and doActivity Behaviors A State may have an associated entry Behavior. This Behavior, if defined, is executed whenever the State is entered through an external Transition. In addition, a State may also have an associated exit Behavior, which, if defined, is executed whenever the State is exited.

Upvotes: 2

Related Questions