Lesson 6 - Activity
Lesson 6 - Activity
Session Outcomes
• Introduction
• Elements of Activity diagram
• Actions
• Nodes
• Edges
• controls
• Partitioning an activity diagram
• Applying activity diagrams in real world
applications
What is an activity diagram?
data entry
generate
processing
output
Activity Diagrams Notation
Rounded rectangles
36
Activity Diagram Controls – Nodes
Decision Node
🞂 A branch represents a conditional flow of control.
🞂 Each branch must have a guard condition.
🞂 The flow of control flows down the single path
where the branch condition is true.
🞂 There is no limit on the number of branches each
branch point may have.
[ Guard Condition [ Guard Condition
2] 1]
[ Guard Condition
3]
🞂 always has an [else] guard expression;
37
Decision Node
🞂 The ‘else’ branch:
🞂 is taken if all the other guard conditions are false;
🞂 is analogous to the DEFAULT option in SWITCH
statement.
Activity Diagram Controls - Nodes
Decision and Merge Nodes
Decision node Merge node
open wine
cook dinner
bottle
have dinner
Iteration
🞂 An asterisk inside an action state indicates that it
may need to be performed more than once:
🞂 This notation is used to show iteration, without the
unnecessary details of a loop construct.
🞂 The next action state does not occur until the loop
is finished.
Partitioning