IBM
Contents Index Previous Next



Managing Message Sequence Charts


Besides the SDL tools, SDL Suite and TTCN Suite also support the Z.120 recommendation, also known as Message Sequence Charts (MSC). You should have a basic understanding of MSC symbols to fully understand this exercise.

In this tutorial we will demonstrate some application areas of MSCs.

What You Will Learn

Inserting an MSC into the Organizer

To create an MSC, you use the Organizer, where the MSC will be managed as an Other Document. In this exercise, we will create an MSC where you will describe the dynamic behavior of the system DemonGame. You will also use this MSC as a reference when simulating and validating the system (this is done in later exercises).

To create an MSC:

  1. Select the Organizer chapter Other Documents.
  2. From the Edit menu, select the command Add New, or click the quick button for this.
  3. The Add New dialog is opened, prompting you to specify a diagram name and type.

Figure 78 : Specifying the name and type of the diagram to add

Adjust the dialog options as in Figure 78 above:
  • Set New document type to MSC
  • Change the name to DemonGame.
  • Show in editor should be turned on
  1. Click the OK button. An MSC icon appears in the Organizer's Other Documents chapter; the lower part of your Organizer window should look like Figure 79, once the MSC Editor is started (you may have to raise the Organizer window if the MSC Editor covers it).

Figure 79 : The Organizer structure with an MSC added

The MSC you have inserted into the Organizer is intended to describe the behavior of the system and you will associate it with the system diagram. The association will be visible in the Organizer.
  1. Make sure the MSC icon is selected and select the Associate command from the Edit menu. A dialog is displayed.

Figure 80 : Associating an MSC with an SDL diagram

  1. Select the system DemonGame item in the list and click OK.
  2. Look at the resulting Organizer structure. In addition to the MSC icon in the Other Documents chapter, an MSC Link icon appears, connected to the system diagram icon. If you select it, the Organizer's status bar informs you about the link to the actual MSC.
    • If you do not see any MSC Link icon, check the Organizer's View Options, turn the option Association Symbols on and click Apply.

Figure 81 : Association between the System diagram and the associated MSC

Editing an MSC

  1. Raise the MSC Editor window for the newly added MSC symbol. The window of the MSC Editor looks similar to the SDL Editor window, but provides of course a different symbol menu and different set of commands and quick-buttons.

Figure 82 : The MSC Editor window (on UNIX)

Your next task is to use the MSC Editor to create the following diagram:

Figure 83 : The MSC for the system DemonGame

The MSC basically consists of four instances (the vertical lines starting with a rectangle), a number of messages (the horizontal lines ending with an arrow), a create process (the dashed horizontal line), a timer (the symbol starting with an hourglass and ending with an arrow) and two condition symbols (with the shape of a hexagon). You also find a text symbol, containing a textual comment in it.

How to Draw the MSC

We suggest that you draw the MSC as described below. If you are unsure what symbol in the symbol menu to use, select or point to a symbol and look at the description in the Status Bar.

  1. Start by entering the text symbol and fill in its contents. (This is done in the same way as with the SDL Editor).
  2. Then, insert the three instances with the instance name Environment, Main and Demon:
    • To insert an instance, locate the instance head symbol in the symbol menu, select it and place it into the drawing area as shown in Figure 83; as soon as you insert an instance head, the MSC Editor automatically appends an instance axis (with an infinite length).
    • Type in the text to assign the instance name (Environment, Main, Demon)
    • To assign the instance kind (process Main, process Demon), select the small rectangle located immediately above the instance head symbol and type in the text.

Figure 84 : The text attributes associated to an instance head

  1. Once the three instances are added, insert the message Newgame:
    • Select the message symbol in the symbol menu
    • Move the pointer into the diagram. You will notice that a circle indicates a start position outside an instance axis.
    • Click once on the instance axis Environment to define the start of the message.
    • Move the pointer towards the instance axis Main. The message arrow follows the pointer, and a filled circle now indicates an end position outside an instance axis.
    • Click a second time on the instance axis Main to specify the end of the message.
    • Type in the name of the message (Newgame).
    • If you are not satisfied with the placement of a message, you may move it up or down by dragging the mouse. You may also move only the start or end position of the message along the instance axis.
  2. The instance Game is dynamically created. To add Game, you use the create process symbol. You insert it in a similar fashion as a message:
    • Select the create process symbol in the symbol menu.
    • Click once on the instance axis Main to specify the source of the create process symbol.
    • Click a second time to specify the location of the instance head. A process create and an instance head with its axis are inserted.
    • Fill in the instance kind and instance name fields (after you have selected the instance head).
    • If desired, you may move the instance head symbol.
  3. Continue by adding the first condition symbol to the instance axis Game:
    • Select the condition symbol in the symbol menu, and move the pointer to the instance axis. Click to insert the symbol and fill in the name of the condition: Losing.
    • The condition symbol may now be moved vertically along the instance axis.
  4. Add a timer to the instance axis Demon:
    • Select the timer symbol in the symbol menu.
    • Click once on the instance axis to specify the base of the timer symbol.
    • Move the pointer downwards and click a second time on the same instance axis to locate the end of the timer (the end must reside below the source).
    • Enter the name of the timer: T
    • You may drag the start or endpoint to resize the timer symbol, if required. You may also drag the symbol to move it up or down.
  5. Insert the message Bump.
  6. Add the second condition symbol, Winning, to the instance axis Game.
  7. Add the remaining messages. The message Score also contains a parameter with the value 1. To enter the parameter value, select the lower of the two selection rectangles and type in the text 1.

Figure 85 : The text attributes associated to a message

  1. Conclude the editing of the MSC by adding a process stop symbol.
    • Select the symbol in the symbol menu.
    • Place it by a click on the instance axis Game, below the last message.
  2. Before leaving the MSC Editor, you should save the MSC. When saving the newly created diagram, the editor suggests the file name DemonGame.msc. Accept the suggested file name by clicking the OK button.

http://www.ibm.com/rational
Contents Index Previous Next