UML activity diagrams
A process drawn precisely: the steps, the branches, and the parts that genuinely happen at the same time. The closest thing UML has to a flowchart, with the ambiguity taken out.
9 min readUML 2.5.15 of 15
01What it shows
An activity diagram describes a process as a flow of work. It looks like a flowchart, and for the simple cases it is one. What it adds - and the reason it is worth using instead of a shape library - is precision about two things flowcharts are vague about: concurrency and synchronisation.
The model underneath is token flow. A token starts at the initial node and moves along the arrows. An action runs when a token arrives; when it finishes, the token moves on. A fork turns one token into several. A join waits until it has one on every incoming edge. That single mental model explains every symbol on the diagram, and it is worth holding onto because it makes the awkward cases obvious.
02The nodes
| Element | Notation | What it means |
|---|---|---|
| Initial node | filled disc | Where the flow starts. One per activity, normally. |
| Action | rounded rectangle | A step of work, named verb-first. It runs to completion once a token arrives. |
| Decision | diamond, one edge in | Chooses one outgoing edge by its guard. Guards go in square brackets; [else] catches the rest. |
| Merge | diamond, one edge out | Brings alternative paths back together. It does not wait - the first token through carries on. |
| Fork | solid bar, one edge in | Splits into paths that all run concurrently. |
| Join | solid bar, one edge out | Waits for every incoming path, then continues. This is the synchronisation point. |
| Activity final | ring around a disc | Ends the whole activity, killing any tokens still in flight. |
| Flow final | circle with a cross | Ends this one path only. The rest of the activity carries on. |
03Decision is not fork
This is the distinction the notation exists for, and the one that gets muddled. A decision is a choice: one token in, one token out, along whichever branch the guard selects. A fork is a split: one token in, several tokens out, all of them live at once.
Their partners follow the same rule. A merge (diamond) does not wait - it is just where alternative paths rejoin. A join (bar) does wait, for all of them. Using a merge where you meant a join is how a diagram ends up claiming a process continues before its parallel work has finished.
04Swimlanes
An activity partition - almost always called a swimlane - divides the canvas into bands and puts each action in the band of whoever performs it. Lanes can be vertical or horizontal, and they can nest.
Swimlanes are the single most valuable addition to a business-process diagram, because the interesting problems in a process are usually the handoffs. When an arrow crosses a lane boundary, work has changed hands, and that is where things get lost, delayed, or done twice. A diagram with four lane crossings in six steps has just told you something important.
They also cost nothing in expressiveness: a partition changes no semantics, it only says who is responsible. If the performer does not matter for your question, leave them out.
05When to draw one
Reach for it when
- A business process with real branching that people need to agree on
- Anything with genuine parallelism - the fork/join notation has no good substitute
- Documenting the main flow and alternatives behind a use case
- Showing handoffs between teams or systems, with swimlanes
Reach for something else when
- The process is linear - a numbered list is shorter and just as clear
- You are describing one object's lifecycle - use a state machine diagram
- It is really about message order between services - use a sequence diagram
- You would be transcribing an existing function statement by statement
06Common mistakes
- Fork used where a decision was meant. A bar says both paths run. If only one should, it is a diamond.
- A fork with no join. Legal, but usually a mistake: it says nothing ever waits for those parallel paths to finish.
- Guards that do not cover everything. Add
[else]. - Actions named as nouns.
Refundis ambiguous;Credit customeris a step. Name actions verb-first. - Activity final where flow final was meant. The ring-and-disc kills the entire activity, including branches still running. If you only meant to end one path, use the crossed circle.
In one line each
- 01Think in tokens: an action runs when a token arrives, and passes it on when it finishes.
- 02Diamond chooses one path; solid bar runs all of them.
- 03Merge does not wait. Join does. This is the pair to get right.
- 04Guards go in square brackets and must be exhaustive - always add [else].
- 05Swimlanes show who performs each step; lane crossings are where processes fail.
- 06Activity final ends everything; flow final ends only its own path.
Related reading