Class Operations in Diagrams

Operations from Classes can be represented by CallOperation Action elements on any diagram (such as an Activity, Custom or Analysis diagram). When an operation is shown as an Action, the notation of the element displays the name of the operation prefixed by the name of the Class from which it comes.

Add an operation to a diagram

Step

Action

See also

1

Open the target diagram.

 

 

2

From the Project Browser open a Class and locate the operation to be added to the diagram.

 

 

3

Drag the operation on to the diagram.

 

DragOperation

 

 

4

When the operation has been added to the diagram, the CallOperation Action resembles the following:

 

Action-CallOperation

 

 

 

Change the operation that an Action refers to

Step

Action

See also

1

Right-click on the Action and select the Advanced | Set Operation menu option.

The Set Operation dialog displays.

 

Set Operation dialog

2

If necessary, in the Go To Namespace field, select the model that contains the operation.

Browse for the operation.

 

 

3

When you have located the operation, double-click on it.

The Action updates to show the new classifier and operation names.

NewAction

 

 

Notes

If you want to locate, in the Project Browser, the operation that an Action was created from, right-click on the Action in the diagram and select the Find | Locate Operation in Project Browser context menu option
If you want to display the previously-generated code for the Class containing the operation, click on the Action in the diagram and press either ( Ctrl+E ) or ( F12 ); the Code Editor view displays, with the code generated for the Class (if no code has been generated for the Class, the Code Editor does not display)