For example an activity diagram for a simple program:
- Get User data.
- If User Exists DO something, ELSE do nothing.
- End.
I often see diagrams with multiple endpoints but also with just one. Should activity diagrams merge both ways to one final state, regardless of the previous paths?
Multiple endpoints are acceptable within an activity diagram.
Here’s a number of sites backing up that assertion.
- This DeveloperWorks article
every activity diagram should have at least one final state symbol
with “at least one” implying that multiples are allowed.
- This snippet from the book Java Server Programming on page 1551
An activity diagram has a start and may have multiple endpoints.
- This Xpdian article on activity diagrams
An activity diagram has a start and may have multiple end points. The UML 2 also provides for a flow final (a circle with a cross) that indicates that the process stops.
2
It makes sense to end the activity diagram at 1 point if the activity will return no value to caller or if it is returning the same object (or value) in all cases except a major error. If the activity may result in separate actions multiple end points would be valid. In your example, I would prefer a single end point. As an example of multiple end points would be a controller sending different messages to different devices based on a condition.
Here you are speaking on one timeline only. But even in it there could be many end points – due to branching. And on the diagram you can have many timelines, each with its endpoints. On your timeline one endpoint will be enough, but we can say nothing about other timelines.