ACTIVITY DIAGRAM(UML MODEL)
An activity diagram visually presents a series of
operation or flow of control in a system similar to
algorithm or a flowchart.
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.
An activity diagram shows ‘How’ system works.
Activity diagram are most useful during early stages of designing algorithms and workflows.
ELEMENTS OF ACTIVITY DIAGRAM
Activity Activity
The main element of an activity diagram is the activity itself.
An activity is a function/operation performed by the system.
The elongated ovals show activities.
An unlabeled arrow from one activity to another activity, that indicates that the first activity must
complete before the second activity begin.
[true] [false]
Branches
If there is more than one successor to an activity, each arrow may be labeled with a condition
in square brackets. For e.g. [failure]
As a notational convenience, a diamond shows a branch into multiple successors.
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
• System can perform more than one activity at a time.
• 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] ]
accepted and order is shipped.
Special Regular
Delivery delivery
Note, that this business flow allows
Receive Payment
order shipment before invoice is sent
or payment is confirmed.
Close Order
GUIDELINE FOR ACTIVITY DIAGRAM
Activity diagram elaborate the details of computation, thus documenting the steps needed to
implement an operation or a business process.
Activity diagram can help developers to understand complex computations by graphically
displaying the progression through intermediate execution steps.
Here is some advice for activity diagram.
Don’t misuse activity diagram
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.
Be careful with branches and conditions
If there are conditions, at last one must be satisfied when an activity completes, consider
using an [else] condition.
It is possible for multiple conditions to be satisfied otherwise this is an error condition.
Be careful with concurrent activities
Means that the activities can complete in any order and still yield an acceptable result.
Before a merge can happen, all inputs must first complete
HOW TO DRAW AN ACTIVITY DIAGRAM
Step 1: Identify the various activities and actions your business process or system
Step 2: Find a flow among the activities
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.
Various activity in book issue process like…
Check availability of book
Validate the member
Check No. of books issued by member
Add book issue details to transaction
Update no of book issued by member
Update book status.
ACTIVITY DIAGRAM FOR BOOK ISSUE
Check availability book
[book not Alert “Book not
available] available”
[book
available] Validate Member
Alert “not a [unauthorized
valid member” user] [authorized
No. of books issued
user] to
member
[max Alert “No more
limit] book can be issued”
[else
Add book ]issue details to transaction
Update no of book issued to Update book
member status
SWIM LANE DIAGRAM(UML MODEL)
In a business model, it is often useful to know which human department is responsible for an
activity.
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.
Each column is called swim-lane by analogy to a swimming pool.
Placing an activity within a particular swim-lane indicates that is performed by a person/
department.
Lines across swim-lane boundaries indicate interaction among different person/department.
HOW TO DRAW A SWIM LANE DIAGRAM
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 3: Figure out in which order the actions are processed.
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”
Add book issue details to
transaction
Update no of book issued to Update book
member status
THANK YOU