Software Design Specifications with UML

Michael W. Bigrigg, Copyright 2004-2007
UML: Introduction
Use Cases: Actors | Goals | Scenarios
Activity Diagrams: Overview | Part 1 | Part 2
State Charts: Overview | Part 1 | Part 2
Deployment Diagrams: Components | Nodes | Communication


Activity Diagrams Overview

Michael W. Bigrigg, Copyright 2004-2007

An activity diagram is seen by many people as similar to a flow chart. A flow chart used for programming describes the series of statements in a graphical representation. It is mostly popular in introductory programming classes to illustrate the structure of a computer program. It is not typically used much elsewhere as a textual representation of a computer program is just as effective and certainly not as slow and cumbersome to write. There are some tools that help to turn a textual representation into a flow chart graphical representation in order to understand a particularly complex piece of computer programming.

An activity diagram while sharing many of the same ideas and symbols as a flow chart is not for low-level computer program statements. It is more effective at the high level to express the flow of a system also referred to as work flow or business processes.

An activity diagram contains several diagramming items. There is an initial node that represents where the activity is to start. There is one and only one start of the activity. There is nothing that happens in that initial nod; it is an informative way to point out where to start. Following an initial node is a flow (or also called an edge). The flow lines are written as an arrow to point out what is supposed to happen next. There is one and only one flow coming out of an initial node.

A solid circle with a circle around it is a final node. It says that the activity is completed.

Actions are rounded rectangles that identify activity that is happening. The actions are connected using flows as a way to show step by step what is happening in the system. Each action is seperated by a flow showing the transition from one action to the next.

FIGURE 1. Initial Node and Flow Between Actions

Flows do not always simply go from one action directly to just one other action. There are times that based on a condition, you may go to one action or another. You would insert a decision along the flow to direct the flow based on a condition. The condition should evaluate to a true or false statement. The shape for a decision is a diamond with a flow coming out for every condition. Each conditional flow has a label that must evaluate to true for the flow to be taken. More than two flows is allowed, yet they must be mutually exclusive meaning that only one flow can ever be taken.

FIGURE 2. A Decision Node

The one major way in which an activity diagram is different from a flow chart is that an activity diagram is able to express parallel activities. A parallel activity is two or more activities that can happen at the same time. It is represented as a pair of horizontal bars, the first one being where all the simultaneous activities are started, called a fork, and then the second horizontal bar to identify where they all come back together again into one flow, called a join.

FIGURE 3. Parallel Activities

Activity diagrams also support functional decomposition by providing for subactivity diagrams. A subactivity has the same shape of an activity, only larger. Is is names so as to be refered from another activity diagram. An activity diagram will use that name of the subactivity to reference the subactivity. Subactivities provide a means to specify the input and output parameters.

FIGURE 4. An Activity/Subactivity Diagram