Analysis: Activity Diagrams



index
Disabled back button Next Section
printable version




Section 0: Module Objectives or Competencies
Course Objective or Competency Module Objectives or Competency
The student will be able to assess and apply Object-Oriented analysis and design methods like use cases to express user requirements, UML modeling, and other OO approaches. Understand the process used to model business processes with activity diagrams.
Understand the rules and style guidelines for activity diagrams.


Section 1: Overview

The behavior of a use case can be described by means of activity diagrams and state diagrams, interaction diagrams (sequence and communication diagrams), as well as textual use cases, where appropriate.

In its basic form, an activity diagram is a simple and intuitive illustration of what happens in a workflow, what activities can be done in parallel, and whether there are alternative paths through the workflow. (from developerWorks)

While activity diagrams may be used at several points in the development process, you can use activity diagrams to visualize the workflow of a business use case.

Example Activity Diagram.

In many ways UML activity diagrams are the object-oriented equivalent of flow charts and data flow diagrams (DFDs) from structured development.


Video Overview

Here is a video overview of Activity Diagrams. Move to the 2:25 mark in the YouTube version:

Here is everything you need to know about Activity Diagrams: video :



Section 2: Benefits of Activity Diagrams

Activity diagrams depict the sequence of activities

An activity diagram...


Drawbacks of Activity Diagrams

No stick figures - #sad!



Section 3: Using Activity Diagrams with Use Cases

Activity Diagrams are like Flow Charts, but Flow Charts are usually limited to sequential activities while Activity Diagrams can show parallel activities as well.



Section 4: Elements of Activity Diagrams
Video: Activity Diagrams Basic Symbols


Activity Diagram Syntax.

Actions and Activities

Object Nodes: represent the flow of information from one activity to another

Control Flows: model execution paths

Object Flows: model the flow of objects

Control Nodes: 7 types



Section 5: States and Transitions

Activity diagrams can incorporate the following features - action states and activity states, transitions, branching, forking and joining, and swimlanes


Action States and Activity States

Activity diagrams commonly contain

Action states are atomic and cannot be decomposed

Activity states can be further decomposed


Transitions

When the action or activity of a state completes, flow of control passes immediately to the next action or activity state.

A flow of control has to start and end someplace

Example of an Activity Diagram Transition.


Section 6: Branching, Forking, and Joining
Video: Branching, Forking, and Joining


Branching

A branch specifies alternate paths taken based on some Boolean expression.

A branch may have one incoming transition and two or more outgoing ones.

Example of an Activity Diagram Branch.

The following example of an ATM transaction includes branching.

Example of an Activity Diagram Branch.

Forking and Joining

Use a synchronization bar to specify the forking and joining of parallel flows of control.

A synchronization bar is rendered as a thick horizontal or vertical line.

Fork

A fork may have one incoming transition and two or more outgoing transitions.

Join

A join may have two or more incoming transitions and one outgoing transition.

Example of an Activity Diagram Fork and Join.
Example of an Activity Diagram Fork and Join.


Section 7: Swimlanes
Video: Using Swim Lanes

A swimlane is used to partition the activity states on an activity diagram into groups.

Each swimlane is divided from its neighbor by a vertical solid line.

Each swimlane has a name unique within its diagram.

Each swimlane may represent some real-world entity.

Each swimlane may be implemented by one or more classes.

Every activity belongs to exactly one swimlane, but transitions may cross lanes.

Each zone represents the responsibilities of a particular class (in this example, a particular department).

Example of an Activity Diagram Swimlane.
Example of an Activity Diagram Swimlane.


Section 8: Interpreting an Activity Diagram
Interpreting an Activity Diagram.

An Example with Notation

Example of Interpreting an Activity Diagram.


Section 9: Developing Activity Diagrams

Guidelines for Activity Diagrams

  1. Set the scope of the activity being modeled.
  2. Identify the activities; connect them with flows.
  3. Identify any decisions that must be made.
  4. Identify potential parallelism in the process.
  5. Draw the activity diagram.

Creating an Activity Diagram



Section 10: Decomposing an Activity

An activity can be decomposed into a further Activity Diagram.

When an Activity Diagram represents a decomposition of a higher-level activity, there can be only one start point.

Example of Decomposing an Activity Diagram.

More in this supplemental example.



Section 11: Examples
Example of an Activity Diagram.
Example of an Activity Diagram.
Example of an Activity Diagram.
Example of an Activity Diagram.
Example of an Activity Diagram.


Section 12: Resources
X

Decomposing or Combining Functions

Both types of diagrams (data flow diagrams and activity diagrams) support the decomposition of complex functions into simpler functions as well as the combination of simpler functions to form more complex functions. In other words, data flow diagrams and activity diagrams can represent hierarchies of functions (see Figure 45 and Figure 46). This abstraction mechanism allows us to structure complex issues in order to keep them understandable and manageable. Within the dynamic view of requirements modeling, this hierarchy is a powerful tool for controlling the scope and complexity of the systems under development.

In Figure 45, the complex function "Determine Destination" of a navigation system is decomposed into five steps (which are not specified in the example diagram).

figure 45

In Figure 46, the complex activity B is decomposed into a detailed process consisting of five activities. Conversely, the detail activities B1, B2a1, B2a2, B2b, and B3 can be combined to form the aggregated activity B.

figure 46

In addition to content-based criteria (such as a technically strong relationship, which is often manifested in finding a good name for the whole of the detail activities), very pragmatic criteria are applied for decomposition or combination. One criterion is usually that the diagram should fit on one page of a document. Furthermore, most methods recommend modeling no more than 7 ± 2 functions per diagram.

From Handbook of Requirements IREB Standard.