Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

sohailimran@yahoo.

com

activity diagram
Ref: Web
intro
In UML an activity diagram is used to display the sequence of activities. Activity Diagrams
show the workflow from a start point to the finish point detailing the many decision paths
that exist in the progression of events contained in the activity. They may be used to detail
situations where parallel processing may occur in the execution of some activities. Activity
Diagrams are useful for Business Modelling where they are used for detailing the
processes involved in business activities.
 Can model a task (for example in business modelling)
 Can describe a function of a system represented by use cases

 Can describe the logic of an operation

Also
◦ It is used to model the activities that make up the life cycle in the Unified Process

Sohail IMRAN ‫ﺳﻬﯿﻞﻋﻤﺮﺍﻥ‬ 1


Case Study - Agate Ltd
 Agate is an advertising company
 Many companies are its clients
 Clients have advertising campaigns
 Each campaign includes one or more adverts
 Staff may work on several campaigns at a time
 Bonus is calculated depending on salary grade

Sohail IMRAN ‫ﺳﻬﯿﻞﻋﻤﺮﺍﻥ‬ 2


Notation of Activity Diagrams

 Activities
◦ rectangle with rounded ends
Add a New
◦ meaningful name Client
 Transitions
◦ arrows with open
Assign Staff
arrowheads Contact

Sohail IMRAN ‫ﺳﻬﯿﻞﻋﻤﺮﺍﻥ‬ 3


Notation
 Start state
◦ black circle Add a New
 Decision points Client

◦ diamond
 Guard conditions Assign Staff
Contact
◦ in square brackets
 Final state [no campaign to add]

◦ black circle in white circle [campaign to add]

Add New
Campaign

Sohail IMRAN ‫ﺳﻬﯿﻞﻋﻤﺮﺍﻥ‬ 4


Alternative notation for branching

 Alternative notation for Add a New


branching: Client

◦ alternative transitions
are shown leaving the Assign Staff [no campaign to add]
activity with guard Contact
conditions [campaign to add]
 Note that guard conditions
do not have to be mutually Add New [no staff to assign]
Campaign
exclusive.
[staff to assign]

Assign Staff
to Campaign

Sohail IMRAN ‫ﺳﻬﯿﻞﻋﻤﺮﺍﻥ‬ 5


Swim-lanes
 Swim-lanes Campaign Accountant Client

◦ vertical columns Manager

◦ labelled with the Record Completion


person, organisation of a campaign

or department
responsible for the Issue invoice

activities in that
column Pay invoice

 Are all the activities carried out Record client


payment

by the same person,


organisation or department?
Close campaign

 If not, then add swim lanes to


show the responsibilities
 Name the swim lanes
 Show each activity in the appropriate swim lane
Sohail IMRAN ‫ﺳﻬﯿﻞﻋﻤﺮﺍﻥ‬ 6
example

Administrator Campaign Manager

Add a New
Client

Assign Staff [no campaign to add]


Contact

[campaign to add]

Add New [no staff to assign]


Campaign

[staff to assign]

Assign Staff
to Campaign

Sohail IMRAN ‫ﺳﻬﯿﻞﻋﻤﺮﺍﻥ‬ 7


repeated processes

 Identify any processes Add a New

that are repeated


Client

◦ they will want to assign staff [no campaign to add]


Assign Staff
to the campaign until there Contact
are no more staff to add
[campaign to add]
 Add transitions and guard
conditions to the diagram Add New [no staff to assign]
Campaign

[staff to assign]

[no more staff to assign]


Assign Staff
to Campaign
[more staff to assign]

Sohail IMRAN ‫ﺳﻬﯿﻞﻋﻤﺮﺍﻥ‬ 8


example

Sohail IMRAN ‫ﺳﻬﯿﻞﻋﻤﺮﺍﻥ‬ 9


Object flows
 Are there any object flows and objects to show?
◦ these can be documents that are created or updated in a
business activity diagram
◦ these can be object instances that change state in an
operation or a use case
 Add the object flows and objects
:Campaign

Object flows
[Active]

◦ dashed arrow Record completion
 Objects of a campaign

◦ rectangle
:Campaign
[Completed]
◦ with name of object underlined
◦ optionally shows the state of the object in square brackets

Sohail IMRAN ‫ﺳﻬﯿﻞﻋﻤﺮﺍﻥ‬ 10


example
Administrator Campaign Manager

Add a New :Client


Client [New]

Assign Staff [no campaign to add]


Contact

[campaign to add]

:Campaign [no staff to assign]


Add New
[Commissioned] Campaign

[staff to assign]

Assign Staff
to Campaign

Sohail IMRAN ‫ﺳﻬﯿﻞﻋﻤﺮﺍﻥ‬ 11


Decision and Merge Nodes
Decision nodes and merge nodes have the same notation: a diamond shape. They can
both be named. The control flows coming away from a decision node will have guard
conditions which will allow control to flow if the guard condition is met. The following
diagram shows use of a decision node and a merge node.

Sohail IMRAN ‫ﺳﻬﯿﻞﻋﻤﺮﺍﻥ‬ 12


Fork and Join Nodes
Forks and joins have the same notation: either a horizontal or vertical bar (the orientation is
dependent on whether the control flow is running left to right or top to bottom). They
indicate the start and end of concurrent threads of control. The following diagram shows an
example of their use.

A join is different from a merge in that the join synchronises two inflows and produces a
single outflow. The outflow from a join cannot execute until all inflows have been received.
A merge passes any control flows straight through it. If two or more inflows are received by
a merge symbol, the action pointed to by its outflow is executed two or more times.

Sohail IMRAN ‫ﺳﻬﯿﻞﻋﻤﺮﺍﻥ‬ 13


example

Sohail IMRAN ‫ﺳﻬﯿﻞﻋﻤﺮﺍﻥ‬ 14

You might also like