MagicDraw utilizes a Find operation that allows you to automatically search for model elements, represent relations between these elements, or gather their derived property values each time you update your model. The Find operation is customizable, so you can change the default values of all the properties for the selected operation at any any time. These properties need to be customized in the Expert mode. The Find operation can be accessed and used:

  • In a Relation Map to represent relations between elements.
  • In a Dependency Matrix to associate elements in rows and columns of a matrix.
  • From the Specification window of a Smart Package to query a model and gather specific elements.
  • From the Specification window of the selected element to calculate/gather the values of derived properties.
  • In a Generic Table to calculate/gather the values of derived properties.
  • From the Specification window of an opaque behavior to specify the body of a StructuredExpression.
     

Tip

If you would like to simply find the desired model element, and don't need to automatically query your model every time you update it, use the Find dialog instead.

To use a Find operation, you need to specify it as criteria. The next section describes how to complete this task.
 

Specifying a Find operation as criteria

Specifying a Find operation as criteria allows you to automatically query your model in order to find and render specific model elements, relations between these elements, or gather their derived properties depending on where the operation is used (as mentioned above).


To specify a Find operation as criteria


  1. Open the dialog for specifying criteria.
  2. Select Find on the left side of the open dialog.



  3. Change the Operation Name, if needed.

  4. Select the Style to represent the specified Find criteria. Note that the style selection is available only in the Relation Criteria and Dependency Criteria dialogs.

  5. Specify the Find operation properties, and click OK.
     

Useful information

Selecting the Search in all texts check box allows you to search for text in Documentation and TODO properties.


Completing the steps described above specifies a Find operation as criteria. If specifying the Find operation properties available in the Standard mode is not sufficient, and you want to customize the advanced properties and/or options of the selected operation, you can do this in the Expert mode.

 

Manipulations in the Expert mode

The Expert mode allows you to search for model elements by the property or tag value and the applied stereotype name. This mode gives you the option to change the contextual element of a Find operation or create a new operation, and use the selected Find operation as its argument.


To specify the Find operation properties available in the Expert mode


  1. Open the dialog for specifying criteria.
  2. On the lower left corner of the open dialog, click  to enable the Expert mode.
  3. On the left side of the dialog, expand the Find operation.
  4. Select the property you want to specify, and, in the property specification panel on the right side of the dialog, specify the value of the selected property.



  5. Click OK.

The selected Find operation is now customized to query a model according to your specified properties. As mentioned before, the Expert mode also gives you the option to use a specific Find operation as an argument of another operation. In other words, you can create a new Find, Filter, Implied Relation, Exclude, Script, Union or Collection operation, and use the results of a specific Find operation as its property. 


To use the expression of a Find operation as a property of another operation


  1. Open the dialog for specifying criteria.
  2. On the lower left corner of the open dialog, click  to enable the Expert mode.
  3. Select Find on the left side of the dialog.
  4. In the criteria specification panel on the right side of the dialog, click the Use as button, and select the desired command that corresponds to the operation you want to create as shown below. A new operation is created.


  5. Specify other parameters of the created operation, and click OK.

You now have a new operation that has been created with the selected Find operation as one of its properties.