UML Activity Diagrams & State Charts

Slides:



Advertisements
Similar presentations
© 2005 by Prentice Hall Appendix 3 Object-Oriented Analysis and Design Modern Systems Analysis and Design Fourth Edition Jeffrey A. Hoffer Joey F. George.
Advertisements

Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
UML State chart/machine diagram State machine diagram is a behavior diagram which shows discrete behavior of a part of designed system through finite state.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 04. Other.
Activity Diagrams [Arlow and Neustadt, 2005] CS 425 / 625 Seminar on Software Engineering University of Nevada, Reno Department of Computer Science & Engineering.
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.
1 CS 691z/791z Topics in Software Engineering Chapter 20: Advanced Statechart Modeling [Arlow and Neustadt, 2002] March 8, 2007.
1 CS/CPE 426 Senior Projects Chapter 21: State Machines Chapter 22:Advanced State Machines [Arlow and Neustadt 2005] March 24, 2009.
1/31 CS 426 Senior Projects Chapter 1: What is UML? Chapter 2: What is UP? [Arlow and Neustadt, 2005] January 22, 2009.
THE OBJECT-ORIENTED DESIGN WORKFLOW Statechart Diagrams.
Advanced Behavioral Modeling
1 CS 426 Senior Projects Chapter 1: What is UML? Chapter 2: What is UP? [Arlow and Neustadt, 2002] January 26, 2006.
COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved COMP1007 Introduction to Requirements Analysis Lecture.
SE-565 Software System Requirements More UML Diagrams.
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
What is UML? What is UP? [Arlow and Neustadt, 2005] January 23, 2014
Lecture 4 Finite State Machine CS6133 Software Specification and Verification.
BPMN By Hosein Bitaraf Software Engineering. Business Process Model and Notation (BPMN) is a graphical representation for specifying business processes.
UML A CTIVITY D IAGRAMS 1 Dr. Hoang Huu Hanh, OST – Hue University hanh-at-hueuni.edu.vn.
Business Informatics Group Institute of Software Technology and Interactive Systems Vienna University of Technology Favoritenstraße 9-11/188-3, 1040 Vienna,
Information System Design IT60105
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 UML Activity Diagrams.
Unified Modeling Language User Guide Section 4 - Basic Behavioral Modeling Chapter 19 – Activity Diagrams.
Chapter 11 Activity Diagrams. 2 “Activity diagrams are a technique to describe procedural logic, business processes, and work flows” - M. Fowler An activity.
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.
CS212: Object Oriented Analysis and Design Lecture 34: UML Activity and Collaboration diagram.
Systems Analysis and Design in a Changing World, Fourth Edition
CS3773 Software Engineering Lecture 06 UML State Machines.
1 Technical & Business Writing (ENG-715) Muhammad Bilal Bashir UIIT, Rawalpindi.
Chapter 14: Activity Diagrams November 2015 [Arlow and Neustadt, 2005] CS 425/625 Senior Projects University of Nevada, Reno Department of Computer Science.
State Machine Diagram Chapter 5 Introduction Pages
UML ACTIVITY DIAGRAM 1. Recap Formal Use Case diagram UML notation for use cases Examples 2.
1 7 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 7 The Object-Oriented Approach to Requirements.
Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2005] CS 426 Senior Projects in Computer Science University of Nevada,
Cliquez pour modifier le style du titre Cliquez pour modifier les styles du texte du masque Deuxième niveau Troisième niveau Quatrième niveau Cinquième.
Activity Diagram.
Systems Analysis and Design in a Changing World, Fourth Edition
Appendix 3 Object-Oriented Analysis and Design
Analysis Classes Unit 5.
Activity Diagrams.
UML Diagrams By Daniel Damaris Novarianto S..
State Machine Model.
What is UML? What is UP? [Arlow and Neustadt, 2005] October 5, 2017
Activity Diagram.
Activity and State Transition Diagram
Chapter 4: Use Case Modeling
Activity Diagram.
Visit for more Learning Resources
UML Diagrams Jung Woo.
State Machine Diagrams
Activity Diagrams.
Business System Development
Software Engineering Chapter 5 (Part 3) System Modeling Dr.Doaa Sami.
Chapter 19: Interfaces and Components
CS 426 Senior Projects Chapter 9: Relationships
States.
CS/CPE 426 Senior Projects
Chapter 14: Activity Diagrams
Activity Diagrams.
CS/CPE 426 Senior Projects
Dynamic Modeling Lecture # 37.
Chapter 14: Activity Diagrams
Chapter 14: Activity Diagrams
CS 791Z State Machines & Advanced State Machines
CIS 375 Bruce R. Maxim UM-Dearborn
Appendix 3 Object-Oriented Analysis and Design
Behavioral Diagrams P. P. Mahale
Presentation transcript:

UML Activity Diagrams & State Charts CS 709 UML Activity Diagrams & State Charts November 2, 2017 From Chapters 14, 21, and 22 [Jim Arlow and Ila Neustadt, UML 2 and the Unified Process, Addison-Wesley 2005] University of Nevada, Reno Department of Computer Science & Engineering

Outline Part 1 - Activity diagrams Introduction Activities Nodes Action nodes Control nodes Object nodes Activity parameters Activity diagrams

Introduction: What are activity diagrams? A form of “object-oriented flowcharts” Attached to modeling elements to describe behavior Typically attached to use cases, classes, operations, components, and interfaces Can also be used to model business processes and workflows Activity diagrams

Introduction: Where are activity diagrams used? Commonly used in: Analysis To model the flow of a use case To model the flow between use cases Design To model details of an operation To model details of an algorithm Business modeling To model a business process As always in modeling, it is important to keep them simple and understandable by their intended audience Activity diagrams

Activities ***** Activity diagrams are networks of nodes connected by edges Nodes Action nodes – atomic units of work within the activity Control nodes – control the flow through the activity Object nodes – represent objects used in the activity Edges Control flows – depict the flow of control through activity Object flows – depict the flow of objects through activity Activity diagrams

* Activities **** Activities and actions can have pre- and post-conditions Tokens (part of semantics but not shown graphically) abstractly flow in the network and can represent: The flow of control An object Some data A token moves from a source node to a target node across an edge depending on: Source node post-conditions Edge guard conditions Target node preconditions Activity diagrams

** Activities *** Example of an activity (“send letter”), Fig. 14.2 [Arlow & Neustadt 2005] Activity diagrams

*** Activities ** Activity diagrams can model use cases as a series of actions. Activity diagrams

**** Activities * Activity diagrams have semantics based on Petri Nets They model behavior using the token game Tokens move through the network subject to conditions Object nodes represent objects flowing around the system Example of flow of control token Activity diagrams

***** Activities Activity diagrams can be divided in partitions (swimlanes) using vertical, horizontal, or curved lines. Activity diagrams

Action nodes **** Action nodes execute when: There are tokens present at all their input nodes AND The input tokens satisfy all action node’s local preconditions Activity diagrams

* Action nodes *** After execution, the local post-conditions are checked; if all are satisfied, the node simultaneously offers tokens to all its output edges (this is an implicit fork that may give rise to many flows) Activity diagrams

** Action nodes ** Types of action nodes, Table. 14.1 [Arlow & Neustadt 2005] Activity diagrams

*** Action nodes * A call action node invokes an activity, behavior, or operation Activity diagrams

**** Action nodes An accept time event action node responds to time Activity diagrams

Control nodes ** Control nodes manage the flow of control within an activity Table 14.2 [Arlow & Neustadt 2005] shows the types of control nodes Activity diagrams

* Control nodes * Examples of decision and merge nodes Activity diagrams

** Control nodes Examples of join and fork nodes Activity diagrams

Object nodes ** Object nodes indicate that instances of a particular classifier are available at a specific point in the activity They are labeled with the name of the classifier and represent instances of that classifier or its subclasses The input and output edges are object flows The objects are created and consumed by action nodes When an object node receives an object token on one of its input edges, it offers this token to all its output edges, which compete for the token. Activity diagrams

* Object nodes * Object node notation and their buffer semantics. Object nodes act as buffers – places in the activity diagram where object tokens can reside while waiting to be accepted by other nodes (via edges). Activity diagrams

** Object nodes Examples of using object nodes. Note that object nodes can represent objects in particular states. Activity diagrams

Activity parameters Activities can have object nodes to provide inputs and outputs Activity diagrams

From Chapter 21: State Machines & Part 2 – State Charts From Chapter 21: State Machines & Chapter 22: Advanced State Machines (partial) [Arlow and Neustadt 2005]

Outline State machines Advanced state machines Introduction State machine diagrams States Transitions Events Advanced state machines Composite states Simple Orthogonal History

Introduction Both activity diagrams and state machine diagrams model system behavior However, they have different semantics: Activity diagrams are based on Petri Nets and usually model processes when several objects participate State machines are based on Harel’s statecharts and typically used to model single reactive objects

Introduction Reactive objects: Respond to external events May generate and respond to internal events Have a lifecycle modeled as a progression of states, transitions and events May have current behavior that depends on past behavior State machines are used to model behavior of items such as classes, use cases, subsystems, systems

Introduction State machines are most commonly used to model dynamic behavior of classes In a software process, machines can be used in: requirements, analysis, design A significant challenge is testing state machines: manual walkthrough, simulation, code generation + test harnesses for state machines

State machine diagrams There are three main modeling elements in state diagrams: states, transitions, and events. Example of a simple state machine, Fig. 21.2 [Arlow & Neustadt]

States Summary of UML state syntax

Transitions Summary of UML syntax for transitions in behavioral state diagrams, Fig.21.5 Where: event(s)= internal or external occurrence(s) that trigger the transition guardCondition = boolean expression, when true the transition is allowed anAction = some operation that takes place when the transition fires

Transitions A junction pseudo-state represents a point where transitions merge or branch

Transitions A junction pseudo-state may have more than one output transition (protected by mutually exclusive guard conditions)

Transitions Choice pseudo-state can also be used:

Events Events can be of four types: Call event Signal event Change event Time event

Events Example of a call event, Fig.21.11 [Arlow & Neustadt 2005]

Events A signal is a package of information sent asynchronously between objects. Example of signal Event, Fig. 21.12 Example of sending a Signal, Fig. 21.13

Events Change events are positive edge triggered. Example of a change event, Fig. 21.15 [Arlow & Neustadt 2005]

Events Time events are indicated by the keywords when and after. Example of a time event:

Example of a state machine [Dascalu 2001]

Composite states A composite state contains one or more nested state machines (submachines), each existing in its own region, Fig 22.2 The composition icon is shown in Fig. 22.4

Simple composite states A superstate that contains a single region is called a simple composite state,

Orthogonal composite states Orthogonal composite states consist of two or more sub-machines that execute in parallel. Composite states below are Initializing and Monitoring

Orthogonal composite states The composite state Initializing:

Orthogonal composite states The composite state Monitoring

History Example of using the shallow history indicator

History Example of using the deep history indicator