umltransitionclass-diagramobject-diagram

UML State Machine: Class diagram of a state with Transitions, Triggers and Events


TL;DR: How should I represent a UML Transition (see next line) in a UML Object Diagram?

event(event_parameters) [guard_condition] / doStuff()

In my BSc thesis project, I am working with UML StateMachines (behavioural, no protocol SMs). Besides the State Machine Diagram representation, I require Object Diagrams.

So far, however, I have not managed to accurately represent transitions. I'd like to be able to show transitions that have a trigger (event), a guard (constraint) and/or behaviour.

I have searched for related questions (this one comes close, but doesn't provide the exact information I'm looking for), as well as read the relevant parts of the UML Superstructure, but still can't quite figure it out.

So far, I've created an Object Diagram based on the state S1 (and all transitions) shown in the State Machine Diagram below. I should note that I have only added events, since guard and behaviour are giving me similar problems (and would clutter the diagram).

State Machine Diagram containing state S1

State Machine Diagram containing state S1

(incorrect) Object Diagram for S1, including all transitions (I'm assuming that at least the SignalEvent instances are (somewhat) incorrect.)

(incorrect) Object Diagram for S1, including all transitions (I'm assuming that at least the SignalEvent instances are (somewhat) incorrect.)


Solution

  • The current UML specification (see https://www.omg.org/spec/UML/) has the answer. It has a diagram that depicts the abstract syntax of state machines. Combined with the abstract syntax of Triggers, the spec provides enough information to create an object diagram.