Information Systems Concepts Activity Diagrams Roman Kontchakov Birkbeck, University of London Based on Chapter 5 of Bennett, McRobb and Farmer: Object Oriented Systems Analysis and Design Using UML, (4th Edition), McGraw Hill, 2010 1
Outline Activity Diagrams Section 5.3 (pp. 122 – 128) 2
Purpose of Activity Diagrams Activity Diagrams can be used to model high-level business tasks in the early stages of a project or when the relevant objects or classes have not been identified system functions (represented by use cases) or object operations but communication/sequence diagrams are closer to the spirit of object-orientation 3
Notation of Activity Diagrams Activity Diagrams are essentially Flowcharts / Petri nets in an object-oriented context sequence, selection, iteration concurrence 4
Notation of Activity Diagrams (1) action node Add a New rectangle with rounded Client corners and a meaningful name action edge Assign Staff (control flow) Contact open arrow 5
Notation of Activity Diagrams (2) initial node black circle Add a New decision node Client merge node diamond Assign Staff Contact guard condition [no campaign to add] in square brackets [campaign to add] Add New final node Campaign black circle in white circle 6
Tips on Activity Diagrams Multiple flows from an action are implicitly AND-ed Guard conditions do not have to be mutually exclusive, but it is advisable that they should be Decisions should be strictly nested, but a merge point can be combined with the following decision point 7
Notation of Activity Diagrams (3) fork node join node thick bar Add a New actions carried Client out in parallel Add New Assign Staff Campaign Contact 8
Notation of Activity Diagrams (4) class name Campaign::calculateCost Campaign::calculateCost can be shown followed getFirst getFirst (AdvertCollection::) (AdvertCollection::) by double colons in brackets (parentheses) beneath the action name Operation Name getCost getCost (Advert:) (Advert:) can be shown after the colons, when different getNext getNext (AdvertCollection::) (AdvertCollection::) with the action name [more adverts] [more adverts] [no more adverts] [no more adverts] getOverheads getOverheads (Campaign::) (Campaign::) 9
Notation of Activity Diagrams (5) objects rectangle Campaign [Active] optionally shows the state of the object in square brackets Record completion object flows of a campaign open arrow Campaign [Completed] 10
Notation of Activity Diagrams (6) activity partitions (swimlanes) Campaign Accountant Client Manager vertical columns labelled with the Record Completion person, organization, of a campaign department or system responsible Issue invoice for the activities in that column Pay invoice Record client payment 11
Administrator Campaign Manager Add a New Client Assign Staff Contact [no campaign to add] :Client [New] [campaign to add] :Campaign [Commissioned] Add New Campaign [no staff to assign] [staff to assign] Assign Staff to Campaign [more staff to assign] [no more staff to assign]
Author Author Reviewer Reviewer Typesetter Typesetter Printer Printer Write Chapter Write Chapter Review Chapter Review Chapter Revise Chapter Revise Chapter [book not [book not complete] complete] [book complete] [book complete] Typeset Book Typeset Book Activity Diagram for producing a book. Correct Proofs Correct Proofs Reset Book Reset Book Print Book Print Book
Author Author Reviewer Reviewer Typesetter Typesetter Printer Printer Write Chapter Plan Chapter Produce Write Chapter Write Chapter First Draft Review Chapter Review Chapter Revise Draft Revise Chapter Revise Chapter [not satisfied] [book not [book not [satisfied] complete] complete] Add Exercises [book complete] [book complete] Add References Typeset Book Typeset Book to Bibliography More details can be shown on a Correct Proofs Correct Proofs lower level. Reset Book Reset Book Print Book Print Book
Exercise: Supermarket Self-service Checkout 15
Take Home Messages Activity Diagrams Purpose Notation 16
Recommend
More recommend