0% found this document useful (0 votes)
27 views15 pages

Activity Diagram For Ooad

Activity diagrams show the flow of control in a system through a graphical representation of activities and their relationships. They depict the steps in a workflow or business process as a flow from activity to activity using various elements like actions, decisions, merges, and forks. Activity diagrams are commonly used to model dynamic aspects of a system, illustrate steps in a use case, or show algorithms and business processes.

Uploaded by

Hafsa Safdar
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)
27 views15 pages

Activity Diagram For Ooad

Activity diagrams show the flow of control in a system through a graphical representation of activities and their relationships. They depict the steps in a workflow or business process as a flow from activity to activity using various elements like actions, decisions, merges, and forks. Activity diagrams are commonly used to model dynamic aspects of a system, illustrate steps in a use case, or show algorithms and business processes.

Uploaded by

Hafsa Safdar
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
You are on page 1/ 15

Activity Diagram

Activity diagram
Behavioral diagram.
Show Dynamic aspects of the system.
Activity diagram is basically a flowchart to represent the flow from one activity to another
activity.
Activity Diagrams are used to illustrate the flow of control in a system and refer to the steps
involved in the execution of a use case
The control flow is drawn from one operation to another. This flow can be sequential, branched,
or concurrent. Activity diagrams deal with all type of flow control by using different elements
such as fork, join, et

3/15/2024 DEPARTMENT OF CS&IT UNIVERSITY OF JHANG


Elements used in activity diagram

3/15/2024 DEPARTMENT OF CS&IT UNIVERSITY OF JHANG


Elements
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. For objects, this is the state when
they are instantiated. The Initial State from the UML Activity Diagram marks the entry point and the
initial 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 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.
We use a line with an arrow head to depict a Control Flow. If there is a constraint to be adhered to
while making the transition it is mentioned on the arrow.

3/15/2024 DEPARTMENT OF CS&IT UNIVERSITY OF JHANG


Conti….

3/15/2024 DEPARTMENT OF CS&IT UNIVERSITY OF JHANG


Conti…
Decisions and Branching
A diamond represents a decision with alternate paths. When an activity requires a decision prior
to moving on to the next activity, add a diamond between the two activities. The outgoing
alternates should be labeled with a condition or guard expression. You can also label one of the
paths "else."
Guards
In UML, guards are a statement written next to a decision diamond that must be true before
moving next to the next activity. These are not essential, but are useful when a specific answer,
such as "Yes, three labels are printed," is needed before moving forward.

3/15/2024 DEPARTMENT OF CS&IT UNIVERSITY OF JHANG


Conti…

3/15/2024 DEPARTMENT OF CS&IT UNIVERSITY OF JHANG


Example

3/15/2024 DEPARTMENT OF CS&IT UNIVERSITY OF JHANG


Conti..
Synchronization:
A fork node is used to split a single incoming flow into multiple concurrent flows. It is
represented as a straight, slightly thicker line in an activity diagram.
A join node joins multiple concurrent flows back into a single outgoing flow.
A fork and join mode used together are often referred to as synchronization.

3/15/2024 DEPARTMENT OF CS&IT UNIVERSITY OF JHANG


Conti…

3/15/2024 DEPARTMENT OF CS&IT UNIVERSITY OF JHANG


Merge Node
Merge Node
A merge node is a control node that brings together multiple alternate flows.
It is not used to synchronize concurrent flows but to accept one among several alternate flows.
A merge node has multiple incoming edges and a single outgoing edge.

3/15/2024 DEPARTMENT OF CS&IT UNIVERSITY OF JHANG


Swimlane
Swimlane
A swimlane activity diagram groups the activities into swimlanes columns that contain all of the
activities which fit into the category represented by that swimlane.

3/15/2024 DEPARTMENT OF CS&IT UNIVERSITY OF JHANG


Uses of an Activity Diagram –
Dynamic modelling of the system or a process.
Illustrate the various steps involved in a UML use case.
Model software elements like methods, operations and functions.
We can use Activity diagrams to depict concurrent activities easily.
Show the constraints, conditions and logic behind algorithms.

3/15/2024 DEPARTMENT OF CS&IT UNIVERSITY OF JHANG


Where to use
Activity diagrams represent the flow of activities within a system and depict the workflow/
interaction between these various system activities. Flowcharts, on the other hand, represent
the sequence of steps in an event, process, or system

3/15/2024 DEPARTMENT OF CS&IT UNIVERSITY OF JHANG


Example

3/15/2024 DEPARTMENT OF CS&IT UNIVERSITY OF JHANG

You might also like