UML Activity Diagrams.

Slides:



Advertisements
Similar presentations
OOAD – Dr. A. Alghamdi Mastering Object-Oriented Analysis and Design with UML Module 3: Requirements Overview Module 3 - Requirements Overview.
Advertisements

Information System Design IT60105
Extending the Requirements Model - techniques for detailing use cases
1 Chapter 4 Dynamic Modeling and Analysis (Part I) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
1 Chapter 4 Dynamic Modeling and Analysis (Part I) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
Interaction Diagrams Activity Diagram State Machine Diagram
UML Activity Diagrams In UML an activity diagram is used to display the sequence of actions They show the workflow from start to finish Detail the many.
Uml and Use Cases CS 414, Software Engineering I Mark Ardis Rose-Hulman Institute January 9, 2003.
1 CS 691z/791z Topics in Software Engineering Chapter 13: Activity Diagrams & Chapter 19: Basic Statecharts [Arlow and Neustadt, 2002] March 8, 2007.
1 CS 426 Senior Projects Chapter 14: Activity Diagrams [Arlow and Neustadt, 2005] February 17, 2009.
Requirements Analysis Activity Diagrams b511.ppt © Copyright De Montfort University 2000 All Rights Reserved INFO2005 Requirements Analysis.
Activity Diagrams Derived from several techniques: Event diagrams of Jim Odell SDL state modeling techniques Workflow modeling Petri nets Especially useful.
COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved COMP1007 Introduction to Requirements Analysis Lecture.
Slide 1 Chapter 8 Behavioral Modeling. Slide 2 Key Ideas Behavioral models describe the internal dynamic aspects of an information system that supports.
SE-565 Software System Requirements More UML Diagrams.
1 Business Models Modeling. 2 Why Model the Business Business modeling is a technique to help answer critical questions, such as: What do the workers.
1 Lab Beginning Analysis and Design 4 Completion of first version of use case diagram initiates the processes of analysis and design. 4 UML provides.
Unified Modeling Language
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
Software Engineering EKT 420. What is Activity Diagram Activity diagrams are graphical representations of workflows of stepwise activities and actions.
Interaction Modeling. Sequence Models  There are two kinds of sequence models: scenarios and sequence diagrams  A scenario is a sequence of events that.
Chapter 7 Structuring System Process Requirements
Chapter 8: Modelling Interactions and Behaviour UML Activity Diagram
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 21. Review ANALYSIS PHASE (OBJECT ORIENTED DESIGN) Functional Modeling – Use case Diagram Description.
Chapter 14. Activity Modeling for Transformational Systems
Requirements Artifacts Precursor to A & D. Objectives: Requirements Overview  Understand the basic Requirements concepts and how they affect Analysis.
Interaction Models (2): Sequence Diagrams Extracted from textbook: Object Oriented Modeling and Design with UML M. Blaha, J. Rumbaugh 1.
Activity diagrams. Introduction ● Activity diagrams are a behavioural model that represent the dynamics of the system. ● An activity diagram is essentially.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
Faculty of Applied Engineering and Urban Planning Software Engineering Department Software Engineering Lab Use Cases Faculty of Information system Technology.
Shanghai Jiao Tong University 上海交通大学软件工程中心 Object Oriented Analysis and Design Requirements Overview.
© 2008 Prentice Hall, Ovidiu Noran Lecture 7b 1 Modelling OO Logic Requirements: Sequence Diagrams and Activity Diagrams (Textbook Chapter 8, Appendix)
ASU Course Registration System System Analysis Communication Diagram Use Case: Select Courses to Teach.
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
UNIFIED MODELING LANGUAGE(UML) BY Touseef Tahir Lecturer CS COMSATS Institute of Information Technology, Lahore.
Chapter 11 Activity Diagrams. 2 “Activity diagrams are a technique to describe procedural logic, business processes, and work flows” - M. Fowler An activity.
CS212: Object Oriented Analysis and Design Lecture 34: UML Activity and Collaboration diagram.
A Student Guide to Object-Oriented Development
Systems Analysis and Design in a Changing World, Fourth Edition
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 26. Review UML behavioral Diagrams – Sequence diagram.
1 LAB What is Collaboration diagram? 4 Collaboration diagrams illustrate the interaction between the objects, using static spatial structure. 4.
Essentials of Visual Modeling w/ UML Instructor Notes
Chapter 3: Introducing the UML
1 Week 6 Software Engineering Fall Term 2015 Marymount University School of Business Administration Professor Suydam.
Capturing Requirements. Questions to Ask about Requirements 1)Are the requirements correct? 2)Consistent? 3)Unambiguous? 4)Complete? 5)Feasible? 6)Relevant?
 Activity diagram is basically a flow chart to represent the flow from one activity to another activity.
Interaction Models (2): Activity Diagrams Extracted from textbook: Object Oriented Modeling and Design with UML M. Blaha, J. Rumbaugh.
1 7 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 7 The Object-Oriented Approach to Requirements.
Software Engineering: Models David Millard
UML Activity and Sequence Diagrams David Millard
GOVT. ENGINEERING COLLEGE, AJMER. A SEMINAR PRESENTATION ON UNIFIED MODELING LANGUAGE(UML) SUBMITTED TO:-PRESENTED BY:- Dr. REENA DADHICHPALLAVI VASHISTHA.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 UML Activity Diagrams.
Business Process and Functional Modeling
Identifying & Creating Use Cases – Part 2
Analysis Classes Unit 5.
Activity Diagrams.
School of Business Administration
Business Models Modeling.
Activity Diagram.
Activity and State Transition Diagram
Chapter 8: Modelling Interactions and Behaviour UML Activity Diagram
Activity Diagrams.
UML Activity Diagrams.
UML Activity Diagrams & State Charts
Use Case Modeling - techniques for detailing use cases
Week 12: Activity & Sequence Diagrams
Activity Diagrams.
Interaction diagrams Interaction diagrams are models that describe how groups of objects collaborate in some behavior. Typically, an interaction diagram.
Identifying & Creating Use Cases - Part 3
Chapter 14. Activity Modeling for Transformational Systems
Presentation transcript:

UML Activity Diagrams

Flow Models Every computer-based system is an information transform .... computer based system input output Flow diagrams – Lots of these! Dataflow diagrams Petri Nets IDEF0 Activity diagrams

Flow Models: UML Activity Diagrams We have gone through great pains in use case modeling to say the use case diagram is not a flow diagram But we have flow right in front of us in the scenarios! So where do we capture it in our model? UML Activity Diagrams UML equivalent of a flowchart You can represent (multiple) flows directly with the Activity diagram

What Is an Activity Diagram? An activity diagram in the use-case model can be used to capture the activities and actions performed in a use case. It is essentially a flow chart, showing flow of control from one activity or action to another. The goal of this section is to introduce the students to the concept of an activity diagram. You are not expected to teach them everything about this diagram at this time. Activity diagrams can also be used to model the workings of an operation, an object, business modeling, or anything that involves modeling the sequential steps in a computational process. This course focuses on using activity diagrams to model the flow of events in a use case. Flow of Events This use case starts when the Registrar requests that the system close registration. 1. The system checks to see if registration is in progress. If it is, then a message is displayed to the Registrar and the use case terminates. The Close Registration processing cannot be performed if registration is in progress. 2. For each course offering, the system checks if a professor has signed up to teach the course offering and at least three students have registered. If so, the system commits the course offering for each schedule that contains it. Activity 2 The workflow of a use case describes that which needs to be done by the system to provide the value the served actor is looking for. It consists of a sequence of activities and actions that together produce something for the actor. The workflow often consists of a basic flow and one or several alternative flows. The structure of the workflow can be described graphically with the help of an activity diagram. Activity 1 Activity 3

Example: Activity Diagram Initial / Start Decision Walk the students through the activity diagram and explain each component (decision, fork, join, and so on). Activity/Action Select Course Concurrent Threads [ delete course ] Delete Course [ add course ] Synchronization Bar (Fork) Guard Condition Check Schedule Check Pre-requisites Synchronization Bar (Join) [ checks completed ] [ checks failed ] An activity diagram may include the following elements: Activity/Action represents the performance of a step within the workflow. Transitions show the activity/action that follows. Decisions evaluate conditions defined by guard conditions. These guard conditions determine which of the alternative transitions will be made and, thus, which activities are performed. You may also use the decision icon to show where the threads merge again. Decisions and guard conditions allow you to show alternative threads in the workflow of a use case. Synchronization bars show parallel sub-flows. They allow you to show concurrent threads in the workflow of a use case. Assign to Course Resolve Conflicts Transition Update Schedule Merge Final / Termination

Activity Diagrams Summary of Notation: Action/Activity state – Action states cannot be decomposed, Activity states may be (UML 1.5 - as of UML 2.0 replaced with Activity frames) Transition – control flow; a transition is triggered upon completion of some activity Decision/Merge point – standard if-else style logic; also supports iteration. Guard conditions indicated in brackets in each transition. Object node – may be (typically not) included to show where an object’s state may change. Synchronization bar – supports fork/join semantics for concurrent processing Swimlanes – partition by responsibility, not thread label Label [state]

Activity Diagram Action Decision Fork Join Flow A step in the flow of events Figure from IBM Decision Flows split based on a guard condition Fork Beginning of concurrent flows Join End of concurrent flow Activities describe graphically the flow of events of a use case. The flow of events consists of a sequence of activities that together produce something of value for the actor. The flow of events consists of a basic flow and one or several alternative flows. Actions: Represent the performance of an activity or step within the flow of events. Flow/Edge: Show what activity state follows after another. Decision/Merge Control which flow (of a set of alternative flows) follows once the activity has been completed, based on a guard condition. Decisions are used to show alternative threads in the flow of events of a use case. Forks/Joins: Show the beginnings and ends of parallel subflows. Forks and joins are used to show concurrent threads in the flow of events of a use case. Flow Show the sequence of activities

What is an Activity (frame)? A specification of behavior expressed as a flow of execution via sequencing of subordinate units. Subordinate units include nested activities and individual actions. May have boolean constraints when activity is invoked/exited There has been some confusion about “Action” vs. “Activity” UML 1.5 used both terms Now, an Activity is a “task” that a collection of “actions” realize It is structure - a collection of actions If a high-level activity is viewed as a tree of nested activities, the leaves of the tree are actions. Actions include arithmetic and string functions, manipulations of objects and their values, communications among objects, and similar things. Kinds of actions include: Accept call Accept event Apply function Broadcast event Call Create Destroy Raise exception Read Reply Return Send Time Write Activity 2 <<Precondition>> Boolean constraint Activity 4 An activity is notated as an activity diagram. An activity definition is shown as a large rounded border containing a graph of node symbols and flow arrows representing the decomposition of the activity into its constituents. Activity preconditions and postconditions use the note notation with the keywords <<Precondition>> and <<Postcondition>> respectively. An action is a primitive activity which is the smallest computation that can be expressed. An action is an activity that does something to the state of the system or extracts information from it. An action is drawn as a rectangle with rounded corners. Action preconditions and postconditions use the note notation with the keywords <<localPrecondition>> and <<localPostcondition>> respectively. <<Postcondition>> Boolean constraint Activity 5

Mapping Who does What to Whom Examples so far show us what actions happen But “WHO” does each action and “WHEN”? Swimlanes Partition activities according to who does them Who can be actors, system components, whatever When is indicated top-to-bottom (like a sequence diagram) or left-to-right To Whom? Activity diagrams can show relationships to objects that are affected by actions

Example by Bau Yoon Teck

How do you derive Swimlanes? Swimlanes add an analysis step You are assigning a responsibility to an actor Note we did not say to an object - to an actor How to do? Technique: Return to the UC main scenario Outline format the steps based on who does them PA selects “Check Out” System renders summary PA enters credit card PA selects “Submit” System asks 3rd party verify 3rd party verifies System confirms for PA PA selects “Check Out” System renders summary PA enters credit card PA selects “Submit” System asks 3rd party verify 3rd party verifies System confirms for PA

What Role do Objects Play? We think of UML as OO, but rarely do we see an Object on an Activity diagram Activity diagrams are for flow modeling Object behaviors are typically modeled using an UML Statechart But yes objects can be shown: Do if it is important to show critical object state changes or dataflow in the activity diagram context!

Example: Activity Diagram w/ Objects Objects! (should really use [] for state) Example from http://www.uml-diagrams.org/activity-diagrams-examples.html

Activity Diagram Summary Pros: Map use case scenarios directly on to actions Most intuitive for most procedural programmers Includes constructs concurrency and task assignment Includes constructs for top down decomposition (activity frames) Cons: Some confusion of the relationship between activity diagrams and statecharts Some changes in terminology from 1.5 to 2.0 Relatively poor tool support Recommendation: Useful early in analysis, after use cases but before interaction diagrams