theworldimagine985
49 views
27 slides
Mar 08, 2025
Slide 1 of 27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
About This Presentation
Software developer
Size: 223.12 KB
Language: en
Added: Mar 08, 2025
Slides: 27 pages
Slide Content
Software Engineering
Lecture 5
Activity Diagram
What is an Activity Diagram?
•Activity diagrams represent the dynamic (behavioral) view of a system
•Activity diagrams are typically used for business (transaction) process modeling and
modeling the logic captured by a single use-case or usage scenario
•Activity diagram is used to represent the flow across use cases or to represent flow
within a particular use case
•UML activity diagrams are the object oriented equivalent of flow chart and data flow
diagrams in function-oriented design approach
•Activity diagram contains activities, transitions between activities, decision points,
synchronization bars, swim lanes and many more…
•Useful to specify software or hardware system behavior
•Based on data flow models – a graphical representation (with a Directed Graph) of
how data move around an information system
Basic Components in an Activity Diagram
•Initial node
–The filled circle is the starting point
of the diagram
•Final node
–The filled circle with a boarder is the
ending point. An activity diagram
can have zero or more activity final
state.
•Activity
–The rounded rectangle represents
activities that occur. An activity is
not necessarily a program, it may be
a manual thing also
•Flow/ edge
–The arrows in the diagram. No label
is necessary
R e ce ive d fo rm
P a ym e n t fe e s
H o ste l
a llo tm e n t
Is s u e id e n tity
ca rd
M e d ica l ch e ck
Is s u e lib ra ry
c a rd
Basic Components in an Activity Diagram
•Fork
–A black bar ( horizontal/vertical )
with one flow going into it and
several leaving it. This denotes the
beginning of parallel activities
•Join
–A block bar with several flows
entering it and one leaving it. this
denotes the end of parallel activities
•Merge
–A diamond with several flows
entering and one leaving. The
implication is that all incoming flow
to reach this point until processing
continues
R e c e ive d fo rm
P a ym e n t fe e s
H o s te l
a llo tm e n t
Is su e id e n tity
ca rd
M e d ica l c h e c k
Is s u e lib ra ry
c a rd
Basic Components in an Activity Diagram
•Difference between Join and Merge
–A join is different from a merge in that the join synchronizes 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
Basic Components in an Activity Diagram
•Decision
–A diamond with one flow
entering and several leaving. The
flow leaving includes conditions
as yes/ no state
•Flow final
–The circle with X though it. This
indicates that Process stop at this
point
•Swim lane
–A partition in activity diagram
by means of dashed line, called
swim lane. This swim lane may
be horizontal or vertical
R e c e iv e d f o r m
P a y m e n t f e e s
H o s t e l
a l lo t m e n t
Is s u e id e n ti ty
c a r d
M e d ic a l c h e c k
Is s u e li b ra r y
c a r d
Student Enrollment in IIT (SEIIT)
IIT
Enrollm ent
Student
System
Registrar
C ourse registration
<<include>>
SEIIT System
•Here different activities are:
–Received enrollment form filled by the student
•Registrar checks the form
•Input data to the system
•System authenticate the environment
–Pay fees by the student
•Registrar checks the amount to be remitted and prepare a bill
•System acknowledge fee receipts and print receipt
–Hostel allotment
•Allot hostel
•Receive hostel charge
•Allot room
–Medical check up
•Create hostel record
•Conduct medical bill
•Enter record
–Issue library card
–Issue identity card
Activity Diagram for the Use Case in
SEIIT
R eceived fo rm
P aym e nt fee s
H ostel
allotm ent
Issue identity
ca rd
M ed ical check
Issue lib rary
card
Detailed Activity Diagram of SEIIT
R ece ive d fo rm
P a ym en t fe es
H os te l
allo tm en t
Issu e id en tity
card
M e dical c he ck
Issu e library
card
1
2
Detailed Activity Diagram of SEIIT
Fill-in
form
C h ec k
form
[In co rre c t]
[C o rre c t]
D isp lay stu d en t
screen
In p u t stu d en t
in form ation
Ve rify th e
ap p licatio n s
S earch for S tu d en t
selec tio n list
[N o t F o u n d ]
R egret m essag e
[F ou n d ]
R egret
registratio n
[N o M a tc h]
[M a tch ]
C reate record 1
Detailed Activity Diagram of SEIIT
1
D isp lay
enrollm ent form
C alculate
registration fees
D isp aly fees
p ayable screen
Pay fee
P rocess
paym ent
Print receipt
2
Activity Diagram of SEIIT with Swim Lane
F ill-in
form
C h ec k
form
[In c o rr e c t]
[C o rre c t]
D isp lay stu d en t
sc reen
In p u t stu d en t
in fo rm a tio n
S ea rc h fo r S tu d en t
selec tio n list
V e rify th e
a p p lic a tio n s
R eg ret m essa g e
C rea te rec o rd
R eg ret
reg istra tio n
[N o M a tc h ]
[M a tc h ]
[N o t F o u n d ]
[F o u n d ]
1
S
t
u
d
e
n
t
R
e
g
is
t
r
a
r
S
y
s
t
e
m
Some more features in
Activity Diagrams
Object and Object Flow
•An object flow is a path along which objects can pass. An
object is shown as a rectangle
•An object flow is shown as a connector with an arrowhead
denoting the direction the object is being passed.
Input and Output Pin
•An object flow must have an object on at least one of its ends.
A shorthand notation for the above diagram would be to use
input and output pins
Data Store
•A data store is shown as an object with the «datastore»
keyword
Exception Handling
•Exception Handlers can be modeled on activity diagrams as in
the example below
Interruptible Activity Region
•An interruptible activity region surrounds a group of actions that can be
interrupted. In the very simple example below, the Process Order action
will execute until completion, when it will pass control to the Close Order
action, unless a Cancel Request interrupt is received which will pass
control to the Cancel Order action
An Example
•Identify the business logic in the activity diagram shown below
21
SendSignalAction
•Creates a signal instance from its inputs, and
transmits it to the target object (local or remote)
•A signal is an asynchronous stimulus that triggers a
reaction in the receiver in an asynchronous way and
without a reply
•Any reply message is ignored
22
Time triggers and Time events
•A Time trigger is a trigger that specifies when a time
event will be generated
•Time events occur at the instant when a specified
point in time has transpired
•This time may be relative or absolute
–Relative time trigger: is specified with the keyword ‘after’
followed by an expression that evaluates to a time value
–Absolute time trigger: is specified as an expression that
evaluates to a time value
Jan, 1, 2000, Noonafter (5 seconds)
Relative time trigger Absolute time trigger
23
AcceptEventAction
•Waits for the occurrence of an event meeting specified
conditions
•Two kinds of AcceptEventAction:
–Accept event action – accepts signal
events generated by a SendSignalAction
–Wait time action – accepts time events
Accept event action
Wait time action
The objects stored in
Personnel are only
retrieved when the
join succeeds (only
once a year)
Importance of Activity Diagram
•An activity diagram can depict a model in several ways
•It can also depicts “Basic course of action” as well as “detailed courses”
•Activity diagram can also be drawn that cross several use cases, or that address just
a small portion of use case
•Activity diagrams are normally employed in business process modeling. This is
carried out during the initial stages of requirement analysis and specification
•Activity diagrams can be very useful to understand the complex processing
activities involving many components
•The activity diagram can be used to develop interaction diagrams which help to
allocate activities to classes
Analyze the following case study and draw activity diagram for the
whole scenario
The purchasing department handles purchase requests
from other departments in the company. People in the
company who initiate the original purchase request are the
"customers" of the purchasing department. A case worker
within the purchasing department receives that request and
monitors it until it is ordered and received. Case workers
process the requests for purchasing products under
$1,500, write a purchase order, and then send it to the
approved vendor. Purchase requests over $1,500 must
first be sent out for a bid from the vendor that supplies the
product. When the bids return, the case worker selects
one bid. Then, the case worker writes a purchase order
and sends it to the approved vendor.
Analyze the following case study and draw activity diagram for the whole
scenario
A Library Information System (LIS) for the benefit of
students and employees of the institute is developed. LIS
will enable the members to borrow a book (or return it) with
ease while sitting at his desk/chamber. The system also
enables a member to extend the date of his borrowing if no
other booking for that particular book has been made. For
the library staff, this system aids them to easily handle day-
to-day book transactions. The librarian, who has
administrative privileges and complete control over the
system, can enter a new record into the system when a
new book has been purchased, or remove a record in case
any book is taken off the shelf. Any non-member is free to
use this system to browse/search books online. However,
issuing or returning books is restricted to valid users
(members) of LIS only.
Analyze the following case study and draw activity diagram for the whole scenario
The Northstar Hotel’s website allows potential guests to make a room
reservation, specifying the dates and type of room. If they have
registered with the website previously their stored details are used to
speed up the process, otherwise they are required to register as a new
customer. Each reservation is given a unique reservation code. Before
the date of their stay they may enter this reservation code into the
website to amend or cancel the reservation. Amendments can include
altering the dates, changing the room type or the number of guests in
each room. When the guests arrive at the hotel the reservation id is
used by the receptionist to quickly find the reservation to check them in
with. At the end of their stay the receptionist checks the guests out, at
this point the hotel system validates their payment through the card
payment system; a printed invoice may be requested by the guest at
this point. The hotel has many room types available, each with a room-
type name, number of guests and additional facility information. Each
room in the hotel has a room number and is of one specific type. The
maintenance of this data is performed using a separate system out of
scope of this exercise. Monthly reports are prepared by the system
which may be viewed on request by the Hotel Manager.