![]() |
![]() |
![]() |
![]() |
![]() |
The Paste As Command
The command Paste As is available in the Edit menu of the Organizer and in the SDL Suite editors (except for SC or HMSC diagrams).
The Paste As command is used to paste a copied object as another object, and at the same time create an implementation link between the copied and pasted objects. It is also possible to paste a cut object, but in this case no link can be created.
It is possible to paste the object into an editor different from the one the object was copied from. This requires a transformation of the object according to the user's choice.
Paste As supports the SOMT method, which governs the possible transformations for a particular object. See the SOMT Methodology Guidelines starting in chapter 69 in the User's Manual for information and advice on when to use a particular transformation.
The Paste As Process
The process of using Paste As consists of the following steps:
- Copy (or cut) an object to the clipboard.
- Paste the object using Paste As.
- In the desired editor or the Organizer, the Paste As command is selected from the Edit menu. The menu choice is dimmed if:
- More than one object was copied.
- An object different from the list above was copied.
- The copied object cannot be pasted into the tool, i.e. there is no transformation defined for this particular object-tool combination. The possible transformations are listed in Transformation Scheme.
- After selecting the menu choice, the Paste As dialog is opened. See The Paste As Dialog.
- Select the type of object to paste the copied object as.
- In the Paste As dialog, the possible resulting object types are listed in an option menu. The object types listed reflects the transformations possible for this particular copy-paste situation. If the desired object type is not present in the list, the user may have to change which object is being copied, the editor where the paste is made, or (for the SDL Editor) the type of SDL diagram being pasted into.
- Select the type of link to create, if any.
- In the Paste As dialog, it is possible to change the default of creating an "Implementation Link" between the copied and pasted objects. See The Link Info Dialog. If the object was cut instead of copied, no link can be created.
- Place the pasted object.
- Edit the pasted object, if needed.
The Paste As Dialog
The Paste As dialog is opened when Paste As is selected from the Edit menu.
- Paste <copied object> as
- The option menu contains all possible types of objects that can be created in the current situation; in some cases, only a single alternative is available. A default object type is pre-selected. The possible object types and the default are presented in Transformation Scheme.
- Create link from copied object to pasted object
- Link name: <link name>
- Paste As
- Link Info
The Link Info Dialog
The Link Info dialog is opened when the Link Info button is pressed in the Paste As dialog.
- Link name
- An editable text field specifying the name (type) of the link to create. The name is preset to "Implementation Link". The five latest used link names when creating links is available in the Select option menu. Selecting a name from this menu inserts the name into the text field.
- The link name text field must not be empty.
- Link comment
Transformation Scheme
The table below presents all the possible object type combinations for the copied and pasted object in the Paste As operation. The preselected choice shown when the Paste As dialog is opened is shown in bold face.
Not all object types are possible to Paste As in all situations. Especially in the SDL Editor, the available object types depend on which diagram type the Paste As is performed in.
Transformation Details
The details of the specific object transformations are described in the following subsections. Please refer to the above table to see which tools that support a particular object transformation.
Some general transformation details are:
- The name of a copied symbol can be empty. When pasted as an SDL diagram, the name "EmptyName" will be used.
- In SDL diagrams, if the name used for a pasted symbol will be in conflict with an already existing name, the pasted name will be the original name suffixed by "_<number>". For example, if "Name" already exists for a reference symbol in an SDL diagram, the pasted symbol will have the name "Name_1". The number is incremented until the name is unique.
- The size of the pasted SDL, MSC and OM symbols are the same as when a symbol is manually picked from the editor's symbol menu.
- The exact layout of generated diagrams may not be depicted correctly in the following illustrations. Only the upper left part of a diagram is shown.
Pasting an OM Class
An OM class may be represented and defined by several class symbols in the OM diagrams. This is the case if more than one class symbol with exactly the same class name is found within the OM scope (the diagram itself or the diagrams in the same Organizer module).
When an OM class is pasted, all class symbols defining the class in the scope are considered. It is the combined set of attributes and operations in the class symbols that will be used in the transformation to the pasted object.
In the following descriptions of object transformations, we use the two class symbols shown in Figure 140 (within the same scope) as a generic example. Regardless of which class symbol is copied, both class symbols are considered in the transformations.
The pasted object contains the merged attributes of the class. The object is named `a' followed by the class name.
In these cases, only a reference symbol is created, not any contents of the diagram.
A reference symbol is created, as well as the referenced diagram with some contents.
The keyword "{async}" after an operation means that it will be transformed using a signal interface. A gate named `G' followed by the class name, and a signal list named "SL" followed by the class name, is added.
The keyword "{sync}" after an operation means that it will be transformed using an RPC interface. The procedure diagram is created with an additional heading symbol containing FPAR and RETURNS statements for parameters and return type.
If no keyword is given, signal interface is the default for operations without return value, and RPC interface is the default for operations with return value.
NOTE: Text symbols containing the declarations of the signal list and the remote procedures must be created by a separate Paste As operation, usually in a diagram at a higher level. See Text symbol with SDL interface (below).
The same transformation as for process type and service type, but the signal interface is added as a SIGNALSET statement in the additional heading symbol.
NOTE: Text symbols containing the declarations of the signal list and the remote procedures must be created by a separate Paste As operation, usually in a diagram at a higher level. See Text symbol with SDL interface (below).
Text symbol with SDL interface
A text symbol is added, containing declarations for the signal list and/or remote procedures, as described for process type and service type above.
A text symbol is added, containing a NEWTYPE definition. Operator diagrams are added for all operations, with additional heading symbols containing FPAR and RETURNS statements for parameters and return type.
If an operation does not have parameters, a parameter is inserted with the class name as type. The class name is also used as return type if an operation does not specify any.
In the Organizer, the system diagram is added in the same way as for the Add New operation, i.e. the diagram is added as a new root diagram at the current selection. The diagram is also opened in the SDL Editor.
The link to the class definition is inserted inside a C++ comment.
// class ClassName class ClassName { public: void Oper1(); ReturnType Oper2(T1 P1); void Oper3(T1 P1, T2 P2); private: Attr1; Type Attr2; };The link to the struct definition is inserted inside a C comment.
/* struct ClassName */ typedef struct { Attr1; Type Attr2; } ClassName; void Oper1(ClassName *); ReturnType Oper2(ClassName *, T1 P1); void Oper3(ClassName *, T1 P1, T2 P2); // module ClassName module ClassName { };Operations marked with keyword "{async}" will get the string oneway void inserted before the name of the operation.
The link to the interface is inserted inside an IDL comment.
// interface ClassName interface ClassName { attribute Attr1; attribute Type Attr2; oneway void Oper1(); ReturnType Oper2(T1 P1); oneway void Oper3(T1 P1, T2 P2); };The link to the sequence is inserted inside an ASN.1 comment.
// ClassName SEQUENCE ClassName ::= SEQUENCE { Attr1, Attr2 Type }Pasting an OM Object
In a similar way as when pasting an OM class, all object symbols of exactly the same class in the scope are considered. It is the combined set of attributes in the object symbols that will be used in the transformation to the pasted object.
In addition, the class that the object is an instance of is also considered, if it exists. That is, it is the combined set of attributes and operations in the class symbols and the objects symbols that will be used in the transformation.
In the following descriptions of object transformations, we use the object symbol shown in Figure 141 as a generic example. In addition, the object is assumed to be located in the same scope as the two class symbols shown in Figure 140.
The pasted class uses the class name, attributes and operations from the copied object and the object's class symbols.
The pasted object uses the name and attributes from the copied object and the object's class symbols, but without attribute values.
The pasted diagram becomes an instance diagram (indicated in the Organizer).
Works in the same way as when pasting an OM class. The name of the diagram will be
"Object : ClassName".See System diagram.
Pasting a Text Fragment
In the following descriptions of object transformations, we use the text fragment "Text Fragment" as a generic example.
http://www.ibm.com/rational |
![]() |
![]() |
![]() |
![]() |