Reputation: 2813
In an UML state diagram, branches in the process flow can be modeled using choice elements (represented by a diamond-shaped symbol) with conditions on the outgoing transitions (see example).
On the other hand, junction elements (represented by a filled circle) can be used to merge several incoming transitions and/or split the process flow into several outgoing transitions, which may also have conditions (see example).
So is a junction really a generalisation of a choice? Is there a situation in which you must use a choice and could not use a junction?
Upvotes: 3
Views: 2259
Reputation: 3506
According to UML 2.5.1 specification, section 14.2.3.7, the difference between junction or choice outgoing transition's is when their associated guard is evaluated.
If the outgoing guards evaluation might change according during behavior evaluation, you must use choice pseudostate. If the outgoing guards evaluation will never change, you can of course use both but junction could be more clear.
Hoping it helps, RedBeard
Upvotes: 4