Prev | Next |
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 Browser window open a Class and locate the operation to be added to the diagram. |
|
3 |
Drag the operation on to the diagram. |
|
4 |
When the operation has been added to the diagram, the CallOperation Action resembles this: |
Change the operation that an Action refers to
Step |
Action |
See also |
---|---|---|
1 |
Right-click on the Action and select the 'Advanced | Set Operation' option. The 'Set Operation' dialog displays. |
Set Feature 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. |
Notes
- If you want to locate, in the Browser window, 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' 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 or ; 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)
- In a simulation, the CallOperation Action must have a calling operation and a target object ActionPin, the operation belonging to the object that comes from the target ActionPin; if you don't set these properties, simulation will be blocked at the Action