Sei sulla pagina 1di 17

Information Systems Engineering

Activity Diagram

Source Mastering UML with Rational Rose 2002

11

Activity Diagram
Activity diagrams illustrate the flow of functionality in a system

It used in requirements gathering to illustrate the flow of events through a use case

These diagrams define where the workflow starts, where it ends, what activities occur during the workflow, and in what order the activities occur

An activity is a task that is performed during the workflow


Source Mastering UML with Rational Rose 2002

22

Elements of Activity Diagram


Notation Representation
Show where the flow begins. Each activity diagram must have one and only one start state

Element

Start State

End State

Show where the flow ends. You can have more than one end state on the diagram (Optional)

Activity

A step in the process

Select Flight

Source Mastering UML with Rational Rose 2002

33

Elements of Activity Diagram cont.


Notation Representation
An entity that is used or changed by an activity in the flow. You can understand where and how the object's state changes.

Element
Object Name [State]

Objects

Object Flows

Link objects to activities. from an activity to the object it changes, or from the object to the activity that needs to use it (as input).

Transitions

shows how the flow of control moves from one activity to another

Source Mastering UML with Rational Rose 2002

44

Elements of Activity Diagram


Notation Representation
A way to show that two or more branches of a flow occur in parallel. It can be either horizontal or vertical

cont.

Element

Synchronization

Decision points

Shows decision point in the work flow

Source Mastering UML with Rational Rose 2002

Ticket Enter Credit Information [Invalid account, credit system not available ] [Unconfirmed]

[Approved]

Reserve Seat

Ticket [Purchased]

Generate Confirmation Number

Source Mastering UML with Rational Rose 2002

66

Elements of Activity Diagram

Activity: Actions
A detailed steps can be added to the activity by using actions. Actions are smaller steps that take place within an activity They may occur at one of four times:

Upon entering the activity. An entry action occurs as soon as the activity begins - "entry When exiting the activity. An exit action occurs as you are leaving the activity - "exit While performing the activity. These actions occur while in the activity and continue until you leave the activity - do Upon a specific event. These actions happen if and only if a specific event occurs - "event followed by the event name
Source Mastering UML with Rational Rose 2002

77

Elements of Activity Diagram

Activity: Actions

cont.

Display Available Flights entry/ Find all flights for selected cities entry/ Determine flights with available seats do/ Display list of flights with available seats event/ User request cost information/ Display cost information

Source Mastering UML with Rational Rose 2002

88

Elements of Activity Diagram

Transitions: Limitations

Event:

The event must happen in order for the transition to occur The transition arrow is labeled with the event name, along with any arguments in parenthesis

Reserve seat

Cancel

Refund credit purchase

Cancel reservation

Source Source Mastering UML with Rational Rose 2002

Mastering UML with

Elements of Activity Diagram

Transitions: Limitations

cont.

Guard condition:

While an event triggers a transition, a guard condition controls whether or not the transition can occur If a guard condition is present, it must be true in order for the transition to occur The guard condition is listed along the transition arrow, following any event, and is enclosed in square brackets
Reserve seat

[New reservation]
Mastering UML with

Generate Confirmation Number

Source Source Mastering UML with Rational Rose 2002

Elements of Activity Diagram

Synchronization & Decision Point Example


Enter Credit Information [Invalid account, credit system not available ]

[Approved]

Reserve seat

Generate Confirmation Number

Generate E-mail

Display Confirmation Number Source


Mastering UML with Rational Rose 2002

1111

Example
Draw a detailed activity diagram for the rent a video item use case.
1. 2. 3. 4. 5. 6.

Clerk scans card Clerk scans desired video(s) Terminal displays details of each video scanned Verify customer(not a customer, unreliable, customer found) Terminal displays price and due date Terminal prints receipt for signature

Source Mastering UML with Rational Rose 2002

1212

Example

Source Mastering UML with Rational Rose 2002

1313

Practice
Draw a use case diagram for a Bank system The following use cases are defined: Open customer account Deposit funds Transfer funds Withdraw money Order bank statment View account history Change PIN

Draw a detailed activity diagram for the Open customer account and Withdraw money use cases.

Source Mastering UML with Rational Rose 2002

1414

Use case Diagram:

Bank system

Source Mastering UML with Rational Rose 2002

1515

Activity Diagram:

Open customer account

Source Mastering UML with Rational Rose 2002

1616

Activity Diagram:

Withdraw money

Source Mastering UML with Rational Rose 2002

1717

Potrebbero piacerti anche