Reputation: 29
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?
Upvotes: 2
Views: 1273
Reputation: 73406
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.
Upvotes: 2