07state
Upcoming SlideShare
Loading in...5
×
 

07state

on

  • 442 views

 

Statistics

Views

Total Views
442
Views on SlideShare
442
Embed Views
0

Actions

Likes
0
Downloads
7
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • To create (open) a state diagram Click right on the class in the Browser to make the pop up menu visible. Select the Open State Diagram menu command. A state diagram is used to show the life history of a given class, the events that cause a transition from the state, and the actions that result from a state change. State diagrams are created for classes with significant dynamic behavior. In Rose, state diagrams are attached to classes.
  • To customize the sequence diagram toolbar Click right on the toolbar to make the pop up menu visible. Select the Customize menu command Click to select the button that you want to add or remove. Click the Add or Remove button to add or remove the button from the toolbar. Click the Close button to close the Customize Toolbar window.
  • To create a state Click to select the state icon on the toolbar. Click on the state diagram to place the state. While the state is still selected, enter its name. A state is one of the possible conditions in which an object may exist.
  • To create a state transition Click to select the State Transition icon on the toolbar. Click on the originating state. Drag the state transition arrow to the successor state. While the state transition is still selected, enter its name (if needed). A state transition is a change from an originating state to a successor state. Explain that some transitions are automatic transitions (no name) while other transitions are named events.
  • To create a reflexive transition Click to select the Transition to Self icon on the toolbar. Click on the state. While the transition is still selected, enter its name (if needed). A reflexive state transition is a transition where the successor state is the originating state.
  • To create multiple reflexive state transitions Click to select the State Transition icon on the toolbar. Click on the state. Move the cursor to the diagram and release the mouse button. Depress the mouse button and drag the state transition line back to the state. While the state transition is still selected, enter its name if needed. To make the state transition line rectilinear Click to select the state transition line. Select the Edit:Change Line Style:Rectilinear menu command.
  • To create state transition arguments Click right on the state transition line to make the pop up menu visible. Select the Open Specification menu command. Enter the arguments in the Arguments field. Click the OK button to close the Specification. Data that accompanies an event is shown as an argument.
  • To create a guard Click right on the state transition line to make the pop up menu visible. Select the Open Specification menu command. Select the Detail tab. Enter the guard condition in the Condition field. Rose will automatically add the brackets ([ ]). Click the OK button to close the Specification. A transition may be made conditional through the use of a guard.
  • To create an action Click right on the state transition line to make the pop up menu visible. Select the Open Specification menu command. Select the Detail tab. Enter the action in the Action field. Rose will automatically add the slash (/). Click the OK button to close the Specification. An action is an operation that accompanies a transition event.
  • To send an event Click right on the state transition line to make the pop up menu visible. Select the Open Specification menu command. Select the Detail tab. Enter the event in the Send Event field. Enter event arguments (if needed) in the Send Arguments field. Enter the name of the target class (class receiving the event) in the Send Target field. Rose will automatically add the carat (^). Click the OK button to close the Specification. One event may trigger the sending of another event. The format is: ^target class.event
  • To create a start state Click to select the Start State icon on the toolbar. Click on the diagram to place the start state. Click to select the State Transition icon on the toolbar. Click on the start state on the diagram and drag the arrow to the successor state. The start state is the initial state of an object. There is only one start state.
  • To create an end state Click to select the End State icon on the toolbar. Click on the diagram to place the end state. Click to select the State Transition icon on the toolbar. Click on the originating state on the diagram and drag the arrow to the end state. An end state is the final state of an object. There does not have to be an end state. There can also be multiple end states.
  • To create an action on entry into a state Click right on the state on the diagram to make the pop up menu visible. Select the Open Specification menu command. Select the Detail tab. Click right in the Actions field to make the pop up menu visible. Select the Insert menu command. This will insert an action labeled entry: into the Actions field. Double click on the new action to make the Action Specification visible. Select the action type -- simple or send event. If the action type is simple, enter the action in the Action field. If the action type is send event, enter the event name in the Send event field, enter any arguments in the Send arguments field (if needed) and enter the target class in the Send target field. Select the On entry radio button in the When field. Rose will automatically enter the entry: keyword. Click the OK button to close the Action Specification. Click the OK button to close the State Specification. This is often referred to as an entry action. It is shown inside the state preceded by the keyword entry.
  • To create an action upon entry until exit from a state Click right on the state on the diagram to make the pop up menu visible. Select the Open Specification menu command. Select the Detail tab. Click right in the Actions field to make the pop up menu visible. Select the Insert menu command. This will insert an action labeled entry: into the Actions field. Double click on the new action to make the Action Specification visible. Select the action type -- simple or send event. If the action type is simple, enter the action in the Action field. If the action type is send event, enter the event name in the Send event field, enter any arguments in the Send arguments field (if needed) and enter the target class in the Send target field. Select the Entry until exit radio button in the When field. Rose will automatically enter the do: keyword. Click the OK button to close the Action Specification. Click the OK button to close the State Specification. This is often referred to as an exit action. It is shown inside the state preceded by the keyword exit.
  • To create an action on exit from a state Click right on the state on the diagram to make the pop up menu visible. Select the Open Specification menu command. Select the Detail tab. Click right in the Actions field to make the pop up menu visible. Select the Insert menu command. This will insert an action labeled entry: into the Actions field. Double click on the new action to make the Action Specification visible. Select the action type -- simple or send event. If the action type is simple, enter the action in the Action field. If the action type is send event, enter the event name in the Send event field, enter any arguments in the Send arguments field (if needed) and enter the target class in the Send target field. Select the On exit radio button in the When field. Rose will automatically enter the exit: keyword. Click the OK button to close the Action Specification. Click the OK button to close the State Specification. This is often referred to as an activity. It is shown inside the state preceded by the keyword do.
  • To create a nested state Click to select the state icon on the toolbar. Click on the state diagram to draw the superstate. While the superstate is still selected, enter its name. Click to select the state icon on the toolbar. Click inside the superstate to draw the substate. While the substate is still selected, enter its name. Resize the superstate as needed. To move a state into a superstate Click to select the state to be moved Drag the state into the superstate. Resize the superstate as needed. Nested states may be used to simplify complex drawings.
  • To turn on the History icon Click right on the superstate to make the pop up menu visible. Select the Open Specification menu command. Select the Detail tab. Click to select the History checkbox. Click the OK button to close the State Specification. History provides the capability to return to the most recently visited state. History is shown by adding the history icon (a circle with an H inside it) inside a superstate.
  • This is the state diagram for the MaintainScheduleForm class.

07state 07state Presentation Transcript

  • Introduction to Rational Rose 98i Module 7: State Diagram
  • Objectives: State Diagram
    • You will be able to:
      • Create state diagrams containing
        • States
        • Transitions
        • Actions and activities
        • Nested states
  • Creating a State Diagram View slide
  • State Transition Toolbar Text Box Selection Tool Note Anchor Note to Item State State Transition Transition to Self Start State End State View slide
  • States
  • State Transitions
  • Reflexive State Transitions
  • Multiple Reflexive State Transitions
  • State Transition Arguments
  • Guarded State Transitions
  • Actions
  • Sending Events
  • Start State
  • End State
  • Actions On Entry Into the State
  • Actions Upon Entry Until Exit From the State
  • Actions Upon Exit From the State
  • Nested States
  • History
  • Exercise: State Diagram