Search code examples
umlactivity-diagram

How to merge decision/fork nodes in UML


I have the below UML activity diagram for a shopping cart use case. It has several decision and fork nodes but there are no corresponding join/merge nodes. Could you please show me:

  • how to correct the diagram by introducing the merge/join nodes.
  • how to modify the diagram so that a customer can repeat the process (of adding more products to the shopping cart).

Thank you. enter image description here


Solution

  • Do you have an initial activity element anywhere? Makes it a bit easier to read. To your question, the merge should be used as opposed to having multiple connectors coming into the same activity. For instance, "Acknowledge Msg" should have a merge above it that the other branches can flow into.

    As for how to make it repeatable, you may want an "Add to Cart" action, and prior to a "Checkout" action, have a Decision with guards for "Shopping Complete" (which goes to the Checkout action) and "Continue Shopping" (which goes back to "Enter Product #").