0% found this document useful (0 votes)
95 views22 pages

Unit III Ooad Part 3

Activity diagrams are used to describe the workflow behavior of a system, particularly in process modeling and analysis during requirements engineering. They can represent both sequential and parallel activities, making them useful for documenting existing processes and analyzing new concepts. However, they do not explicitly show which objects execute activities, and should be complemented with interaction diagrams for a complete understanding of the process.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
95 views22 pages

Unit III Ooad Part 3

Activity diagrams are used to describe the workflow behavior of a system, particularly in process modeling and analysis during requirements engineering. They can represent both sequential and parallel activities, making them useful for documenting existing processes and analyzing new concepts. However, they do not explicitly show which objects execute activities, and should be complemented with interaction diagrams for a complete understanding of the process.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Activity Diagram

1
Activity diagrams
● Activity diagrams describe the workflow
behavior of a system.
● Activity diagrams are used in process modeling and
analysis of during requirements engineering.
● A typical business process which synchronizes several
external incoming events can be represented by activity
diagrams.
● They are most useful for understanding work flow
analysis of synchronous behaviors across a process.

2
Activity diagrams

● Activity diagrams are used for


● documenting existing process
● analyzing new Process Concepts
● finding reengineering opportunities.

● The diagrams describe the state of activities


by showing the sequence of activities
performed.
● they can show activities that are conditional or
parallel

3
4

What is an Activity?
● Two definitions
● In a conceptual diagram, an
activity is some task that needs to
be done, whether by a human or
a computer
● In a specification-perspective
diagram or an
implementation-perspective
diagram, an activity is a method
on a class
5

What is an Activity?
● Activity arrangement
● Sequential – one activity is
followed by another
● Parallel – two or more sets of
activities are performed
concurrently, and order is
irrelevant
● Interleaving is permitted – we can jump
between the parallel flows
6

What is an Activity? (concluded)


● Activity Diagrams are used to describe activities
● Activity Diagrams are useful for
describing complicated methods
● Activity Diagrams are useful for
describing use cases, since, after
all, a use case is an interaction,
which is a form of activity
7

What is an Activity? (concluded)


● Using Activity Diagrams with Use Cases
● Start with a coarse-grained use case, which is
composed of subordinate use cases
● For the complicated subordinate use cases,
use Activity Diagrams rather than Use Case
Diagrams
● Activity Diagrams are like Flow Charts, but Flow
Charts are usually limited to sequential activities
while Activity Diagrams can show parallel
activities as well
When to Use Activity Diagrams

● The main reason to use activity diagrams is to model the


workflow behind the system being designed.

● Activity Diagrams are also useful for:


● analyzing a use case by describing what actions need to take
place and when they should occur
● describing a complicated sequential algorithm
● modeling applications with parallel processes

● Activity Diagrams should not take the place of interaction


diagrams and state diagrams.

8
Components

● An activity is an ongoing, though interruptible,


execution of a step in a workflow (such as an
operation or transaction)
● Represented with a rounded rectangle.
● Text in the activity box should represent an activity
(verb phrase in present tense).

9
How to Draw an Activity Diagram

Diagrams are read from top to bottom and have branches


and forks to describe conditions and parallel activities.
● A fork is used when multiple activities are occurring at the
same time.
● A branch describes what activities will take place based on a
set of conditions.
● All branches at some point are followed by a merge to
indicate the end of the conditional behavior started by that
branch.
● After the merge all of the parallel activities must be combined
by a join before transitioning into the final activity state.

10
Activity Diagram
Start State
Example
Fork Activity
To show
concurrent
activity, Branch
activity
diagrams
allow
branches and
joins.
Merge Join

End State

11
Swimlane Diagrams
Allows the modeler
to represent the
flow of activities
described by the
use-case and at the
same time indicate
which actor (if there
are multiple actors
involved in a
specific use-case)
or analysis class
has responsibility
for the action
described by an
activity rectangle

Coming up: Activity Diagram Example


Use Case

● Withdraw money from a bank account


through an ATM

13
14
15

Activity Diagrams - Notation


Start at the top black circle
If condition 1 is TRUE, go right; if
condition 2 is TRUE, go down
At first bar (a synchronization bar),
break apart to follow 2 parallel
paths
At second bar, come together to
proceed only when both parallel
activities are done
16

Activity Diagrams – Notation (concluded)

Activity – an oval
Trigger – path exiting an activity
Guard – each trigger has a guard, a logical
expression that evaluates to “true” or
“false”
Synchronization Bar – can break a trigger
into multiple triggers operating in parallel
or can join multiple triggers into one when
all are complete
Decision Diamond – used to describe
nested decisions (the first decision is
indicated by an activity with multiple
triggers coming out of it)
17

Activity Diagrams – Example 1 of 5

Use Case: Receiving an Order


18

Activity Diagram – Example 2 of 5

Use Case: Receiving a Supply


19

Activity Diagram – Example 3 of 5

Use Case: Receiving an Order


and Receiving a Supply
20

Activity Diagram – Example 4 of 5


Swimlanes - Activity
Diagrams that show activities
by class
Arrange activity diagrams
into vertical zones separated
by lines
Each zone represents the
responsibilities of a particular
class (in this example, a
particular department)
21

Activity Diagram – Example 5 of 5

Decomposing an
Activity
An activity can be
decomposed into a
further Activity
Diagram
When an Activity
Diagram represents a
decomposition of a
higher-level activity,
there can be only one
start point
Disadvantages

● A disadvantage of activity diagrams is that they do


not explicitly present which objects execute which
activities, and the way that the messaging works
between them.
● Labeling of each activity with the responsible object can
be done.
● It is useful to draw an activity diagram early in the
modeling of a process, to help understand the overall
process.
● Then interaction diagrams can be used to help you
allocate activities to classes.

22

You might also like