Binding operations and parameters to variables in sequence diagrams

You can bind operations and parameters to variables to reuse an operation or parameter or to change operation and parameter names withoutchanging each instance of the parameter or operation.

Before you begin

You must have the following preferences set:
  • You must select the sequence diagram preference to always show signatures.
  • You must clear the preference to show operation signatures instead of message signatures.
  • You must have a sequence diagram open with at least two lifelines.

Procedure

  1. In the Palette, click a type of message.
  2. In the interaction frame, click a source lifeline and drag the cursor to a target lifeline.
  3. Type a name for the message operation.
  4. In the Project Explorer view, right-click the newly created message; then click Add UML > Parameter.
  5. Type a name for the parameter.
  6. In the Project Explorer view, right-click the newly created message; then click Add UML > Return Parameter.
  7. Type a name for the return parameter.
  8. Complete the following steps for both the message and its return message:
    1. In the interaction frame, right-click the message that you created in step 2; then click UML Properties.
    2. On the Argument page, select Opaque Expression as the argument type.
  9. For each opaque expression, complete the following steps:
    1. On the Argument page, in the body field, type a name for the value.

What to do next

In the message signature, the synchronous message parameter is assigned the variable argument that you created. In the return message, the second variable argument that you created is assigned to the operation.


Feedback