To create the First End Of Association operation for coloring Associations between a Block and a Use Case
- Create an Opaque Behavior named 'First End Of Association'.
- Right-click the Opaque Behavior element and open its Specification window. Do one of the following:
Click the plus sign next to the Owned Parameter property to edit it.
If you cannot see the Owned Parameter property, make sure the Expert mode is enabled.
- On the left side menu, select Parameters > Create.
- In the Specification of Parameter window, set Name to Association, Type to Association, and Direction to in. Click Back.
- In the Opaque Behavior Specification window, click three dots next to the Body and Language property to edit it.
- In the Body and Language dialog, select Language > StructuredExpression.
Click Create operation > Script.
- Set the Operation Name to ‘First End’.
arg1.size() > 0 ? arg1.iterator().next() : null
- Select First End > arg1 > Reset.
- Select First End > arg1 > Metachain Navigation.
- Click Insert.
- Under Metaclass or Stereotype, select Association, and under Property, select End Type.
- Click OK.
The model used in these examples is the Case Studies for Querying the Model sample model. To open this model, you need to download case studies for querying the model.mdzip.