IBM
Contents Index Previous Next



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.

Note:

The normal Paste command in the Edit menu is very different from Paste As. A normal paste can only be performed in the same editor as the object was copied from, and the pasted object is as far as possible an identical copy of the object.

The Paste As Process

The process of using Paste As consists of the following steps:

  1. Copy (or cut) an object to the clipboard.
    A single object is selected and copied to the clipboard by using the Copy command in the Edit menu of the editor. The Paste As command supports the following objects being copied:
    • A class symbol in an OM Editor.
    • An object symbol in an OM Editor.
    • A text fragment in a Text Editor that either contains no endpoints or exactly matches an endpoint.
      It is thus not possible to use Paste As with copied SDL or MSC symbols, or with Text symbols copied in an OM Editor.
  2. 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.
  3. 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.
  4. 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.
  5. Place the pasted object.
    If the pasted object is a graphical symbol, a "floating" symbol must be placed with the mouse in the usual way, and the paste can be cancelled by pressing <Esc>. If the pasted object is a textual description or an Organizer document, the object is placed at the text cursor or the current selection.
  6. Edit the pasted object, if needed.
    The results of the object transformation may not be complete or accurate. The user may need to change the pasted object to achieve the desired result.

The Paste As Dialog

The Paste As dialog is opened when Paste As is selected from the Edit menu.

Figure 138 : The Paste As dialog

The Link Info Dialog

The Link Info dialog is opened when the Link Info button is pressed in the Paste As dialog.

Figure 139 : The Link Info dialog

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.

Copied object Paste As in OM Editor Paste As
in SDL Editor
Paste As in MSC Editor Paste As
in Text Editor
Paste As in Organizer

Class

(in OM Editor)

Class

Object

System Type

Block Type

Block

Process Type

Process

Service Type

Service

Text symbol with NEWTYPE

Text symbol with SDL interface

--

C++ class

C struct

IDL Module

IDL interface

ASN.1 sequence

System

Object

(in OM Editor)

Class

Object

Block instance

Process instance

Service instance

--

--

System

Text fragment

(in Text Editor)

Class

Object

--

Instance

Message

Text fragment

MSC

Note:

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:

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.

Figure 140 : Two class symbols in the same scope

Note:

Even if there are more than one class symbol in the scope, only the copied symbol will be linked with the pasted object (if a link is created). Links are not created for the other symbols in the scope.

Paste As object, with description Resulting objects and diagrams

Class symbol


The pasted class is simply a copy of the merged class.

Object symbol


The pasted object contains the merged attributes of the class. The object is named `a' followed by the class name.

System Type diagram

Block Type diagram

Block diagram


In these cases, only a reference symbol is created, not any contents of the diagram.

Process Type diagram

Service Type 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).

Process diagram

Service diagram


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.

Text symbol with NEWTYPE


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.

System diagram


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.

C++ class definition


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;

};

C struct definition


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);

IDL module


Only the class name is used.

The link to the module is inserted inside an IDL comment.

// module ClassName

module ClassName {

};

IDL interface


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);

};

ASN.1 sequence


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.

Figure 141 : An Object symbol

Paste As object, with description Resulting objects and diagrams

Class symbol


The pasted class uses the class name, attributes and operations from the copied object and the object's class symbols.

Object symbol


The pasted object uses the name and attributes from the copied object and the object's class symbols, but without attribute values.

Block instance diagram

Process instance diagram

Service instance diagram


The pasted diagram becomes an instance diagram (indicated in the Organizer).

System diagram


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.

Note:

The copied text fragment must either contain no endpoints, or exactly match an existing endpoint in the text. If the text fragment contains both endpoint text and non-endpoint text, it cannot be used for Paste As.

Paste As object, with description Resulting objects and diagrams

Class symbol


Syntax check is performed on the class name.

Object symbol


Syntax check is performed on the object name.

Text fragment


The pasted text is simply a copy of the copied text.

Text Fragment

MSC instance

MSC message out

MSC message in


The two message types place the endpoint at different ends of the message line.

MSC diagram


In the Organizer, the MSC 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 MSC Editor.


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