I am currently drawing an activity diagram. There are several activities and end states, For example There is an end state 'display details' .After that activity is ended. Like this there are many activities in the system. Can I Use Final activity node several times? Or should I use Final flow node?
-
You wrote "end state", but an activity diagram does not have states. If "display details" is the last action of the activity, then you should draw an action symbol (rounded rectangle) with "display details" inside and then a flow from that action to a final node (bull's eye). The final node usually does not have a label. – www.admiraalit.nl Dec 06 '22 at 15:30
1 Answers
Yes, you can have several activity final nodes in the diagram. The UML specification explain that the first one that is reached ends the activity:
An ActivityFinalNode is a FinalNode that stops all flows in an Activity. A token reaching an ActivityFinalNode owned by an Activity terminates the execution of that Activity. If an Activity owns more than one ActivityFinalNode, then the first one to accept a token (if any) terminates the execution of the Activity, including the execution of any other ActivityFinalNodes.
In a simple diagram, it may be tempting to use only one such ending node (a reflex probably inspired by the principle of the single exit), and let all the ending paths end there. But in complex diagrams, this is not always possible nor desirable.
P.S: Using a flow final node would have a slightly different semantic: it only ends one flow. If the activity has multiple flows active (e.g. concurrent flows after a fork) the flow final will not end the activity.

- 68,716
- 7
- 72
- 138