Search code examples
android-activityumldiagramactivity-diagram

How to properly branch to earlier actions in the flow of an activity diagram?


I am trying to design an activity diagram for an app that does some text summarization. This is what I have so far:

user activity Diagram

I tried searching for some advice, but couldn't figure out where I should connect the arrow after the user said no to logout.


Solution

  • This is not correct. As you use a decision node to select the yes/no alternative, you should merge the alternative flow back with a merge node (diamond).

    Moreover, your join node at the top would never work, because a join node needs all its inputs to be activated (i.e. a token must be present on each). In your case, it would wait forever.

    Fortunately, the correction is simple: replace your top join (first bar) with a merge (diamond)

    Additional hint: UML activity is not flow chart

    • The decision node only helps to chose the path and does not perform any action on its own; labels yes/no should therefore be guards the fully express the condition (e.g. [users wants to logout]) and any interaction with the user should happen in a previous action (e.g. Propose logout to user or Propose choices for next actions)
    • Same remark for Error encountered and Retry.
    • Hidden trap: Click generate summary button has two incomning arrows. While in traditional flowchart, you'd think that one or the other is sufficient for the flow to continue, in UML activity diagram, the multiple incoming flows is like an implicit join: all must present a token for something to happen. Here as well, you should redirect the two incoming flows to an additional merge node which then has one outgoing arrow that should be the sole incoming arrow of your action.