Software Engineering
Activity Diagrams

Agenda


What are Activity Diagrams?


Activity Diagrams and the UP


Activities

Activities are networks of nodes connected by edges. There are three categories of node:

  1. action node - represent discrete units of work that are atomic within the activity
  2. control nodes - control the flow thorough activity
  3. object nodes - represent objects used in the activity

Edges represent flow through the activity. There are two categories of edge:

  1. control flow - represent flow of control through activity
  2. object flow - represent the flow of objects though the activity


A use case as a series of actions


Activity Semantics

Activity diagrams are based on Petri Nets (http://www.informatik.uni-hamburg.de/TGI/PetriNets/).

Activity diagrams model behavior by using the token game. This game describes the flow of token around the network of nodes and edges according to specific rules. Tokens in UML activity diagrams can represent

The state of the system at any point in time is determined by the disposition of its tokens.

In the Send letter example, the token is the flow of control as there are no objects or data being passed between nodes in this particular case.


Activity Partitions


Action Nodes

Action  nodes execute when

When the action node has finished execution


Four Types of Action Nodes


Call Action Node

The most common type of action node is the call action node. This type of node can invoke

UML operation (operation signature):
visibility name( direction parameterName: parameterType = defaultValue, ... ) : returnType


Accept Time Event Action Node


Control Nodes

Control nodes manage the flow of control within an activity


Decision and Merge Nodes

A note stereotyped <<decisionInput>> provides a decision condition for a decision node.


Fork and Join Nodes - Concurrency


Object Nodes


Activity Parameters


Pins