![]() |
![]() |
![]() |
![]() |
![]() |
Creating an SDL Structure
You are now ready to create your first SDL diagrams.
What You Will Learn
- To customize the Organizer chapters
- To create an SDL structure
- To add a system root node
- To create a system diagram
- To add a page
- To edit a system diagram
- To save a diagram on file
- To save a diagram structure on a system file
- To work with dialogs (modal and modeless)
- To work with tree structures
Customizing the Organizer Chapters
When the SDL Suite is started, the Organizer displays two icons that symbolizes the system file and the source directory for your diagrams. The system file will be explained later. The source directory is where the SDL Suite components will look for existing diagrams, and save newly created diagrams. (The source directory can of course be changed.)
The source directory should already be set to the directory that you started the SDL Suite from (~/demongame (on UNIX), or C:\IBM\Rational\SDL_TTCN_Suite6.3\work\demongame (in Windows)).
By default, the Organizer also shows 5 areas in its window:
These areas are known as chapters. You may use the chapters to hold a number of diagrams and documents; the actual use is a matter of personal taste and the default is to be regarded as a suggestion. As you will design a rather simple system, we suggest that you start by removing the chapters Analysis Model, Used Files and TTCN Test Specification.
- Select the chapter Analysis Model.
- Select the menu choice Remove from the Edit menu. (You may also press the <Del> button on the keyboard.)
You may also rename the remaining two chapters:
- Select the chapter SDL System Structure.
- Select the Edit menu choice from the Edit menu. (You may also double-click the chapter.)
- In the dialog that opens, make sure the option Edit chapter symbol is selected and click the Edit button.
- Change the document name in the opened Edit dialog; for instance to My first SDL system. Do not change the document type indicated by the Organizer button and the option menu value Chapter.
- On UNIX, you may note that the cursor changes to the shape of a question mark as soon as it points on the parent Organizer window. This convention has been adopted to indicate that a dialog must be closed before any other operation is allowed to take place in the tool. Dialogs that need to be answered before proceeding further are called modal dialogs.
Creating a System Diagram
Adding a Root Node
You will now create an SDL system, working in a top-down fashion:
- Make sure the chapter My first SDL system is selected.
- Select the Add New command from the Edit menu. The Add New dialog opens, prompting you to specify the name and type of diagram to add.
- Specify the New document type as SDL, and specify the SDL diagram type as System, as depicted above.
- Specify the New document name as DemonGame (the default name, Untitled, disappears).
- Make sure the Show in editor button is turned off.
- Click the OK button.
Creating the System Diagram
You have so far created an Organizer diagram structure, consisting of one reference to an SDL system diagram (the referred diagram does however not yet exist).
Your next task is to create the system diagram:
- Select the DemonGame SDL system diagram icon. See Figure 24.
- From the Edit menu, select the menu choice Edit.
- The Edit dialog opens, suggesting to create a new diagram and to Show the diagram in editor. (The dialog is very similar to the Add New dialog you just used.) Accept the suggestion by clicking OK.
The SDL Suite responds by displaying the SDL Editor window, showing the upper left corner of page 1 of the system diagram DemonGame.
The SDL Editor is the tool you use when editing the contents of the diagrams. The SDL Editor is also used for building the diagram structure that is displayed in the Organizer window.
Your next task is to fill in the contents of the diagram. Figure 27 shows the appearance of the diagram when completed and printed on paper. As you can see, the diagram consists of two block reference symbols (GameBlock and DemonBlock), a channel conveying the signals between the blocks (C3) and two channels conveying the signals to and from the environment (C1 and C2). There is also a text symbol where the signal declarations may be found.
The next pages describe in detail how you proceed to add the symbols and texts to the diagram.
Customizing the SDL Editor Window
Before you start editing, you may want to resize the editor window. You may also hide and show various sub-windows using the command Window Options from the View menu.
- You can hide and show the editor Tool bar, Status bar, printed Page breaks and the grid points.
You may also hide and show the text window and the symbol menu by clicking on the provided quick buttons. You will however need these windows soon.
Placing Block Reference Symbols
- Once you have placed the symbol, type the name of the block: GameBlock or DemonBlock
- You can type in text directly at the cursor's position. The cursor position can be set by clicking on the text in the symbol. However, you cannot select (highlight) text directly in the symbol.
- Before you have started text editing, the text cursor is not flashing. Pressing <Delete> at this stage deletes the whole selected symbol. Once text editing has started, the text cursor is flashing and pressing <Delete> only deletes a character.
- You may see a red underlining appearing in the text, if you enter a name that has incorrect syntax according to SDL. This is the general way to indicate textual syntax errors in the SDL Editor.
- When you edit text, you may also take advantage of the text window, which allows you select text by dragging. On UNIX, the text windows is located below the drawing area. In Windows, the text windows is a separate window always placed on top of the SDL Editor window (similar to the symbol menu).
- No matter where you enter the text, the text is always displayed both in the symbol and in the text window.
- You may also note that the Organizer diagram structure is automatically updated to reflect the insertion of the diagram reference symbol (once the symbol is de-selected).
Moving and Resizing Symbols
- Select and drag the block with the mouse to the desired location. (Remember, no overlap with other symbols is allowed).
After you place the blocks where you want them, you may resize them:
- Point to one of the symbol's corners, and drag. You must be fairly close to the corner. If this method fails, first select the symbol with a click and then repeat the procedure while pointing to a selection square.
Drawing Channels between Blocks
To draw a channel from block DemonBlock to block GameBlock:
- Drag the handle (i.e. press the mouse button while pointing on the handle, and start moving the mouse while keeping the mouse button pressed).
- As soon as mouse motion has begun the editor responds by drawing a line; from now on you may release the button while moving the mouse.
- Move the mouse until it points to the GameBlock symbol. Click the mouse button; the channel is connected at both ends.
- You may move the channel's endpoints individually by dragging them. Select the channel first if the endpoint is difficult to "hit" with the mouse.
- You will notice a tiny selection square at the middle of some lines drawn in the SDL Editor. This can be used to create "breakpoints" on the line, thus dividing the line into different line segments. You will not use this feature in this tutorial.
The SDL Editor creates two text attributes associated to the channel. These text fields are displayed as selection rectangles which you use when entering the name of the channel and the list of the signals the channel is to convey. Initially, when the text attributes are empty, a red underlining is shown to indicate that this is not allowed according to the syntax rules of SDL.
The two blocks have been aligned horizontally to more easily distinguish the two text attributes.
To fill in the name of the channel C3:
- Type it directly, immediately after the channel has been drawn. (If the channel has become de-selected, select it again.)
To fill in the signal Bump into the signal list text field:
- Click on the text field surrounded with two brackets `[ ]'. (Click in the space between the brackets.)
- Type the name of the signal. Note that the brackets are adjusted automatically to fit the size of the text.
- You may move the text attributes to new locations, if desired. Simply drag them with the mouse.
Drawing Channels to the Environment
To draw a channel from a block to the environment (e.g. C2):
- Select the block.
- Start by dragging the handle, and terminate by clicking on the frame symbol (the rectangle that encloses the diagram, see Figure 32 on page 64).
- Fill in the name and the signals.
- Note that, as you type the signal list, the red underlining changes and shows if and where the text is not syntactically correct according to SDL. As soon as you have entered the signal names separated with commas, the red underlining disappears and shows that the text now is syntactically correct!
- The SDL Editor allows you to leave a text containing syntax errors. However, it is not possible to build an SDL system that contains syntax errors.
Drawing a Channel from the Environment
To draw a channel from the environment to a block (e.g. C1):
- Start by drawing the channel from the block to the environment, as you just learned.
- Make sure the channel is still selected.
- Then, select the command Redirect from the Edit menu. Fill in the name and signals the usual way.
Drawing a Text Symbol
The diagram also contains a text symbol with the required signal declarations.
- Pick the text symbol in the symbol menu (the top symbol), insert it into the drawing area and fill in the contents as shown in Figure 27. The built-in syntax check is even more evident in this case.
- When the contents of the text symbol are changed, the editor automatically resizes the text symbol to fit the text. You may resize it by dragging the lower right corner, or toggle between its minimized and maximized sizes by double-clicking the symbol. Try this.
Resizing the Text Window
If the text window is too small to bring all the text in view, you may resize it. In Windows, this is done in the same way as any normal window. On UNIX, this is done by dragging the sash up or down; the sash is the small square situated to the right and above the text window menu bar; the text window is a pane of the SDL Editor window.
Other Items in the System Diagram
Except for SDL symbols, a diagram also contains the following:
Package Reference Symbol
The package reference is used to refer to included SDL packages. This simple example does not include any packages. Just leave it empty.
The Kernel Heading
The kernel heading is automatically assigned its contents by the editor to reflect the type and the name of the diagram being edited. The kernel heading is editable, but you are not going to alter its contents in this tutorial.
Additional Heading Symbol
The additional heading symbol is not defined further according to Z.100. In the SDL Editor, it looks like a dashed text symbol. The symbol is editable and may be resized the same way as you learned for resizing text symbols, but it cannot be moved. Its intended use in the SDL Editor is, among others, to define inheritance and specialization and to specify formal parameters. You will not use this symbol in this first tutorial.
Frame
The frame surrounds the objects that are contained in your diagram. You may want to resize the frame to create a more compact diagram: simply drag any corner to do this.
Page Numbering
The page numbering is updated automatically, and reflects the name of the page and the total number of pages. It is not editable.
Saving the Newly Created System Diagram
In this exercise, you will learn the commands that store SDL diagrams on files.
- You should now have two windows on the screen, the Organizer window and the SDL Editor window.
- Before you save anything, open the Organizer's View Options dialog from the View menu.
- Make sure the options are in accordance to Figure 33 and click the Apply button. This makes, among other things, the file and directory names visible in the Organizer.
- The list in the dialog is a multiple selection list. When you click on an item in the list (in Windows while holding down the <Ctrl> key), its selected state is toggled without affecting any other item. This makes it possible to select any number of items in the list. In Windows, if you by mistake click on an item without using the <Ctrl> key, you may press Default to get back to the default settings.
- To close the View Options dialog, click the Close button. This kind of dialog is modeless, meaning that it remains open until you decide it is longer needed and close it. You are not forced to close a modeless dialog to continue working with the tool, in opposite to modal dialogs, such as the Add New dialog which you used for creating a new system (see Figure 23 on page 54).
- Look at the resulting Organizer view. The system diagram icon is drawn with a gray pattern, which shows that the diagram is modified and not saved. The name of the diagram (i.e. DemonGame) is shown in bold face, to indicate that the diagram is currently open in an editor. The text to the right of the icon reads [unconnected] which is a convention adopted to show that a diagram has no current binding to a file.
- Now, go back to the SDL Editor and save the SDL diagram by selecting the Save menu choice from the File menu.
- A file selection dialog is displayed. This is a generic dialog that opens whenever you are prompted to specify a file (to open, to save, etc.). The title of the dialog shows the nature of the operation, Save in this case.
- On UNIX, this dialog works as follows:
- The Filter field is preset to *.ssy, which is the default file extension for files that contain SDL system diagrams. To list other files, you have to change the contents of the Filter field and click the Filter button (but do not do this now).
- The right list shows a list of files that match the file filter. It should be empty since you have not created any diagrams yet.
- The left list shows the directory structure from the root node of the file system down to the current directory. You may double-click here in order to navigate in your directory structure (do not use this list now).
- In Windows, this dialog works as follows:
- The Files of type field is preset to *.ssy, which is the default file extension for files that contain SDL system diagrams. To list other files, you have to change the contents of the File name field and click the OK button (but do not do this now).
- The list shows a list of files that match the file filter. It should be empty since you have not created any diagrams yet.
- The Look in list shows the directory structure from the root node of the file system down to the current directory. You may click here in order to navigate in your directory structure (do not use this list now).
- The SDL Editor suggests a file name to store the diagram on: DemonGame.ssy. You may change to any file name; we assume however in this tutorial that you accept the suggested file name.
This information is also available in the Organizer structure, where the file name has changed from [unconnected] to DemonGame.ssy.
Saving the Diagram Structure
You have, so far, saved the system diagram. You should also save the Organizer's view options and diagram structure for future sessions. If you look at the Organizer's window title, you notice an ending asterisk. This asterisk denotes that the Organizer's view or structure information has been modified and needs to be saved.
The System File
The Organizer saves its view, along with a number of options, on a dedicated file called the system file1. System files are used as a means to maintain the consistency of an SDL structure and provide immediate access to the diagrams that are defined in the structure.
The system file is represented by its own icon at the top of the Organizer view, a rectangle with "SDT" in it. Even though the system file has not yet been saved, the Organizer has assigned a file name for it.
- Select the Save command from the Organizer's File menu. The Organizer responds by issuing the Save dialog.
- The tool suggests a file name to store the information on: demongame.sdt (system files are by default assigned the extension .sdt). Accept the suggestion by clicking the Save button.
Once a system file has been created, the diagram structure and the Organizer options are saved for future sessions. You Open an existing system file from the Organizer's File menu.
More About Saving
For the purpose of this tutorial, you have learned how to save individual diagrams and how to save the system file. There are however other handy ways to save everything with one single command. Two of these methods are listed below.
1
- You may click the Save All button in the Organizer's Save dialog (see Figure 39).
You may click the quick button for Save on the Organizer's tool bar. This button orders a global and silent save of all diagrams (no prompting will be issued unless special cases need your attention), including the diagram structure. (The SDL Editor's quick button for Save saves the current diagram only.)
A system file may contain information related to any kind of SDL structure, not necessarily an SDL system. The term system file is a general term.
http://www.ibm.com/rational |
![]() |
![]() |
![]() |
![]() |