How to Fill-in a UML State's Body?

You can define entry activity, exit activity and do activity (i.e. activity to perform) for each state in a state machine diagram. Furthermore, you can specify the pre and post condition, and the body for each of them. In this tutorial, you can learn how to specify these values, and how to show/hide them in the state body through updating the presentation options of state.

August 16, 2010
Views: 51,854
PDF Download
  1. Download Disc Player.vpp. You can also find this file at the bottom of this tutorial.
  2. Open the downloaded .vpp file in Visual Paradigm. To open a project, select Project > Open from the application toolbar.
  3. Take the following state machine diagram as an example:
    state machine diagram
  4. Next, enter values for the Await Action state. Right-click on the Await Action state and select Open Specification... from the pop-up menu.
    open spec
  5. In the State Specification window, you can enter entry activity, do activity, and exit activity. Try to enter values for entry. Click on the drop-down menu of Entry. In the Activity Specification, enter the name as Read Disc Info, the precondition as disc is auto disc, and the body as read disc information. Click the OK button.
    edit entry
  6. Edit do activity and exit activity for the Await Action state following the table shown below:
      Name Body
    Do (activity) Show Disc Info Show disc information
    Exit (activity) Clear Disc Info Clear disc information
  7. Now, enter values for the Play Disc state. Right-click on the Play Disc state and select Open Specification... from the pop-up menu. Enter entry activity, do activity, and exit activity following the table shown below:
      Name Body
    Entry (activity) Show Track Info Show track information
    Do (activity) Play Track Output audio
    Exit (activity) Clear Track Info Clear track information
  8. The result of editing values for both states:
    editing result
  9. If you want to hide the values in the state body, right-click on the diagram's background and de-select Presentation Options > State Display Options > State Show Pre-condition, Postcondition and Body of Internal Activities from the pop-up menu.
    deselect show
  10. The result of the hidden value for all states:
    hidden result