You can assign Operations only to Call (synchronous and asynchronous) Messages. Only one Operation can be assigned to a Message.
To assign an Operation to a Message
- Type an Operation name right on the Message on the diagram pane.
- On the diagram, right-click the Message and on the shortcut menu, click Operation. Then click to select the Operation that you want to apply on the element, or click the Create Operation button.
If an Operation you are assigning to a Message has default parameter values, these default parameter values are assigned to the Message arguments. However, if the types of the Operation parameter and the Message argument do not match, the default parameter value is assigned to the Message argument.
Names of operation parameters are displayed in message signature by default. However, you can change this behavior by opening the Symbol Properties dialog (right-click a Message and select Symbol Properties) and setting the Show Attribute/Parameter Names property to true to display them or false to hide them.
To create a new Operation for a Message
You can create a new Operation only if the Lifeline the Message is drawn to has a type assigned.
- Draw a Call Message between two Lifelines or select an existing Message on a diagram pane.
- Do one of the following:
- Click the Create New Operation According to This Message button (a small green circle at the end of the Message name) and define the Operation property values in the Operation Specification window.
- On the Message shortcut menu, click Operation and then click the Create Operation button. Select the owner and click OK. In the Operation Specification window, define the Operation and click Close.
- Type an Operation name right on a Message on the diagram.