To color ports by their type
- Create a Legend and a legend item.
- Open the Specification window of a legend Item.
- Click the specification cell of the Adornment property, and then click .
- In the Adornment Properties dialog, specify the desired adornment properties.
- Select the specification cell of the Elements by Condition property, and click .
Click Expert at the bottom of the dialog. The dialog is switched to the Expert mode.
- In the Structured Expression dialog on the left, click Create operation.
- Select the Metachain Navigation operation type.
Click the Insert button to create the first step of the Metachain.
- Select Port under Metaclass or Stereotype and under Property, select Type.
- In the Structured Expression dialog on the left, click Create operation.
- Select the Operation from Model operation type.
Select the Contains opaque behavior from the model.
- On the left side of the dialog, expand the Contains operation and drag-and-drop the previously created Metachain Navigation on the Input parameter.
- On the left side of the dialog, click the Obj parameter of the Contains operation.
- Select Element from the Values category.
- Click and specify the port type to verify.
Sample model
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.