Unit 02 (B)
Unit 02 (B)
An activity diagram is like a traditional flowchart in that it show the flow of control from step to
step.
An activity diagram can show both sequential and concurrent flow of control.
Activity diagram mainly focus on the sequence of operation rather than on objects.
Activity diagram represent the dynamic behavior of the system or part of the system.
Activity diagram are most useful during early stages of designing algorithms and workflows.
ELEMENTS OF ACTIVITY DIAGRAM
Activity Activity
The diamond has one incoming arrows and two or more outgoing arrows. Each with condition.
CONT.
Initiation
A solid circle with an outgoing arrow shows the starting point of an activity
diagram.
When an activity diagram is activated, control starts at the solid circle and proceeds
via the outgoing arrow toward the first activities.
Termination
A bull’s eye – a solid circle surrounded by a hollow circle shows the termination
point.
The symbol only has incoming arrows.
When control reaches a bull’s eye, the overall activity is complete and execution
of the activity diagram ends.
CONT.
Concurrent Activities
• For e.g. one activity may be followed by another activity, then split into several concurrent activities (a
fork of control), and finally be combined into a single activity (a merge of control).
• A fork or merge is shown by a synchronization bar –a heavy line with one or more input arrows and
one or more output arrows.
Merge Fork
EXAMPLE OF FORK & JOIN
Process
An example of business flow activity of Order
Receive Order
order processing, based on the Example
order is input parameter of the activity.
Fill Order Send Invoice
After order is accepted and all required [else
[priority
information is filled in, payment is order] ]
Activity diagrams are intended to elaborate use case and sequence models so that a developer can
study algorithms and workflow.
Activity diagrams supplement the object-oriented focus of UML models and should not be used as
an excuse to develop software via flowchart.
GUIDELINE FOR ACTIVITY DIAGRAM
Level diagrams
Activities on a diagram should be at a consistent level of details.
Place additional details for an activity in a separate diagram.
For e.g. in library management system, book issue is a one business process or a function. Show we
prepare a activity diagram for Book issue.
When design of the system is complete, the activity will be assigned to a person/department, but
at a high level it is sufficient to partition the activities among departments.
You can show such a partitioning with an activity diagram by dividing in to columns and lines.
Step 1: Identify the various activities and actions your business process or system
Step 2: Figure out which person/departments are responsible for the competition of
activity.
Step 4: Figured out who is responsible for each action and assign them a swim lane
and group each action they are responsible for under them
SWIM LANE DIAGRAM FOR BOOK ISSUE
Librarian Library Management
Check availability Software
book
[book not Alert “Book
available]
[book available] not available”
Validate Member
[unauthorized Alert “not a
user]
[authorized valid member”
user]
No. of books issued to
member
[max Alert “No more book
limit]
[else] can be issued”