INTRODUCCION

RT-UML DIAGRAM

The first tab, called "RT-UML DIAGRAM", allows the user to model an UML sequence diagram that represents the system interactions between the different parties and time restrictions. A diagram showing the different part of this diagram is shown in Figure 1.

Figure 1. UML sequence diagram editor

The modelling panel has six buttons on the top, from left to right:

- The New Lifeline button allows the user to include a new lifeline in the diagram. By left-clicking the button, the tool automatically includes the new lifeline after the actors and the lifelines included before which a default name (Lifeline, Lifeline1, Lifeline2,...).
- The New Actor button allows the user to include a new actor in the diagram. By left-clicking the button, the tool automatically includes the new actor after the lifelines and actors included before which a default name (Actor, Actor1, Actor2,...).
- The New Message button allows the user to create a new message interaction between two different parties.The user must left-click over the first element on the panel (actor or lifeline sender of the message) and then left-click over the second element (actor or lifeline receiver of the message). After clicking both elements the tool will display a message from the first element to the second element which a default name (Message, Message1, Message2,...). The order of the message in the diagram relative to other messages and frames added before depends on the height where the user left-click over the first element, including the message in a frame if the user left click inside the frame.
- The New Frame button allows the user to add a new frame to the diagram. By left-clicking the button, the user can choose the type of frame to create, Alt alternative, Alt if/else, Opt optional, Loop, Par parallel or Exception. After that, the user must left-click over one actor or lifeline (it doesn't matter which one) to place the frame in the diagram. The order of the frame in the diagram relative to other messages and frames added before depends on the height where the user left-click over the diagram, including the frame in another frame if the user left click inside this other frame, except in the case of the Exception frame which is automatically place at the end of the diagram.
- The Clear button allows the user to delete the current diagram completely and starting the design again from the beginning. By left-clicking the button, a dialog will be shown to the user to confirm the action of deleting all the components.
- The Export XMI button allows the user to create an XMI document corresponding to the current diagram. By left-clicking the button, a dialog will be shown to the user to select the name and the place of this document in the operating system. Once the code has been saved, it will be displayed also in the XMI Code part of the tab.

The different types of frames that can be chosen have the following meanings:

- Alt alternative: This frame is divided into different parts (from 2 to n) which meaning is that only one of this parts if executed but we don't now which one (we don't have any way to now which part will be choose).
- Alt if/else: This frame is divided into two parts, the if part and the else part. It has a guard condition that determines which part if executed, the if part if the guard is fulfilled and the else part if the guard isn't fulfilled.
- Opt optional: The content of this frame is executed only if its guard condition is fulfilled, otherwise it waits until the condition is fulfilled.
- Loop: The content of this frame is executed repetitively while its repeat condition is fulfilled, finishing when its repeat condition isn't fulfilled. It can also have a guard condition to start its execution. (optional) and this condition can be blocking (the execution wait until the condition is fulfilled) or non-blocking (if the condition isn't fulfilled, the execution skips the frame content and continues after it).
- Par parallel: This frame is divided into different parts (from 2 to n) which meaning is that each part is executed in parallel which the other parts.
- Exception: The content of this frame is executed when the exception condition is thrown in the main workflow, finishing all the execution when the content of the frame is performed.

To save the diagram modelled, the user must choose the Save UML Diagram... option in the File menu. A dialog will be shown to the user to specify the name and the place where this diagram is save in the operating system.

To load a diagram previously saved, the user must choose the Open UML Diagram... option in the File menu. A dialog will be shown to the user to select the diagram to be opened. If the file opened isn't a valid diagram, an error message will be displayed.

### 1. Lifeline and Actor components

Once the user has added a lifeline or actor component to the diagram, it is possible to chage the component name by double-clicking over it (its color will change to orange). A text box will be shown to the user to edit the component name. Another way to change the component name is modifiying the value of the Name field in the properties table of the tab. The properties corresponding to a component will be shown by left-clicking over the component (its color will change to green). The component name cannot be repeated, otherwise an error message will be shown.

By right-clicking over one of this components a drop down menu will appear showing two options, Delete and Variables. If the user selects the first option (the color of this component and all other components affected will change to red) a dialog will be shown to confirm the action of deleting this component. If the user selects the second option a new dialog will be shown to manage variables associated with the object. This dialog allows the user to create variables (with type boolean, integer or clock), assign initial values to this variables, if possible, and delete variables previously created. The variables names asssociated with the same component and between different components cannot be repeated.

### 2. Message component

Once added a message to the diagram by the user, it is possible to chage the component name by double-clicking over it (its color will change to orange). A text box will be shown to the user to edit the component name. Another way to change the message name is modifiying the value of the Name field in the properties table of the tab. The properties corresponding to a message will be shown by left-clicking over the component (its color will change to green). The component name cannot be repeated, otherwise an error message will be shown.

By right-clicking over a message a drop down menu will appear showing five options: Delete, Update variables, Exchange variables, Time to complete and Cause exception. If the user selects the first option (the message color will change to red) a dialog will be shown to confirm the action of deleting this component. If the user selects the second option a new dialog will be shown to manage the update of variables previously created. This dialog allows the user to update a variable value (with a valid value) and to delete updates previously created (removing the content of the value text field and pressing the update button). If the user selects the third option a new dialog will be shown to manage the exchange of variables previously created. The Send variable text field is used to specify the variable sent and the Receive variable text field is used to specify the variable in which the value of the sent variable is received. Both variables must have the same type. If the user selects the fourth option a new dialog will be shown to establish a time-out. The user must specify the value of the time-out and the clock name in this dialog. Finally, if the user selects the last option a new dialog will be shown to establish a exception that can be thrown by the interaction. This exception must be an exception variable previously defined.

### 3. Frames components

By right-clicking over a frame (the color of this component and all other components affected will change to red) a dialog will be shown to confirm the action of deleting this component. This is a general behaviour to all the different frame types but other behaviours depends on the frame type.

Some frame types have guard expresions related with them. This expresions can have equality operators (==, !=) or relational operators (<, <=, >=, >). Several equality and relational operators can be combined by the use of operators and, or and parenthesis. The variables used in the guards must be previously defined, otherwise an error message will be displayed. See UPPAAL help for more information about valid guard expresions.

#### 3.1 Alt alternative

This component haven't properties to set up so left-clicking or double-clicking over it have not effect.

#### 3.2 Alt if/else

This component have a guard to determine which part of the frame is executed. By double-clicking over this component it is possible to specify its guard expresion. It is compulsory to set a guard for this frame before exporting it to a XMI document. Another way to change the component guard is modifiying the value of the Guard field in the properties table of the tab. The properties corresponding to this frame will be shown by left-clicking over the component (its color will change to green).

#### 3.3 Opt optional

This frame also have a guard to determine if the content is executed or it has to wait until the condition is fulfilled. By double-clicking over this component it is possible to specify its guard expresion. It is compulsory to set a guard for this frame before exporting it to a XMI document. Another way to change the component guard is modifiying the value of the Guard field in the properties table of the tab. The properties corresponding to this frame will be shown by left-clicking over the component (its color will change to green).

#### 3.4 Loop

This frame have a repeat condition and its execution is repeated until this condition isn't fulfilled (but condition is tested at the end of the execution, so it has at least one execution). By double-clicking over this component it is possible to specify its repeat expresion. It is compulsory to set a repeat expresion for this frame before exporting it to a XMI document. Another way to change the component repeat condition is modifiying the value of the Repeat field in the properties table of the tab. This frame can also have a guard expresion to start its execution and this expresion can be blocking or non-blocking. By double-clicking over this component it is possible to specify its guard expresion and if the guard is or isn't blocking. This expresion is optional so it is possible to export this frame to a XMI document without specifying a guard value. In this case, no guard will be taken into account. Another way to change the component guard and blocking behaviour is editing the value of the Guard and Block fields (respectively) in the properties part of the tab. The properties corresponding to this frame will be shown by left-clicking over the component (its color will change to green).

#### 3.5 Par parallel

This component haven't properties to set up so left-clicking or double-clicking over it have not effect.

#### 3.6 Exception

This frame have a name and an exception condition and its execution is performed when the exception in the condition is thrown (an exception variable or a timeout). By double-clicking over this component it is possible to specify its exception name and condition. It is compulsory to set an exception condition for this frame before exporting it to a XMI document. Another way to change the component exception condition is modifiying the value of the Exception field in the properties table of the tab.