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.

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

State Diagram 1. State diagram: Shows the behavior of one object. They describe all of the possible states that a particular object can get into and how.
State Charts Mehran Najafi. Reactive Systems A reactive, event-driven, object is one whose behavior is best characterized by its response to events dispatched.
Nested state diagrams:Problems with flat state diagram
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
ESE Einführung in Software Engineering 7. Modeling Behaviour Prof. O. Nierstrasz.
Introduction to Software Engineering 7. Modeling Behaviour.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
Information System Design IT60105
7M701 1 Activity Diagram. 7M701 2 Example 7M701 3 Activity Diagram: what is it? Describes activities and flows of data or decisions between activities.
Ch5: Software Specification. 1 Dynamic modeling using UML  Static models:  Dynamic models:
1 CS/CPE 426 Senior Projects Chapter 21: State Machines Chapter 22:Advanced State Machines [Arlow and Neustadt 2005] March 24, 2009.
Advanced Behavioral Modeling
SE-565 Software System Requirements More UML Diagrams.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
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 10 State Machine Diagrams
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Chapter 7 Structuring System Process Requirements
מידול התנהגותי 1. Today’s Session Sequence Diagrams State Machines 2.
Business Informatics Group Institute of Software Technology and Interactive Systems Vienna University of Technology Favoritenstraße 9-11/188-3, 1040 Vienna,
Guide to State Transition Diagram. 2 Contents  What is state transition diagram?  When is state transition diagram used?  What are state transition.
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.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Information System Design IT60105
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.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 UML State Diagrams.
Systems Analysis and Design in a Changing World, Fourth Edition
States.
CS3773 Software Engineering Lecture 06 UML State Machines.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 26. Review UML behavioral Diagrams – Sequence diagram.
Chapter 14: Activity Diagrams November 2015 [Arlow and Neustadt, 2005] CS 425/625 Senior Projects University of Nevada, Reno Department of Computer Science.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 10: Statecharts.
Chapter 3: Introducing the UML
Modeling Object Lifecycles and State-Dependent Behavior ©SoftMoore ConsultingSlide 1.
Interaction Models (2): Activity Diagrams Extracted from textbook: Object Oriented Modeling and Design with UML M. Blaha, J. Rumbaugh.
® IBM Software Group © 2009 IBM Corporation Module 11: Creating State Machine Diagrams Essentials of Modeling with IBM Rational Software Architect V7.5.
1 Object Oriented Analysis System modeling = Functional modeling + Object modeling + Dynamic modeling Functional modeling = Use cases Object modeling =class.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Advanced UML State Diagrams.
Systems Analysis and Design in a Changing World, Fourth Edition
Business Process and Functional Modeling
UML Chapter 17.
Appendix 3 Object-Oriented Analysis and Design
State Machine Diagram.
State Machine Diagrams
Activity and State Transition Diagram
Activity Diagram.
Visit for more Learning Resources
State Machine Diagrams
CS251 – Software Engineering Lectures 11 State Diagrams
Business System Development
Software Engineering Chapter 5 (Part 3) System Modeling Dr.Doaa Sami.
UML Activity Diagrams & State Charts
UML State machine diagram
States.
CS/CPE 426 Senior Projects
Activity Diagrams.
CIS 375 Bruce R. Maxim UM-Dearborn
CS/CPE 426 Senior Projects
States.
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
Interaction Models (2): Activity Diagrams
Presentation transcript:

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 transitions.behavior diagram State machine diagrams can also be used to express the usage protocol of part of a system. Thus, there are two kinds of state machines :  behavioral state machine behavioral state machine  protocol state machine protocol state machine

The following nodes and edges are typically drawn in state machine diagram: behavioral state, behavioral transition, protocol state, protocol transition, different pseudostates.behavioral statebehavioral transitionprotocol stateprotocol transitionpseudostates

Behavioral State Machine Behavior is modeled as a traversal of a graph of state nodes connected with transitions. Behaviorstate transitions Transitions are triggered by the dispatching of series of events. During the traversal, the state machine could also execute some activities.

Vertex Vertex is named element which is an abstraction of a node in a state machine graph. In general, it can be the source or destination of any number of transitions. Subclasses of vertex are: ◦ state state ◦ Pseudostate Pseudostate State is a vertex which models a situation during which some (usually implicit) invariant condition holds.vertex

State State in behavioral state machines models a situation during which some (usually implicit) invariant condition holds.behavioral state machines The invariant may represent a static situation such as an object waiting for some external event to occur. However, it can also model dynamic conditions such as the process of performing some behavior (i.e., the model element under consideration enters the state when the behavior commences and leaves it as soon as the behavior is completed).

State The UML defines the following kinds of states: simple state, simple state composite state, composite state submachine state. submachine state

Simple State A simple state is a state that does not have substates - it has no regions and it has no submachine states.regionssubmachine states Simple state Waiting for Customer Input.

Simple state Simple state may have compartments. The compartments of the state are: ◦ name compartment ◦ internal activities compartment ◦ internal transitions compartment

Simple state Name compartment holds the (optional) name of the state Internal activities compartment holds a list of internal actions or state (do) activities (behaviors) that are performed while the element is in the state. The activity label identifies the circumstances under which the behavior specified by the activity expression will be invoked. The behavior expression may use any attributes and association ends that are in the scope of the owning entity. For list items where the expression is empty, the slash separator is optional.

© Lethbridge/Laganière 2005 Chapter 8: Modelling Interactions and Behaviour10 Activities in state diagrams (Lethbridge) ◦ An activity is something that takes place while the system is in a state.  It takes a period of time.  The system may take a transition out of the state in response to completion of the activity,  Some other outgoing transition may result in:  The interruption of the activity, and  An early exit from the state.

© Lethbridge/Laganière 2005 Chapter 8: Modelling Interactions and Behaviour11 Actions in state diagrams (Lethbridge) ◦ An action is something that takes place effectively instantaneously  When a particular transition is taken,  Upon entry into a particular state, or  Upon exit from a particular state ◦ An action should consume no noticeable amount of time

Internal activities compartment Simple state Waiting for Customer Input with name and internal activities compartments.

Simple state Several labels are reserved for special purposes and cannot be used as event names. The following are the reserved activity labels: ◦ entry (behavior performed upon entry to the state) ◦ do (ongoing behavior, performed as long as the element is in the state) ◦ exit (behavior performed upon exit from the state)

Simple state Internal transition compartment contains a list of internal transitions, where each item has the form as described for trigger. Each event name may appear more than once per state if the guard conditions are different. The event parameters and the guard conditions are optional. If the event has parameters, they can be used in the expression through the current event variable.

Composite state Composite state is defined as state that has substates (nested states). ◦ Simple composite state contains just one region ◦ Orthogonal composite state has more than one region Simple composite state Serving Customer has two substates.

Composite state Composite state may have compartment ◦ The compartments of the state are: ◦ name compartment ◦ internal activities compartment ◦ internal transitions compartment ◦ decomposition compartment

Decomposition compartment Decomposition compartment shows composition structure of the state as a nested diagram with regions, states, and transitions. For convenience and appearance, the text compartments may be shrunk horizontally within the graphic region. In some cases, it is convenient to hide the decomposition of a composite state. For example, there may be a large number of states nested inside a composite state and they may simply not fit in the graphical space available for the diagram.

Decomposition compartment Composite state Serving Customer with decomposition hidden. A composite state may have one or more entry and exit points on its outside border or in close proximity of that border (inside or outside).

Submachine State A submachine state specifies the insertion of the specification of a submachine state machine. The state machine that contains the submachine state is called the containing state machine. The same state machine may be a submachine more than once in the context of a single containing state machine.

Pseudostate Pseudostates are typically used to connect multiple transitions into more complex state transitions paths. Pseudostates include: ◦ initial pseudostate initial pseudostate ◦ terminate pseudostate terminate pseudostate ◦ entry point entry point ◦ exit point exit point ◦ choice choice ◦ join join ◦ fork fork ◦ junction junction ◦ shallow history pseudostate shallow history pseudostate ◦ deep history pseudostate deep history pseudostate

Initial Pseudostate An initial pseudostate represents a default vertex that is the source for a single transition to the default state of a composite state. vertexcomposite state There can be at most one initial vertex in a region. The outgoing transition from the initial vertex may have a behavior, but not a trigger or guard. An initial pseudostate is shown as a small solid filled circle. Initial pseudostate transitions to Waiting for User Input state

Terminate Pseudostate Terminate pseudostate implies that the execution of this state machine by means of its context object is terminated. The state machine does not exit any states nor does it perform any exit actions other than those associated with the transition leading to the terminate pseudostate. A terminate pseudostate is shown as a cross. Transition to terminate pseudostate

Entry Point Entry point pseudostate is an entry point of a state machine or composite state. In each region of the state machine or composite state it has at most a single transition to a vertex within the same region. An entry point is shown as a small circle on the border of the state machine diagram or composite state, with the name associated with it. Entry point user entry

Exit Point Exit point pseudostate is an exit point of a state machine or composite state. An exit point is shown as a small circle with a cross on the border of the state machine diagram or composite state, with the name associated with it. Exit point user exit

Choice Choice pseudostate realizes a dynamic conditional branch. It evaluates the guards of the triggers of its outgoing transitions to select only one outgoing transition. The decision on which path to take may be a function of the results of prior actions performed in the same run- to-completion step. A choice pseudostate is shown as a diamond-shaped symbol. Choice based on guards applied to the value inside diamond

Fork Fork pseudostate vertices serve to split an incoming transition into two or more transitions terminating on orthogonal target vertices (i.e., vertices in different regions of a composite state). The segments outgoing from a fork vertex must not have guards or triggers. The notation for a fork is a short heavy bar. The bar may have one or more arrows from the bar to states. A transition string may be shown near the bar. Fork splits transition into two transitions

Join Join pseudostate merges several transitions originating from source vertices in different orthogonal regions. The transitions entering a join vertex cannot have guards or triggers. The notation for a join is a short heavy bar. The bar may have one or more arrows from source states to the bar. A transition string may be shown near the bar. Join merges transitions into single transition

Junction Junction pseudostate vertices are vertices that are used to chain together multiple transitions. They are used to construct compound transition paths between states. For example, a junction can be used to converge multiple incoming transitions into a single outgoing transition representing a shared transition path (this is known as a merge). A junction is represented by a small black circle.

Final State Final state is a special kind of state signifying that the enclosing region is completed.state If the enclosing region is directly contained in a state machine and all other regions in the state machine also are completed, then it means that the entire state machine is completed. A final state is shown as a circle surrounding a small solid filled circle. Transition to final state.