Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Activity Diagram
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
22
Element
Start State
End State
Show where the flow ends. You can have more than one end state on the diagram (Optional)
Activity
Select Flight
33
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
44
cont.
Element
Synchronization
Decision points
Ticket Enter Credit Information [Invalid account, credit system not available ] [Unconfirmed]
[Approved]
Reserve Seat
Ticket [Purchased]
66
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
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
88
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
Cancel reservation
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
[Approved]
Reserve seat
Generate E-mail
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
1212
Example
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.
1414
Bank system
1515
Activity Diagram:
1616
Activity Diagram:
Withdraw money
1717