I build a UML state diagram and have a case where same transition to specific state exists from most of other states. What is the most elegant solution to draw it? Currently I though about two options: 1) Use junction pseudo-state with exit to my target state 2) Wrap source states in a composite and make a transition from it
Better ideas appreciated
Both solutions would be appropriate, depending on their legibility on the diagram. Too many transitions tend to clutter a diagram and make it difficult to read. So if you have just a few source states (say less than 4), using transitions to a junction pseudostate (not a join pseudostate - different semantics!), it should be fine. The down side to this solution is that, if you want to get back to the original source state, you will have to store the information (e.g., as part of the signal). If you have more, you can consider a composite state for all your source states. Note that if you do this, you can also have a transition to history to get back to the sub-state that was left, which may make your state diagram logic easier to implement (no need to store the state left) and the diagram easier to read.
I hope this helps.