Successfully reported this slideshow.

Seminar State Chart1

2,123 views

Published on

Learn about State Chart Diagrams in UML with simple examples

Published in: Technology, Education
  • Be the first to comment

Seminar State Chart1

  1. 1. State Chart Diagram By: Bhavsar Jenish Roll No : 08
  2. 2. State Chart Diagram <ul><li>State-transition diagrams describe all of the states that an object can have, the events under which an object changes state (transitions), the conditions that must be fulfilled before the transition will occur (guards), and the activities undertaken during the life of an object (actions). </li></ul><ul><li>In comparison the other behavioral diagrams which model the interaction between multiple classes, State diagrams typically model the transitions within a single class. </li></ul><ul><li>It also shows how an entity responds to various events by changing from one state to another. </li></ul><ul><li>In most OO techniques, state diagrams are drawn for a single class to show the lifetime behavior of a single object. </li></ul>
  3. 3. Elements of State Chart Diagram <ul><li>Initial State: This shows the starting point or first activity of the flow. Denoted by a solid circle. This is also called as a &quot; pseudo state ,&quot; where the state has no variables describing it further and no activities. </li></ul>2. State: Represents the state of object at an instant of time. In a state diagram, there will be multiple of such symbols, one for each state of the Object we are discussing. Denoted by a rectangle with rounded corners and compartments (such as a class with rounded corners to denote an Object). State Name State Variables Action Contd…
  4. 4. <ul><li>Transition: </li></ul><ul><li>An arrow indicating the Object to transition from one state to the other. The actual trigger event and action causing the transition are written beside the arrow, separated by a slash. </li></ul><ul><li>Transitions that occur because the state completed an activity are called &quot; triggerless &quot; transitions. </li></ul><ul><li>If an event has to occur after the completion of some event or action, the event or action is called the guard condition. The transition takes place after the guard condition occurs. This guard condition/event/action is depicted by square brackets around the description of the event/action (in other words, in the form of a Boolean expression). </li></ul>Event/Action Contd…
  5. 5. Contd… 4. Signal: When an event causes a message/trigger to be sent to a state, that causes the transition; then, that message sent by the event is called a signal. Represented as a class with the <<Signal>> icon above the action/event. <<Signal>> Event/Action Event/Action 5. Final State: The end of the state diagram is shown by a bull's eye symbol, also called a final state. A final state is another example of a pseudo state because it does not have any variable or action described.
  6. 6. 6. Iterations: Whenever there is repetition of any action which does not make a transition to another state instead the same state reoccurs the transition is shown as given. This transition is known as a “ self-transition”. Here the source and target states are same. State 7. Decision Making: Whenever there is a requirement to check a given condition before any transition occurs then the condition is specified in [ ] brackets. State1 State2 Event/Action [ condition ]
  7. 7. 8. Region: A region is an orthogonal part of either a composite state or a state machine. It contains states and transitions. Lab1 Lab2 project First test Failed Passed Fail Studying
  8. 8. Different States of State Chart Diagram 1. Choice pseudo state: A choice vertices which, when reached, result in the dynamic evaluation of the guards of the triggers of its outgoing transitions. This realizes a dynamic conditional branch. It allows splitting of transitions into multiple outgoing paths such that 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. The boolean conditions specified are known as “guards” . [ <=10] Contd… ID [ >10] State1 State4 State3 State2 [ a=5]
  9. 9. 2. Composite State: A composite state is either a simple composite state (with just one region) or an orthogonal state (with more than one region). State1 State2 Event/Action [ condition ] 3. 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. Contd…
  10. 10. 4. Junction Pseudostate: A junction vertices are semantic-free vertices that are used to chain together multiple transitions. They are used to construct compound transition paths between states. State1 State1 State1 State1 State1 [a < 0] [a = 5] [a >7] E1 [b < 0] E2 [b < 0] Contd…
  11. 11. 5. History Deep Pseudostate: A deepHistory represents the most recent active configuration of the composite state that directly contains this pseudostate; e.g. the state configuration that was active when the composite state was last exited. A A2 A1 C Interrupt H* resume Contd…
  12. 12. 6. History Shallow Pseudostate: A shallowHistory represents the most recent active substate of its containing state (but not the substates of that substate). A composite state can have at most one shallow history vertex. A A1 A2 C Interrupt H resume Contd…
  13. 13. 7. Entry Point Pseudostate: Sometimes you won’t want to enter a sub-machine at the normal initial state. For example, in the following sub-machine it would be normal to begin in the &quot;Initializing&quot; state, but if for some reason it wasn’t necessary to perform the initialization, it would be possible to begin in the “Intialized&quot; state by transitioning to the named entry point. A1 A2 A3 Skip A1 Initializing Initialized Contd…
  14. 14. 8. Exit Point Pseudostate: An exit point pseudostate is an exit point of a state machine or composite state. Entering an exit point within any region of the composite state or state machine referenced by a submachine state implies the exit of this composite state or submachine state and the triggering of the transition that has this exit point as source in the state machine enclosing the submachine or composite state. Reading instructions Writing Error report Displaying Results Processing instructions Processing Failed to Read Contd…
  15. 15. 9. Terminate Pseudostate: Entering a 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. State Active Terminate Lift receiver /get dial tone Caller hangs up /disconnect
  16. 16. When to use the State Chart Diagrams <ul><li>Critical to workflow and workgroup applications. </li></ul><ul><li>Critical to processing any documents. </li></ul><ul><li>Critical to speeds, feeds and flows, sometimes called “Control” applications. </li></ul><ul><li>Modelling a real-time processing application. </li></ul><ul><li>Shows behaviour of a class over several use-cases. </li></ul>
  17. 18. Thanks !!

×