Activity Diagram
Activity Diagram
Design
Activity Diagram
Today’s Agenda
• What is an Activity Diagram in UML?
• What are activity diagrams used for?
• Components of Activity Diagram
• What are the benefits of an activity diagram?
What is an Activity Diagram in UML?
• ACTIVITY DIAGRAM is basically a flowchart to represent the flow
from one activity to another activity. The activity can be described as
an operation of the system. The basic purpose of activity diagrams is
to capture the dynamic behavior of the system.. It is also called
object-oriented flowchart.
• This UML diagram focuses on the execution and flow of the behavior
of a system instead of implementation. Activity diagrams consist of
activities that are made up of actions that apply to behavioral
modeling technology.
What are activity diagrams used for?
• Activity diagrams are used for various purposes and at different stages
in the development process.
• During the planning stage, you can create an activity diagram to
depict workflows and visualize the sequence of activities in a system.
• Meanwhile, at the requirements stage, activity diagrams can be used
to present different use cases for a system.
• As for the design phase, an activity diagram can model software
elements such as method, function, and operation.
Components(Notations) of Activity
Diagram
1. Initial State
2. Action or Activity State
3. Action Flow or Control flows
4. Decision node and Branching
5. Fork
6. Join
7. Merge or Merge Event
8. Swimlane
9. Final State or End State
Initial State
• Initial State – The starting state
before an activity takes place is
depicted using the initial state.
• We use a black filled circle to
depict the initial state of a
system.
Action or Activity State
• Action or Activity State – An
activity represents execution of
an action on objects or by
objects.
• We represent an activity using a
rectangle with rounded corners.
• Basically, any action or event
that takes place is represented
using an activity.
Action Flow or Control flows
• Action Flow or Control flows –
Action flows or Control flows are
also referred to as paths and
edges.
• They are used to show the
transition from one activity state
to another.
Decision node and Branching
• Decision node and Branching –
When we need to make a
decision before deciding the
flow of control, we use the
decision node.
Fork
• Fork – Fork nodes are used to
support concurrent activities.
• We use a rounded solid
rectangular bar to represent a
Fork notation with incoming
arrow from the parent activity
state and outgoing arrows
towards the newly created
activities.
Join
• Join – Join nodes are used to
support concurrent activities
converging into one.
• For join notations we have two
or more incoming edges and one
outgoing edge.
Merge or Merge Event
• Merge or Merge Event –
Scenarios arise when activities
which are not being executed
concurrently have to be merged.
Swimlane
• Swimlane – We use swimlane for
grouping related activities in one
column.
• It provides a way to organize and
categorize the different actors or
entities involved in a process.
• Swimlane can be vertical and
horizontal.
• Swimlane are used to add
modularity to the activity
diagram.
Final State or End State
• Final State or End State – The state
which the system reaches when a
particular process or activity ends is
known as a Final State or End State.
• We use a filled circle within a circle
notation to represent the final state in
a state machine diagram.
• A system or a process can have
multiple final states.
Example
• The activity diagram prints
the number if it is odd
otherwise it subtracts one
from the number and
displays it.
What are the benefits of an activity
diagram?
• An activity diagram can be helpful in a variety of ways.
• Illustrate the flow of activities so that it’s easy to understand the
behavior and structure of a system.
• Allow stakeholders to visualize steps, decisions, and interactions to
root out inefficiencies.
• Provide a reference point for future developers or those involved in
system maintenance.