Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Content layer
id1361646817
Content column
id1361646828
Content block
id1361646818

To create the First End Of Association operation for coloring Associations between a Block and a Use Case


  1. Create an Opaque Behavior named 'First End Of Association'.
  2. Right-click the Opaque Behavior element and open its Specification window. Do one of the following:
    1. Click the plus sign next to the Owned Parameter property to edit it.

      Note

      If you cannot see the Owned Parameter property, make sure the Expert mode is enabled.


    2. On the left side menu, select Parameters > Create.
  3. In the Specification of Parameter window, set Name to AssociationType to Association, and Direction to in. Click Back.
  4. In the Opaque Behavior Specification window, click three dots Image Modified next to the Body and Language property to edit it.
  5. In the Body and Language dialog, select Language > StructuredExpression.
  6. Click Create operation > Script.

    Note

    If you cannot see the Script operation, make sure the Expert mode is enabled.

    Image Modified

  7. Set the Operation Name to ‘First End’.
  8. From the Language drop-down list, select Javascript Rhino.
  9. Insert the following script as the Body:

    Code Block
    languagejs
    titleJavascript Rhino
    arg1.size() > 0 ? arg1.iterator().next() : null

    Image Modified

  10. Select First End > arg1 > Reset.
    Image Modified
  11. Select First End > arg1 > Metachain Navigation.
    Image Modified
  12. Click Insert.
  13. Under Metaclass or Stereotype, select Association, and under Property, select End Type.
    Image Modified
  14. Click OK.