3

I am new to UML, regrading FSM diagram, how to represent two transitions that lead to same state, for example, I'm in state1:

when(event1)-->action1-->state2
when(event2)-->action2-->state2

I mean do I need to draw two lines from state1 to state2?

Kevin
  • 5,626
  • 3
  • 28
  • 41
Hakim83
  • 59
  • 4

1 Answers1

2

Yes, you have to draw two lines since the event and action is part of the line.

as you can see in http://en.wikipedia.org/wiki/File:UML_state_machine_Fig1.png

your line will get a text like "event1 / action1" and "event2 / action2".

If you don't generate code from your diagram, you can also use one line and add a text like "event1 / action1 OR event2 / action2" if this is more readable.

I consider UML as a guide - sometimes you have to change the rules a little bit in order to create something readable and useful. :-)

rdmueller
  • 10,742
  • 10
  • 69
  • 126
  • 1
    (+1) @Ralf. The answer is good. But, I would give an extra (+1) for "UML as a Guide". For example, In Activity charts, I make a different decision node for: (a) Many incoming arrows, one outcoming arrow, (b) Single incoming arrow, many outcoming arrows. Even if UML allows to have many-to-many. And I fill gray (b). – umlcat Jun 14 '11 at 16:56