IS223D: OBJECT-ORIENTED DESIGN
USING UML
Information Systems
Department Lecture 7: Activity diagram
Objectives
2
To explain what is Activity Diagram and what are
the notations.
4-Mar-16 Information Systems Department
Introduction
3
Activity diagrams represent the dynamics of the
system.
Activity diagrams capture actions and their results.
An activity diagram is a way of describing system
flow, with the possibility of expressing how actions
are taken, what they do (change of object states),
when they take place (action sequence), and where
they take place (activity partitions).
4-Mar-16 Information Systems Department
Action & Edges
4
An action is performed to produce a result.
A set of action is used to implement an operation.
An activity diagram shows the actions and their
relationships and can have a start and an endpoint.
A start point is shown as a solid filled circle; the
endpoint is shown as a circle surrounding a smaller
solid circle (a bull’s eye).
Start point End point
4-Mar-16 Information Systems Department
Action & Edges (Cont.)
5
The actions in an activity diagram are Show
MessageBox
drawn as rectangles with rounded “Printing” on
corners (the same notation used in state screen
machine diagram)
Within the action, a text string is
attached to specify the action or actions
taken.
4-Mar-16 Information Systems Department
Action & Edges (Cont.)
6
The edges representing transitions between the
actions.
Activity edges are shown with an arrow.
Events are attached only to the transition from the
start point to the first action.
4-Mar-16 Information Systems Department
Action & Edges (Cont.)
7
4-Mar-16 Information Systems Department
Action & Edges (Cont.)
8
An edge can be protected by a guard-condition, which
must be true for it to trigger, using the same syntax as
guard-conditions in state machines.
Decisions are made using guard-conditions, for
example, [yes] and [no].
A diamond-shaped symbol is used to show a decision
node.
The decision node can have one or more incoming
edges and two or more outgoing edges labeled with
guard-conditions.
Normally, one of the outgoing edges is always true.
4-Mar-16 Information Systems Department
Action & Edges (Cont.)
9
4-Mar-16 Information Systems Department
Action & Edges (Cont.)
10
An edge can be divided into two or more edges
that result in parallel actions.
The actions are executed concurrently, although
they can also be executed one by one.
A bold line is drawn to show that an edge is
divided into several branches and shows the actual
split into parallel actions.
The bold line is also used to show the unification of
the branches.
4-Mar-16 Information Systems Department
Action & Edges (Cont.)
11
4-Mar-16 Information Systems Department
Action & Edges (Cont.)
12
Connectors can be used when the set of edges
becomes too complicated to diagram.
Connectors add no real semantic value; they just
allow one to simplify a diagram.
Each connector with an incoming edge must be
paired with exactly one identically labeled
connector with an outgoing edge.
4-Mar-16 Information Systems Department
Action & Edges (Cont.)
13
“Free disk space” activity diagram reorganized with a connector A
4-Mar-16 Information Systems Department
Activity Partitions
14
Actions can be placed in activity partitions.
An activity partition groups activities with respect to
who is responsible for them or where they reside in
an organization.
They are used for several different purposes; for
example, to show explicitly where actions are
performed (in which object), or to show in which
part of an organization work (an action) is
performed.
4-Mar-16 Information Systems Department
Activity Partitions (Cont.)
15
A common usage of activity partitions is to show
them as “swimlanes” drawn as vertical rectangles.
The actions belonging to a swimlane are placed
within its rectangle.
The swimlane is given a name that is placed at the
top of the rectangle
4-Mar-16 Information Systems Department
Activity Partitions (Cont.)
16
4-Mar-16 Information Systems Department
Activity Partitions (Cont.)
17
Activity partitions can be organized in other ways.
The visual modeling of activity partitions can get
complicated, therefore, you can alternately denote
the partition textually within the action in
parentheses.
4-Mar-16 Information Systems Department
Activity Partitions (Cont.)
18
4-Mar-16 Information Systems Department
Objects
19
Objects can be shown on activity diagrams.
They are either input to or output from the actions, or
they can simply show that an object is affected by a
specific action.
Objects are shown as object rectangles with the object
and/or class name inside them.
When an object is input to an action, it is shown with a
flow line and arrow extending from the object to the
action; when the object is output from an action, it’s
shown with the line and arrow extending from the action
to the object.
4-Mar-16 Information Systems Department
Objects (Cont.)
20
4-Mar-16 Information Systems Department
Signals
21
Signals can be sent or received in activity diagrams.
There are two symbols for signals, one for sending
and one for receiving a signal.
The send symbol corresponds to the send-clause
attached to an edge.
As with the send-clause, both the send and receipt
symbols are attached to an edge; however,
graphically, the edge is divided into two edges with
a send or a receipt symbol in between.
4-Mar-16 Information Systems Department
Signals (Cont.)
22
Activity diagram with ^Printer.Print(file) send-clause
4-Mar-16 Information Systems Department
Signals (Cont.)
23
4-Mar-16 Information Systems Department
Signals (Cont.)
24
Show MessageBox
“Printing” on screen
Remove Print (file) Create PostScript
Print (file)
MessageBox file
Activity diagram with signals without the object
4-Mar-16 Information Systems Department
Pins
25
A pin, shown as a small rectangle attached to an
activity, shows values an activity accepts (input pins)
and values it produces (output pins).
The input pins compose part of the prerequisites for
an activity to execute. An activity cannot execute
until it has tokens on each of its input pins.
When an output pin of one activity is then shown as
an input pin to a subsequent activity, a standalone
pin can be placed on the flow between the two
activities.
4-Mar-16 Information Systems Department
Pins (Cont.)
26
4-Mar-16 Information Systems Department
Example1: Order Management System
27
The Order Management System starts when a
customer sends an order request. Then, the system
confirms the receipt of the order. After that, the
system will check whether it is a normal order or not.
If it is normal, then the system will confirm the order. If
not, the system will check whether it is a special order
or not. If it is special, then the system will confirm the
order. If not, the system will be terminated. After
confirming the order, the system will dispatch the
order and that is the end of the process.
4-Mar-16 Information Systems Department
28
4-Mar-16 Information Systems Department
Example 2: Airline Reservation System
29
By using Airline Reservation System, first, you can enter the departure/
arrival dates. After that you can enter your personal information and
at the same time the system will search the flight availability. The
system flow then joins back into one and you can select the specific
flight on the dates you want to fly. Then, you are given two different
paths dependent on whether you are using reward points. If you do not
have or do not want to use reward point, you will be directed to enter
payment information. But if you want to use your reward point, the
system will ask you to enter your points and at the same time the
system will hold your reservation. Then, you will be directed to enter
payment information. After that, the system performs two processes at
the same time, mark seat as taken and process the payment. Finally, the
system will send out a confirmation email to you.
4-Mar-16 Information Systems Department
30
4-Mar-16 Information Systems Department
Reference
31
“UML 2 Toolkit”, Hans-Erik Eriksson , Magnus Penker,
Brian Lyons, and David Fado, Chapter 5
4-Mar-16 Information Systems Department