4
Most read
7
Most read
16
Most read
SARDAR PATELSARDAR PATEL
COLLEGE OF ENGINEERING,COLLEGE OF ENGINEERING,
BAKROLBAKROL
INFORMATION TECHNOLOGYINFORMATION TECHNOLOGY
DEPARTMENTDEPARTMENT
TOPIC NAME : State Diagram
SUBJECT NAME : OBJECT ORIENTED
PROGRAMMING Using Java(2140705)
STUDENT’S NAME ENROLLMENT NUMBER
Suken Vaghela 151240116061
Sunil Jethvani 151240116062
Vaidik Trivedi 151240116064
INFORMATION TECHNOLOGY
FACULTY NAME:
PROF. RONAK PATEL
State Diagrams
Chapter 14
What is State Diagram?
• Specifically a state diagram describes the behavior of
a single object in response to a series of events in a
system. Sometimes it's also known as a Harel state
chart or a state machine diagram. This UML diagram
models the dynamic flow of control from state to
state of a particular object within a system.
State Diagrams
• State diagrams describe the life of an object using three
main elements:
• States of an object
• Transitions between states
• Events that trigger the transitions
• A state diagram or statechart specifies a state machine
• A state machine is described for a class
• Each object has it’s own state machine
States
• Show what the dependencies are between the state of
an object and its reactions to messages or other events
• State
• is a condition or situation during the life of an object within
which it performs some activity, or waits for some events
• Has a name
• Has actions -- execute the state
• Has internal transitions -- transitions cause no change in a
state
• substates -- the nested structure of a state involving disjoint or
concurrent substates
States
• For example:
entry/unlock door
do/prepare materials
telephone rings/answer telephone
include/lecture state
exit/lock door
At Work state name
action performed on entry to state
activity performed while in state
action performed on arrival of named event
name of a sub-state machine
action performed on leaving state
Actions and Activities
• Action
• is an executable atomic computation
• includes operation calls, the creation or destruction of another
object, or the sending of a signal to an object
• associated with transitions and during which an action is not
interruptible -- e.g., entry, exit
• Activity is associated with states
• Non-atomic or ongoing computation
• May run to completion or continue indefinitely
• Will be terminated by an event that causes a transition from the
state in which the activity is defined
Events
• An event signature is described as
Event-name (comma-separated-parameter-list)
• Events appear in the internal transition compartment of a state or on a
transition between states
• An event may be one of four types
• Signal event
• Corresponding to the arrival of an asynchronous message or signal
• Call event
• Corresponding to the arrival of a procedural call to an operation
• Time event
• Change event
Time Event
• A time event occurs after a specified time has elapsed
• Event name is specified as keyword after
• Parameter list is an expression evaluating to a time interval
• after(10 seconds after state “At Work” is entered)
• No specified start time implies “since entry to the current
state”
• after(2 seconds)
Change Event
• A change event occurs whenever a specified condition is met
• Event name is specified as keyword when
• Parameter list is a boolean expression
• The event occurs when both of the following conditions are met,
irrespective of the order when they happen
• The expression evaluates to true
• The object is in the required state
• For example
• when (state = At Work)
• when (date = January 1 2007)
A transition is drawn as an arrow between states annotated with a
transition string
• The transition string denotes the event and consequent action
• Only one form of arrowhead is used on statecharts
• The distinction between call events and signal events must be deducted
from elsewhere e.g. an interaction diagram
A transition string is described as
• Event-signature [guard-condition]/action-expression^object.message
• If the guard condition is met the transition occurs immediately
Transitions
Transitions
• A transition whose string contains neither an event
signature nor a guard condition is said to be
unlabeled
• Occurs immediately
• May still carry an action expression
Transitions
• A transition is triggered when its event occurs
• If the guard condition is met, the transition is fired
• If the condition is not met the event is discarded
• The guard condition is checked only once
• If there is no guard condition, triggering will always cause firing
• Note the distinction between a guard condition and a change
event
• A guard condition is evaluated once, when the associated event
occurs
• A change event occurs whenever its associated condition is met
• Behaviour is as if the condition were being continually evaluated
State Diagrams notation
PaidUnpaid
paying
Invoice
created
Invoice
destroyed
name
state
final stateInitial state
transition
event
State Diagram Example
Checking
do / check
Item
Dispatching
do / initiate
delivery
Ordering Delivering
*[all items checked]
get next item
[all items checked
&& some items not
in stock]
Order Item
[all items checked &&
all items available]
Dispatch items
[all items available]
Item
received
delivery
get first item
Canceling
cancelled
Exit/ Item received
do / order Item
entry / deliver
Items
do / Remove
Item
some items
not in stock
all items
in stock
Summary
In this chapter we have:
• Introduced the terms used with respect to state
diagrams
• Discussed the context in which state diagrams are
used

More Related Content

PPTX
Chronic Kidney Disease Prediction Using Machine Learning with Feature Selection
PDF
Plan Estratégico Institucional y el Plan Operativo Institucional
PPT
Unit 3(advanced state modeling & interaction meodelling)
PPTX
Activity diagram
PPT
Ian Sommerville, Software Engineering, 9th Edition Ch1
PPT
Use Case Diagram
PPTX
Merge sort algorithm
PPTX
Access Controls
Chronic Kidney Disease Prediction Using Machine Learning with Feature Selection
Plan Estratégico Institucional y el Plan Operativo Institucional
Unit 3(advanced state modeling & interaction meodelling)
Activity diagram
Ian Sommerville, Software Engineering, 9th Edition Ch1
Use Case Diagram
Merge sort algorithm
Access Controls

What's hot (20)

PPTX
Sequence diagram
PDF
State chart diagram
PPT
5.state diagrams
 
PDF
Activity diagram-UML diagram
PDF
PPT
State Machine Diagram
PPTX
Dynamic and Static Modeling
PPTX
Use case diagram
PPTX
Diagrams
PPTX
Activity diagram
PPT
Ooad sequence diagram lecture
PPT
UML Diagrams
PPT
Uml - An Overview
PPT
Unit 1( modelling concepts & class modeling)
PPTX
Overview of UML Diagrams
PPTX
Component diagram
PPTX
Software Measurement and Metrics.pptx
PPTX
Uml structural diagrams
PPT
Activity Diagram
PPTX
Component Diagram Example Templates
Sequence diagram
State chart diagram
5.state diagrams
 
Activity diagram-UML diagram
State Machine Diagram
Dynamic and Static Modeling
Use case diagram
Diagrams
Activity diagram
Ooad sequence diagram lecture
UML Diagrams
Uml - An Overview
Unit 1( modelling concepts & class modeling)
Overview of UML Diagrams
Component diagram
Software Measurement and Metrics.pptx
Uml structural diagrams
Activity Diagram
Component Diagram Example Templates
Ad

Similar to State Diagrams (20)

PPTX
State modeling
PPTX
events and signals in Unified modelling language
PDF
State Diagram.pdf
PPTX
OOAD___Advanced Behavioral Modeling.pptx
PPTX
state modeling In UML
PDF
Software Engineering :Behavioral Modelling - II State diagram
PPTX
STATE DIAGRAM.pptx
PPT
StateDiagrams (Unified modeling Languages)
PPTX
PPT
Seminar State Chart1
PPT
08 state diagram and activity diagram
PPTX
UML - Activity Diagrams (1) for cs.pptx
PPTX
State diagram
PPTX
State diagram
PPTX
State diagram
PDF
Free ebooks download ! Edhole
PDF
Free ebooks download ! Edhole
DOCX
States machine
PPTX
Programming models for event controlled programs
PPT
Events1
State modeling
events and signals in Unified modelling language
State Diagram.pdf
OOAD___Advanced Behavioral Modeling.pptx
state modeling In UML
Software Engineering :Behavioral Modelling - II State diagram
STATE DIAGRAM.pptx
StateDiagrams (Unified modeling Languages)
Seminar State Chart1
08 state diagram and activity diagram
UML - Activity Diagrams (1) for cs.pptx
State diagram
State diagram
State diagram
Free ebooks download ! Edhole
Free ebooks download ! Edhole
States machine
Programming models for event controlled programs
Events1
Ad

Recently uploaded (20)

PDF
Java Basics-Introduction and program control
PDF
MLpara ingenieira CIVIL, meca Y AMBIENTAL
PDF
Computer organization and architecuture Digital Notes....pdf
PPTX
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
PPTX
Management Information system : MIS-e-Business Systems.pptx
PDF
First part_B-Image Processing - 1 of 2).pdf
PPTX
Petroleum Refining & Petrochemicals.pptx
PDF
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
PPTX
CONTRACTS IN CONSTRUCTION PROJECTS: TYPES
PPTX
Feature types and data preprocessing steps
PPTX
Amdahl’s law is explained in the above power point presentations
PDF
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
PDF
Unit I -OPERATING SYSTEMS_SRM_KATTANKULATHUR.pptx.pdf
PPTX
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
PDF
Exploratory_Data_Analysis_Fundamentals.pdf
PDF
August 2025 - Top 10 Read Articles in Network Security & Its Applications
PPTX
A Brief Introduction to IoT- Smart Objects: The "Things" in IoT
PPTX
Chapter 2 -Technology and Enginerring Materials + Composites.pptx
PDF
distributed database system" (DDBS) is often used to refer to both the distri...
PPTX
ai_satellite_crop_management_20250815030350.pptx
Java Basics-Introduction and program control
MLpara ingenieira CIVIL, meca Y AMBIENTAL
Computer organization and architecuture Digital Notes....pdf
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
Management Information system : MIS-e-Business Systems.pptx
First part_B-Image Processing - 1 of 2).pdf
Petroleum Refining & Petrochemicals.pptx
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
CONTRACTS IN CONSTRUCTION PROJECTS: TYPES
Feature types and data preprocessing steps
Amdahl’s law is explained in the above power point presentations
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
Unit I -OPERATING SYSTEMS_SRM_KATTANKULATHUR.pptx.pdf
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
Exploratory_Data_Analysis_Fundamentals.pdf
August 2025 - Top 10 Read Articles in Network Security & Its Applications
A Brief Introduction to IoT- Smart Objects: The "Things" in IoT
Chapter 2 -Technology and Enginerring Materials + Composites.pptx
distributed database system" (DDBS) is often used to refer to both the distri...
ai_satellite_crop_management_20250815030350.pptx

State Diagrams

  • 1. SARDAR PATELSARDAR PATEL COLLEGE OF ENGINEERING,COLLEGE OF ENGINEERING, BAKROLBAKROL INFORMATION TECHNOLOGYINFORMATION TECHNOLOGY DEPARTMENTDEPARTMENT
  • 2. TOPIC NAME : State Diagram SUBJECT NAME : OBJECT ORIENTED PROGRAMMING Using Java(2140705) STUDENT’S NAME ENROLLMENT NUMBER Suken Vaghela 151240116061 Sunil Jethvani 151240116062 Vaidik Trivedi 151240116064 INFORMATION TECHNOLOGY FACULTY NAME: PROF. RONAK PATEL
  • 4. What is State Diagram? • Specifically a state diagram describes the behavior of a single object in response to a series of events in a system. Sometimes it's also known as a Harel state chart or a state machine diagram. This UML diagram models the dynamic flow of control from state to state of a particular object within a system.
  • 5. State Diagrams • State diagrams describe the life of an object using three main elements: • States of an object • Transitions between states • Events that trigger the transitions • A state diagram or statechart specifies a state machine • A state machine is described for a class • Each object has it’s own state machine
  • 6. States • Show what the dependencies are between the state of an object and its reactions to messages or other events • State • is a condition or situation during the life of an object within which it performs some activity, or waits for some events • Has a name • Has actions -- execute the state • Has internal transitions -- transitions cause no change in a state • substates -- the nested structure of a state involving disjoint or concurrent substates
  • 7. States • For example: entry/unlock door do/prepare materials telephone rings/answer telephone include/lecture state exit/lock door At Work state name action performed on entry to state activity performed while in state action performed on arrival of named event name of a sub-state machine action performed on leaving state
  • 8. Actions and Activities • Action • is an executable atomic computation • includes operation calls, the creation or destruction of another object, or the sending of a signal to an object • associated with transitions and during which an action is not interruptible -- e.g., entry, exit • Activity is associated with states • Non-atomic or ongoing computation • May run to completion or continue indefinitely • Will be terminated by an event that causes a transition from the state in which the activity is defined
  • 9. Events • An event signature is described as Event-name (comma-separated-parameter-list) • Events appear in the internal transition compartment of a state or on a transition between states • An event may be one of four types • Signal event • Corresponding to the arrival of an asynchronous message or signal • Call event • Corresponding to the arrival of a procedural call to an operation • Time event • Change event
  • 10. Time Event • A time event occurs after a specified time has elapsed • Event name is specified as keyword after • Parameter list is an expression evaluating to a time interval • after(10 seconds after state “At Work” is entered) • No specified start time implies “since entry to the current state” • after(2 seconds)
  • 11. Change Event • A change event occurs whenever a specified condition is met • Event name is specified as keyword when • Parameter list is a boolean expression • The event occurs when both of the following conditions are met, irrespective of the order when they happen • The expression evaluates to true • The object is in the required state • For example • when (state = At Work) • when (date = January 1 2007)
  • 12. A transition is drawn as an arrow between states annotated with a transition string • The transition string denotes the event and consequent action • Only one form of arrowhead is used on statecharts • The distinction between call events and signal events must be deducted from elsewhere e.g. an interaction diagram A transition string is described as • Event-signature [guard-condition]/action-expression^object.message • If the guard condition is met the transition occurs immediately Transitions
  • 13. Transitions • A transition whose string contains neither an event signature nor a guard condition is said to be unlabeled • Occurs immediately • May still carry an action expression
  • 14. Transitions • A transition is triggered when its event occurs • If the guard condition is met, the transition is fired • If the condition is not met the event is discarded • The guard condition is checked only once • If there is no guard condition, triggering will always cause firing • Note the distinction between a guard condition and a change event • A guard condition is evaluated once, when the associated event occurs • A change event occurs whenever its associated condition is met • Behaviour is as if the condition were being continually evaluated
  • 16. State Diagram Example Checking do / check Item Dispatching do / initiate delivery Ordering Delivering *[all items checked] get next item [all items checked && some items not in stock] Order Item [all items checked && all items available] Dispatch items [all items available] Item received delivery get first item Canceling cancelled Exit/ Item received do / order Item entry / deliver Items do / Remove Item some items not in stock all items in stock
  • 17. Summary In this chapter we have: • Introduced the terms used with respect to state diagrams • Discussed the context in which state diagrams are used