4

Is that correct way to define multiple selection? When I want to define selections like in menu? can decision node have many outputs? like this?

bruno
  • 32,421
  • 7
  • 25
  • 37
AlmostAI
  • 327
  • 4
  • 14

2 Answers2

5

Yes, you can have any number of outgoing flows. But note, that the label of a decision should not be an action and that each outgoing flow should have a guard condition. The common part of all guards may be used as a decision label.

activity diagram

www.admiraalit.nl
  • 5,768
  • 1
  • 17
  • 32
  • thanks, and what about quotes around guardes, is it just an optional choice? – AlmostAI May 02 '19 at 16:27
  • 1
    Yes. A guard is a boolean expression, e.g. choice = 'Save'. In this example, the first part is written in the decision symbol. The recommended expression language in UML diagrams is OCL (Object Constraint Language), but I know very little about OCL. – www.admiraalit.nl May 02 '19 at 22:24
  • 1
    I still don't see much progress around in using OCL except in academic circles. Reading it is rather ok, but writing the correct OCL syntax is a pain. Unless you don't have a code generator plain text is more than enough. My 2 cents. – qwerty_so May 03 '19 at 06:28
4

Yes, you can add as many outgoing edges as you need: https://www.uml-diagrams.org/activity-diagrams-controls.html#decision-node

kvitaliy
  • 191
  • 1
  • 2
  • 5
  • 1
    You should mention that there need to be guards on each vertex since without it's random where the flow will go. – qwerty_so May 02 '19 at 04:42