You are on page 1of 14

Ahram Canadian University

Faculty of Computer Science and Information Technology


Department of Software Engineering

Object Oriented Software Development


SWE403

Dr. Mervat Helmy Hussein

Fall 2023 – Lecture 6


b- Object Oriented Analysis (Analysis Workflow) – Activity Diagram
▪ Functional view: Use Case diagram, Activity diagram
• describes logical processes, or functions, implemented using code
• An activity (task) is a step in a process where some work is getting done
• Activity diagram is an enhanced version of flowcharts
• An Activity diagram might be for one Use Case or a set of Use Cases or only part
of a Use Case,
• An Activity diagram for one Use Case would explain how the actor interacts with
the system to accomplish the goal of the Use Case
• Having many Use Cases is named Workflow-level activity diagram
2
Drawing Activity Diagram
• Representing Activities and Transitions:

Figure 1. A UML activity diagram for Incident.


During the action HandleIncident, the Dispatcher receives reports and allocates
resources.
Once the Incident is closed, the Incident moves to the DocumentIncident activity
during which all participating FieldOfficers and Dispatchers document the
Incident.
Finally, the ArchiveIncident activity represents the archival of the Incident related
information onto slow access medium. 3
Drawing Activity Diagram - Example

Figure 2. Activities and transitions

Ex.: You’re currently in the activity “Read a page.”


When you finish this activity, you switch to the activity “Turn a page.”

4
Drawing Activity Diagram
• Representing Guard conditions:
• A guard condition is assigned to a transition to restrict use of the transition
• The condition must test true before in order to follow the associated transition
to the next activity

Figure 3. Guard condition on a transition

Ex.: you can’t leave the table when you’ve finished your dinner unless you have
finished your vegetables
5
Drawing Activity Diagram
• Representing Decisions:
• The decision is a true/false test, only one option is possible
• Each option is identified using a guard condition

Figure 4. Example of decision in the OpenIncident process


6
Drawing Activity Diagram--- Examples on Decision and Merge points:

Figure 5. Example of decision: “Would you like chocolate, vanilla,


strawberry, or rocky road ice cream?” 7
Drawing Activity Diagram
• Representing Merge point:
• The place where two alternative paths come together and continue as one
For example, you and I might each walk from your house to the store.
I choose to walk down the left side of the street while you walk down the
right

Figure 6. A Merge point

• Representing Start and End:


• begin and end an Activity diagram

Figure 7. Begin and end notation for the Activity diagram


8
Drawing Activity Diagram -- Examples on Decision and Merge points:

Decision: condition that selects only Merge: comes from alternative paths to arrive at an
one outgoing edge from one or more activity as a result of doing any of the decision
outgoing flows. paths. 9
Drawing Activity Diagram
• Representing Concurrency:
• To show that a single process starts multiple concurrent threads or processes
• Fork nodes denote the splitting of the flow of control into multiple threads,
• Join nodes denotes the synchronization of multiple threads and their merging
of the flow of control into a single thread.

Figure 10. An example of using fork for splitting an activity and join for synchronization / merging 10
Drawing Activity Diagram --- Examples on Fork and Join:

Figure 9. An example of fork and join nodes in a UML activity diagram.

11
Drawing Activity Diagram --- Examples on Fork and Join:

12
Activity Diagram–
Example

13
Activity
Diagram–
Example.. Cont.

14

You might also like