State Machine Diagrams

Similar documents
STATE MACHINES. Figure 1: State Machines

UNIT-4 Behavioral Diagrams

Ingegneria del Software Corso di Laurea in Informatica per il Management

Meltem Özturan

Unified Modeling Language 2

Exercise Unit 2: Modeling Paradigms - RT-UML. UML: The Unified Modeling Language. Statecharts. RT-UML in AnyLogic

Interactions A link message

Object-Oriented Modeling. State Machine Diagram. Slides accompanying Version 1.0

visualstate Reference Guide

Appendix D: Mapping BPMN to BPD Profile

UML- a Brief Look UML and the Process

CS 370 REVIEW: UML Diagrams D R. M I C H A E L J. R E A L E F A L L

UNIT 5 : Advanced Behavioral Modeling

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 8: Modelling Interactions and Behaviour

12 Tutorial on UML. TIMe TIMe Electronic Textbook

Enterprise Architect. User Guide Series. UML Models. Author: Sparx Systems. Date: 30/06/2017. Version: 1.0 CREATED WITH

Pieter van den Hombergh. Fontys Hogeschool voor Techniek en Logistiek. September 9, 2016

JOURNAL OF OBJECT TECHNOLOGY

OMG Modeling Glossary B

In This Lecture You Will Learn: Specifying Control. Statechart. Event, State and Transition

Lesson 11. W.C.Udwela Department of Mathematics & Computer Science

What s Next. INF 117 Project in Software Engineering. Lecture Notes -Spring Quarter, Michele Rousseau Set 6 System Architecture, UML

UML Diagrams MagicDraw UML Diagrams

Dynamic Modeling - Finite State Machines

What is a Class Diagram? A diagram that shows a set of classes, interfaces, and collaborations and their relationships

What is a Class Diagram? Class Diagram. Why do we need Class Diagram? Class - Notation. Class - Semantic 04/11/51

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

Software Design and Analysis CSCI 2040

Finite State Machines and Statecharts

Activities Radovan Cervenka

Using Choice and Junction Points in RSARTE vs RoseRT

Sequence Diagrams. Massimo Felici. Massimo Felici Sequence Diagrams c

Object-Oriented and Classical Software Engineering

3. Business Process Diagrams

User Interface Design with Components

Advanced State Modeling

Thirty one Problems in the Semantics of UML 1.3 Dynamics

Finite State Machine Modeling for Software Product Lines. Finite State Machines and Statecharts

Advanced Software Engineering

A Comparison of Event-driven Process Chains and UML Activity Diagram for Denoting Business Processes

Combined Modeling and Programming with State Machines

Business-Driven Software Engineering Lecture 5 Business Process Model and Notation

UML 2.0 State Machines

Goals of this Lecture States and State Diagrams

A UML 2 Profile for Variability Models and their Dependency to Business Processes

Software Service Engineering

Statecharts 1.- INTRODUCTION 1.- INTRODUCTION

3. Business Process Diagram Concepts

Business Process Modeling. Version /10/2017

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

C++ State Template Class Library STTCL Concept. Version 2.0 / Mar 17, 2013 Author: Günther Makulik

Software Specification 2IX20

Introduction Events States Transition State Diagrams State Diagram Behavior Advanced State Modeling In-Class Exercises.

System Design, Modeling, and Simulation using Ptolemy II

CH 5:: STATE MODELING. Prepared by: Ms. Pankti Dharwa (SVBIT)

Enterprise Architect - UML Dictionary

LAB-03 BPMN Resource Perspective and Events

Activity Diagram Written Date : September 02, 2016

Business Process Model and Notation (BPMN)

System Analysis and Design. Statecharts

Transactum Business Process Manager with High-Performance Elastic Scaling. November 2011 Ivan Klianev

State Machine Diagrams

EXTENDED DISTRIBUTED UML-BASED PROTOCOL SYNTHESIS METHOD

William Stallings Data and Computer Communications. Chapter 10 Packet Switching

Modeling with Activity Diagram

SCXML State Chart XML

UML Fundamental. OutLine. NetFusion Tech. Co., Ltd. Jack Lee. Use-case diagram Class diagram Sequence diagram

UML REFERENCE SHEETS. 2013, 2014 Michael Marking; all rights reserved, including moral rights. Web site:

8.1 Interaction Diagrams. Object-Oriented Software Engineering Practical Software Development using UML and Java. Interactions and messages

UML 2.0 UML 2.0. Scott Uk-Jin Lee. Division of Computer Science, College of Computing Hanyang University ERICA Campus

Lecture 16: Hierarchical State Machines II

EE249 Lab September 30 h, 2008 Hugo A. Andrade

Explicit Modeling of Semantics Associated with Composite States in UML Statecharts 1

CA314 Object Oriented Analysis & Design - 7. File name: CA314_Section_07_Ver01 Author: L Tuohey No. of pages: 16

Object Oriented Design. Program Design. Analysis Phase. Part 2. Analysis Design Implementation. Functional Specification

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) MODEL ANSWER

Software Engineering. Page 1. Objectives. Object-Behavioural Modelling. Analysis = Process + Models. Case Study: Event Identification

Übungsfragen für den Test zum OMG Certified UML Professional (Intermediate) Download

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

UNIVERSITY OF OSLO Department of Informatics. Exploration of UML State Machine implementations in Java. Master thesis. Morten Olav Hansen

Model-based Run-Time Software Adaptation for Distributed Hierarchical Service Coordination

UNIT I. 3. Write a short notes on process view of 4+1 architecture. 4. Why is object-oriented approach superior to procedural approach?

Concurrent Models of Computation

SCXML State Chart XML. Previously, in this course...

Object-Oriented Modeling. Sequence Diagram. Slides accompanying Version 1.0

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

OCL Support in MOF Repositories

Introduction to Software Engineering. 6. Modeling Behaviour

Formal specification of semantics of UML 2.0 activity diagrams by using Graph Transformation Systems

4. Business Process Diagram Graphical Objects

Chapter 10. Object-Oriented Analysis and Modeling Using the UML. McGraw-Hill/Irwin

Enterprise Architect Training Courses

From Analysis to Design. LTOOD/OOAD Verified Software Systems

The Java Memory Model

OO Using UML: Dynamic Models

Specifying Precise Use Cases with Use Case Charts

Activity Nets: A UML profile for modeling workflow and business processes

Interaction Modelling: Sequence Diagrams

INTRODUCTION TO UNIFIED MODELING MODEL (UML) & DFD. Slides by: Shree Jaswal

Chapter 5, Analysis: Dynamic Modeling

Transcription:

State Machine Diagrams

Introduction A state machine diagram, models the dynamic aspects of the system by showing the flow of control from state to state for a particular class. 2

Introduction Whereas an activity diagram models the flow of control from activity to activity, a state machine diagram models the flow of control from event to event. State machine diagrams show how an object reacts to external events or conditions during the course of its lifetime. Useful in modeling real-time systems or the part of a system that interacts with a human user. 3

State Machine Diagrams As an example, the following state machine diagram shows the states that a door goes through during its lifetime. The door can be in one of three states: "Opened", "Closed" or "Locked". Notice that not all events are valid in all states; for example, if a door is opened, you cannot lock it until you close it. Also notice that a state transition can have a guard condition attached: if the door is Opened, it can only respond to the Close event if the condition doorway->isempty is fulfilled.

State Terms and Concepts A state is a condition or situation during the life of an object in which it satisfies some condition, performs some activity, or waits for some event. A state may include Name Entry/exit actions Internal transitions Activities Substates - may sequential or concurrent Deferred events (infrequently used) 6

State Terms and Concepts Special categories of states Initial state - indicates the initial starting state for for the state machine or a substate. Final state - indicates the state machine s execution has completed. 7

A state has several parts. 1. Name: A textual string that distinguishes the state from other states; a state may be anonymous, meaning that it has no name 2. Entry/exit actions: Actions executed on entering and exiting the state, respectively 3. Internal transitions: Transitions that are handled without causing a change in state 4. Sub states :The nested structure of a state, involving disjoint (sequentially active) or concurrent (concurrently active) sub states 5. Deferred events : A list of events that are not handled in that state but, rather, are postponed and queued for handling by the object in another state

Transitions A transition is a relationship between two states indicating that an object in the first state will perform certain actions and enter the second state when a specified event occurs and specified conditions are satisfied. On such a change of state, the transition is said to fire. Until the transition fires, the object is said to be in the source state; after it fires, it is said to be in the target state. For example, a Heater might transition from the Idle to the Activating state when an event such as toocold (with the parameter desiredtemp) occurs.

1. Source state: The state affected by the transition; if an object is in the source state, an outgoing transition may fire when the object receives the trigger event of the transition and if the guard condition, if any, is satisfied 2. Event trigger :The event whose reception by the object in the source state makes the transition eligible to fire, providing its guard condition is satisfied 3. Guard condition: A Boolean expression that is evaluated when the transition is triggered by the reception of the event trigger; if the expression evaluates True, the transition is eligible to fire; if the expression evaluates False, the transition does not fire and if there is no other transition that could be triggered by that same event, the event is lost

4. Action : An executable atomic computation that may directly act on the object that owns the state machine, and indirectly on other objects that are visible to the object 5. Target state: The state that is active after the completion of the transition

Introduction 12

Terms and Concepts Advanced States and Transitions Entry action - Upon each entry to a state, a specified action is automatically executed. Syntax (to be placed inside the state symbol): entry / action Exit action - Just prior to leaving a state, a specified action is automatically executed. Syntax (to be placed inside the state symbol): exit / action 13

Terms and Concepts Advanced States and Transitions Internal Transitions - The handling of an event without leaving the current state. Used to avoid a states entry and exit actions. Syntax (to be placed inside the state symbol): event / action Activities - Ongoing work that an object performs while in a particular state. The work automatically terminates when the state is exited. Syntax (to be placed inside the state symbol): do / activity Activities are ongoing operations; actions are instantaneous operations. 14

Terms and Concepts 15

Terms and Concepts Advanced States and Transitions Deferred Event - An event whose occurrence is responded to at a later time. Syntax (to be placed inside the state symbol): event / defer Once an event has been deferred it remains deferred until a state is entered where that particular type of event is not listed as deferred. The state diagram then responds to the event as if it had just occurred. 16

Terms and Concepts Advanced States and Transitions Simple state - A state that contains no substates. Composite state - A state that contains substates. Substate - A state that is nested inside another state. Substates allow state diagrams to show different levels of abstraction. Substates may be sequential or concurrent. Substates may be nested to any level. 17

Terms and Concepts Advanced States and Transitions Sequential Substates - The most common type of substate. Essentially, a state diagram within a single state. The containing state becomes an abstract state. The use of substates simplifies state diagrams by reducing the number of transition lines. A nested sequential state diagram may have at most one initial state and one final state. 18

Terms and Concepts 19

State Machine Diagrams Choice Pseudo-State - A choice pseudo-state is shown as a diamond with one transition arriving and two or more transitions leaving. The following diagram shows that whichever state is arrived at, after the choice pseudostate, is dependent on the message format selected during execution of the previous state.

State Machine Diagrams Junction Pseudo-State - Junction pseudo-states are used to chain together multiple transitions. A single junction can have one or more incoming, and one or more outgoing, transitions; a guard can be applied to each transition. Junctions are semantic-free. A junction which splits an incoming transition into multiple outgoing transitions realizes a static conditional branch, as opposed to a choice pseudo-state which realizes a dynamic conditional branch.

State Machine Diagrams Terminate Pseudo-State - Entering a terminate pseudo-state indicates that the lifeline of the state machine has ended. A terminate pseudo-state is notated as a cross. History States - A history state is used to remember the previous state of a state machine when it was interrupted. The following diagram illustrates the use of history states. The example is a state machine belonging to a washing machine.

State Machine Diagrams Concurrent Regions - A state may be divided into regions containing substates that exist and execute concurrently. The example below shows that within the state "Applying Brakes", the front and rear brakes will be operating simultaneously and independently. Notice the use of fork and join pseudo-states, rather than choice and merge pseudo-states. These symbols are used to synchronize the concurrent threads.

Examples

Thank You