Lecture 11 - Activity Diagram
Lecture 11 - Activity Diagram
Lecture 11 - Activity Diagram
>
Modeling
Activity Diagrams
2
> Modeling Use-Case Activities
➢Activity diagram – a diagram that can
be used to graphically depict
• the flow of a business process
• the steps of a use case
• or the logic of an object behavior
(method).
3
> Activity Diagram Notations
4
> Activity Diagram Notations (cont.)
5
Guidelines for Constructing
> Activity Diagrams
➢Start with one initial node as a starting point.
➢Add an action for each major step of the use case (or each major
step an actor initiates.
➢Add flows from each action to another action, a decision point, or
an end point. For maximum precision of meaning, each action
should have only one flow coming in and one flow going out with
all forks, joins, decisions, and merges shown explicitly.
➢Add decisions where flows diverge with alternating routes. Be sure
to bring them back together with a merge.
➢Add forks and joins where activities are performed in parallel.
➢End with a single notation for activity final.
6
> Sequence Diagrams or Activity Diagram?
➢Sequence Diagrams: ➢Activity Diagrams:
• Granular view: Ideal for • High-level view: Captures the
showing interactions in a overall flow of activities in a
specific scenario system
• Emphasize chronological flow, • Emphasize the flow of activities,
and highlight the dynamic decisions, and the overall
aspects of the system structure of the system.
7
> Choosing Between Sequence and Activity Diagrams
When to Use Sequence Diagrams When to Use Activity Diagrams
8
Activity Diagram
>
9
Activity Diagram - Swimlane
>
➢A swimlane is a way to group activities performed by the same
actor on an activity diagram or activity diagram or to group
activities in a single thread.
10
>
11
> Modeling Staff Expenses Submission
12
> Swimlane and Non-Swimlane Activity Diagram
13
Business process for meeting a
> new client using an activity
Diagram without swimlane
14
> Business process for meeting
a new client using an activity
Diagram with swimlane
15
> Activity Diagram - Modeling a Word Processor
➢The workflow for a word process to create a document
through the following steps:
• Open the word processing package.
• Create a file.
• Save the file under a unique name within its directory.
• Type the document.
• If graphics are necessary, open the graphics package, create the
graphics, and paste the graphics into the document.
• If a spreadsheet is necessary, open the spreadsheet package,
create the spreadsheet, and paste the spreadsheet into the
document.
• Save the file.
• Print a hard copy of the document.
• Exit the word processing package.
16
Activity Diagram - Modeling
> a Word Processor
17
> Process Order - Problem Description
➢Once the order is received, the activities split into two parallel sets
of activities. One side fills and sends the order while the other
handles the billing.
➢On the Fill Order side, the method of delivery is decided
conditionally. Depending on the condition either the Overnight
Delivery activity or the Regular Delivery activity is performed.
➢Finally the parallel activities combine to close the order.
18
Activity Diagram
> Example - Process
Order
19
>
20