0% found this document useful (0 votes)
6 views

Activity Diagram

Activity diagrams illustrate the flow of control in a system, showing the sequence and concurrency of activities, and are useful for modeling workflows, understanding dynamic behavior, and simplifying complex logic. They utilize specific notations like initial states, action states, decision nodes, and swimlanes to represent various elements and actions. The document also compares activity diagrams with flowcharts, highlighting their distinct purposes and uses in software and process modeling.

Uploaded by

Janenina Boholst
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Activity Diagram

Activity diagrams illustrate the flow of control in a system, showing the sequence and concurrency of activities, and are useful for modeling workflows, understanding dynamic behavior, and simplifying complex logic. They utilize specific notations like initial states, action states, decision nodes, and swimlanes to represent various elements and actions. The document also compares activity diagrams with flowcharts, highlighting their distinct purposes and uses in software and process modeling.

Uploaded by

Janenina Boholst
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 41

ACTIVITY

SOFTWARE ENGINEERING 2
DIAGRAM
NINA JANE BOHOLST
SAMANTHA JULIA DONAIRE
WHAT IS AN
ACTIVITY DIAGRAM?

Activity diagrams show the steps involved in how a system works, helping
us understand the flow of control. They display the order in which
activities happen and whether they occur one after the other (sequential)
or at the same time (concurrent). These diagrams help explain what
triggers certain actions or events in a system.
happen and whether they occur one after the other (sequential) or at the
same time (concurrent). These diagrams help explain what triggers certain
actions or events in a system.

WHAT IS AN
ACTIVITY DIAGRAM?

An activity diagram starts from an initial point and ends at a final point,
showing different decision paths along the way.

They are often used in business and process modeling to show how a
system behaves over time.

initial point final point

Decision Decision
WHEN TO USE ACTIVITY DIAGRAM?
Activity diagrams are useful in several scenarios, especially when you need to visually represent the flow
of processes or behaviors in a system. Here are key situations when you should use an activity diagram:

01 02 03
MODELING WORKFLOWS CONCURRENT OR UNDERSTANDING THE
OR PROCESSES PARALLEL PROCESSING DYNAMIC BEHAVIOR

When you need to map out a business If your system or process involves When it’s essential to depict how a
process, workflow, or the steps activities happening simultaneously, system changes over time and moves
involved in a use case, activity an activity diagram can clearly show between different states based on events
diagrams help visualize the flow of the parallel flow of tasks. or conditions, activity diagrams are
activities.
effective.
WHEN TO USE ACTIVITY DIAGRAM?
Activity diagrams are useful in several scenarios, especially when you need to visually represent the flow
of processes or behaviors in a system. Here are key situations when you should use an activity diagram:

04 05 06
CLARIFYING COMPLEX SYSTEM DESIGN AND DESCRIBING USE
LOGIC ANALYSIS CASES

Use an activity diagram to simplify During the design phase of a software


They are useful for illustrating the flow of
complex decision-making processes system, activity diagrams help
control within a use case, showing how
with branching paths and different developers and stakeholders
various components of the system
outcomes. understand how different parts of the
interact during its execution.
system interact dynamically.
ACTIVITY DIAGRAM
NOTATIONS

In activity diagrams, the notations are like visual symbols that help represent
different elements and actions in a simple way.
1. INITIAL STATE

The starting state before an activity takes place is depicted using the initial state.
EXAMPLE

Here the initial state of the system before the application is opened.
2. ACTION OR ACTIVITY
STATE

An activity represents execution of an action on objects or by objects.


EXAMPLE

Consider the previous example of opening an application, opening the application is


an activity state in the activity diagram.
3. 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 activity state.
EXAMPLE

Here both the states transit into one final state using action flow symbols i.e. arrows.
4. DECISION NODE AND BRANCHING

When we need to decide before choosing the flow of control, we use the decision
node. The outgoing arrows from the decision node can be labelled with conditions or
guard expressions. It always includes two or more output arrows.
EXAMPLE

We apply the conditions on input number to display the result :


• If number is odd then display the number.
• If number if even then display the error.
5. GUARD

A Guard refers to a statement written next to a decision node on an arrow


sometimes within square brackets.
6. FORK

Fork nodes are used to support concurrent activities. When we use a fork node
when both the activities get executed concurrently i.e. no decision is made before
splitting the activity into two parts.
EXAMPLE

In the example below, the activity of making coffee can be split into two
concurrent activities and hence we use the fork notation.
7. 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.
EXAMPLE

When both activities i.e. steaming the milk and adding coffee get completed,
we converge them into one final activity.
8. MERGE OR MERGE EVENT

Scenarios arise when activities which are not being executed concurrently have to be merged. We
use the merge notation for such scenarios.
EXAMPLE

In the diagram below: we can’t have both sides executing concurrently, but they finally
merge into one. A number can’t be both odd and even at the same time.
9. SWIMLANES

We use Swimlanes for grouping related activities in one column. Swimlanes group related
activities into one column or one row. Swimlanes can be vertical and horizontal.
EXAMPLE

Here, a different set of activities is executed based on if the number is odd or even.
These activities are grouped into a swimlane.
10. TIME EVENT

This refers to an event that stops the flow for a time; an hourglass depicts it. We can have a
scenario where an event takes some time to complete.
EXAMPLE

Let us assume that the processing of an image takes a lot of time. Then it can be
represented as shown below.
11. 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.
HOW TO DRAW AN ACTIVITY DIAGRAM
IN UML?
STEP 1. IDENTIFY THE INITIAL STATE
AND FINAL STATES:

• This is like setting the starting point and ending point of a


journey.
• Identify where your process begins (initial state) and where it
concludes (final states).

For example, if you are modelling a process for making a cup of tea, the
initial state could be “No tea prepared,” and the final state could be “Tea
ready.”
NO TEA TEA
PREPARED READY
STEP 2. IDENTIFY THE INTERMEDIATE
ACTIVITIES NEEDED:

• Think of the steps or actions required to go from the starting point to


the ending point.
• These are the activities or tasks that need to be performed.
• Continuing with the tea-making, intermediate activities could include
“Boil water,” “Pour tea into a cup”.
BOIL WATER

ADD TEA
LEAVES

POUR TEA
INTO CUP
STEP 3. IDENTIFY THE CONDITIONS OR
CONSTRAINTS:

• Consider the conditions or circumstances that might influence the


flow of your process.
• These are the factors that determine when you move from one
activity to another.
• Using the tea-making scenario, a condition could be “Water is
boiled,” which triggers the transition to the next activity.
BOIL WATER

No
Has the water boiled?

Yes

ADD TEA
LEAVES

POUR TEA
INTO CUP
STEP 4. DRAW THE DIAGRAM WITH
APPROPRIATE NOTATIONS:

Now, represent the identified states, activities, and conditions visually


using the appropriate symbols and notations in an activity diagram. This
diagram serves as a visual map of your process, showing the flow from
one state to another.
SAMPLE
SYTEM
ACTIVITY
DIAGRAM
WHAT ARE THE DIFFERENCES BETWEEN AN
ACTIVITY DIAGRAM AND A FLOWCHART?

An activity diagram is very similar to a


flowchart.
An activity diagram is very similar to a
flowchart.

WHAT ARE THE DIFFERENCES BETWEEN AN


ACTIVITY DIAGRAM AND A FLOWCHART?

WHAT IS A FLOW
An algorithm is like a set CHART?
of clear instructions to solve a problem,
and a flowchart is a picture that shows those instructions.
An activityWHAT
An algorithm
diagram
ARE
is like THE
a set of clear
is very
DIFFERENCES BETWEEN
instructions to
similar
AN
solve a problem, and a
to a
flowchart.
ACTIVITY
flowchart is aDIAGRAM
picture thatAND
showsAthose
FLOWCHART?
instructions.

WHAT IS A FLOW
CHART?
When we’re writing computer programs, a flowchart helps us map out
the steps of the algorithm to solve the problem.

Non programmers use Flow charts to model workflows.

We can call a flowchart a primitive version of an activity diagram.

Business processes where decision making is involved is expressed


using a flow chart.
DIFFERENCES BETWEEN AN ACTIVITY
DIAGRAM AND A FLOWCHART
ASPECT ACTIVITY DIAGRAM F LO W C H A RT

Represents the flow of control in a system or Depicts the step-by-step flow of a process or
Purpose
process, focusing on activities and conditions. algorithm, focusing on operations.

Primarily used in software and systems


Commonly used in various fields like programming,
Used In modeling, especially in UML (Unified Modeling
business, and process mapping.
Language).

Can represent both simple and complex Typically used for simpler, linear processes, though
Complexity
workflows, including concurrent processing. can handle limited complexity.

Uses UML symbols like initial nodes, activity Uses basic symbols like rectangles (process),
Symbols
nodes, decisions, swimlanes, etc. diamonds (decisions), and arrows (flow).

Concurrency
Supports concurrent activities and parallel Does not support parallel processes explicitly; focuses
Representatio
flows. on sequential flow.
n
DO WE NEED TO USE BOTH THE DIAGRAMS
AND THE TEXTUAL DOCUMENTATION?
Let’s understand this with the help of an example:

Different individuals have different preferences in which they


understand something.

To understand a concept, some people might prefer a written


tutorial with images while others would prefer a video lecture.

So we generally use both the diagram and the textual


documentation to make our system description as clear as
possible.
THANK YOU FOR
LISTENING
References

https://www.geeksforgeeks.org/unified-modeling-language-uml-activity-
diagrams/
https://itsourcecode.com/uml/activity-diagram-for-login-page-uml/

You might also like