Activities, Activity Nodes, and Activity Edges


The following subsections describe various aspects of activities, which reside at the next level of abstraction up from actions.

Activities

An activity is an ongoing nonatomic (in other words, interruptible) execution of a series of actions (see the section "Actions," earlier in this chapter).

A simple activity appears in the same shape as an action (see the section "Actions," earlier in this chapter). For a complex activity, you can show activity nodes, which are placeholders for one or more steps within an activity, and activity edges, which are connections between activity nodes. (Actions are kinds of activity nodes.) Tokens control the flow of data and/or control within an activity; a token can contain an object, a piece of data, or a locus of control.

Figure 6-13 shows the notation for a complex activity, which includes nodes and edges plus a border and a name for the activity, displayed in the upper-left corner.


Figure 6-13: Complex activity

The rectangles on the edges of the diagram represent activity parameter nodes, which are special types of activity nodes that appear at the beginning or end of flows to accept inputs to an activity from another activity or to provide outputs from the activity to another activity.

Activity Nodes

The following subsections describe the various kinds of activity nodes.

Control Nodes

Control nodes coordinate flows among other activity nodes. There are seven kinds of control nodes; they are described as follows :

  • An initial node is where the flow of control starts when an activity is invoked. Figure 6-14 shows the notation for an initial node.


    Figure 6-14: Initial node

  • A final node is a control node at which one or more flows within the given activity stop. There are two types of final nodes: flow final nodes and activity final nodes.

    A flow final node terminates a particular flow. Figure 6-15 shows the notation for a flow final node.


    Figure 6-15: Flow final node

    An activity final node terminates all flows within the activity and thus terminates the activity itself. Figure 6-16 shows the notation for an activity final node.


    Figure 6-16: Activity final node

  • A decision node offers a choice among two or more outgoing activity edges, each of which has a guard , which is a Boolean expression that must resolve to True before the associated path can be taken.

    A decision node appears as a diamond, as shown in Figure 6-17.


    Figure 6-17: Decision node

    You can apply the "decisionInput" stereotype to a decision node to specify a decision criterion instead of spelling out the possible values on the activity edges. Figure 6-18 shows an example of this stereotype.


    Figure 6-18: Decision input

  • A merge node brings together multiple alternate control flows. Figure 6-19 shows the notation for a merge node, which is the same as that for a decision node.


    Figure 6-19: Merge node

  • A fork node splits a flow into multiple concurrent flows. Figure 6-20 shows the notation for a fork node, which is a long, thin black rectangle.


    Figure 6-20: Fork node

  • A join node synchronizes multiple control flows. Figure 6-21 shows the notation for a join node, which is the same as that for a fork node.


    Figure 6-21: Join node

Executable Node

An executable node is an activity node that may be executed.

An executable node owns one or more exception handlers. Each handler specifies an executable node to execute in case a specified exception occurs during the execution of another executable node.

An exception handler appears as the combination of the following two items:

  • A "lightning bolt" symbol from the boundary of the primary executable node to a small square on the boundary of the executable node that processes the exception

  • The name of the exception type next to the lightning bolt

Figure 6-22 shows an example of an exception handler.


Figure 6-22: Exception handler

Object Nodes

An object node is an activity node that provides and accepts objects and data as they flow into and out of invoked behaviors in the context of the execution of an activity.

An object node usually appears as a rectangle with its name inside. If the node represents a signal, the notation is different. Figure 6-23 shows examples of both notations.


Figure 6-23: Object nodes

There are four kinds of object nodes, each of which may have a specialized notation. These object nodes are described as follows:

  • An activity parameter node is a special type of activity node (described in the section "Activities," earlier in this chapter).

  • A central buffer node accepts tokens from an "upstream" object node and passes them along to a "downstream" object node.

    A data store node is a special type of central buffer node that handles persistent information. Figure 6-24 shows an example of a data store node.


    Figure 6-24: Data store node

  • An expansion node is an object node that indicates a flow across the boundary of an expansion region. (Expansion regions are discussed in the section "Structured Activity Nodes," later in this chapter.) A flow into a region contains a collection that is broken into its individual elements inside the region; the region then executes once per element. A flow out of a region combines individual elements into a collection for use outside the region.

  • A pin is a type of object node (discussed in the section "Actions," earlier in this chapter).

Activity Edges

An activity edge may have a guard on it. It may also have a name.

Figure 6-25 shows an example of an activity edge that connects two activity nodes.


Figure 6-25: Activity edge

You can also use connector symbols for graphical convenience, as shown in Figure 6-26.


Figure 6-26: Activity edge with connectors

There are two kinds of activity edges, as follows:

  • A control flow only passes control tokens.

  • An object flow can have objects or data passing along it.




Fast Track Uml 2.0
Fast Track UML 2.0
ISBN: 1590593200
EAN: 2147483647
Year: 2004
Pages: 97

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net