|Previous||UML Classes||Table of Contents||UML Packages||Next|
An activity final node is a final node that stops all flows in an activity.
• FinalNode (from IntermediateActivities ) on page 387
An activity may have more than one activity final node. The first one reached stops all flows in the activity.
No additional attributes
No additional associations
No additional constraints
Issue 8680 -clarification
A token reaching an activity final node terminates the activity (or structured node, see StructuredActivityNode (from
CompleteStructuredActivities , StructuredActivities) on page 425). In particular, it stops all executing actions in the
activity, and destroys all tokens in object nodes, except in the output activity parameter nodes. Terminating the execution
of synchronous invocation actions also terminates whatever behaviors they are waiting on for return. Any behaviors invoked
asynchronously by the activity are not affected. All tokens offered on the incoming edges are accepted. The content of output
activity parameter nodes are passed out of the containing activity, using the null token for object nodes that have nothing
in them. If there is more than one final node in an activity, the first one reached terminates the activity, including the
flow going towards the other activity final.
If it is not desired to abort all flows in the activity, use flow final instead. For example, if the same execution of an
activity is being used for all its invocations, then multiple streams of tokens will be flowing through the same activity.
In this case, it is probably not desired to abort all tokens just because one reaches an activity final. Using a flow final
will simply consume the tokens reaching it without aborting other flows. Or arrange for separate invocations of the activity
to use separate executions of the activity, so tokens from separate invocations will not affect each other.
Activity final nodes are notated as a solid circle with a hollow circle, as indicated in the figure below. It can be thought
of as a goal notated as bull’s eye, or target.
Figure 12.46 - Activity final notation
The first example below depicts that when the Close Order behavior is completed, all tokens in the activity are terminated.
This is indicated by passing control to an activity final node.
Figure 12.47 - Activity final example
The next figure is based on an example for an employee expense reimbursement process. It uses an activity diagram that illustrates
two parallel flows racing to complete. The first one to reach the activity final aborts the others. The two flows appear in
the same activity so they can share data. For example, who to notify in the case of no action.
Issue 8213 - fix figure reference
, two ways to reach an activity final exist; but it is the result of exclusive or branching, not a race situation like the
previous example. This example uses two activity final nodes, which has the same semantics as using one with two edges targeting
it. The Notify of Modification behavior must not take long or the activity finals might kill it.
[decision = modify]
[decision = accept]
[decision = reject]
Figure 12.49 - Activity final example
Activity final nodes are introduced to model non-local termination of all flows in an activity.
ActivityFinal is new in UML 2.0.