Searching for elements in a project
Overview of the search function
Objecteering provides a powerful integrated search function, which can be used to search for elements in:
· models
· metamodels
· textual elements, such as notes and constraints
· diagrams
Note: A fast search service is also available. For more information, see "Using the fast search service".
Launching the search function
To open the "Search" window and launch a search, you have three possibilities:
· running the "Search" command in the "Edit" menu
·
clicking on the
"Search" icon in the
Objecteering toolbar
· pressing CTRL F, either from a specific element or from anywhere within Objecteering (for more information on keyboard shortcuts, please see "Using shortcuts").
Simple search mode
The Objecteering search function operates in two different modes, simple and advanced.
The simple search mode searches for expressions, with or without uppercase and lowercase characters being taken into account. You can specify whether you want to search for elements which begin or end with the expression, which contain the expression or which exactly match the expression.
The simple search mode uses the "Search" window shown in the screenshot below.

The "Search" window in simple mode
Key:
1. The "Find" field: This is where you enter the expression you wish to search for.
2. The "Search options" field: Here, you select a search option, from "Contains", "Begins with...", "Ends with..." and "Matches exactly".
3. The "Search from" field: This indicates where you wish to search from (either the current element or the project). If you want to search from a particular element, you can drag it directly from the explorer into the "Search from" zone.
4. The "Search in" field: This indicates where you wish to search. In simple mode, this field is not accessible and is automatically set to "Model".
5. The "Case sensitive" tickbox: This defines whether or not your search should distinguish between uppercase and lowercase characters.
6. The "Step by step search" tickbox: When checked, this lets you jump from the first instance of the element searched for to the second to the third, and so on.
7. The "Advanced>>" button: This switches to the advanced search mode, thereby extending the "Search box" and making additional fields available.
The "Search from" field
The "Search from" field in the "Search" window is used to indicate where you wish to run your search from (the current element or the project).
To run your search from a particular element, you have two options:
· If the "Search" window is not open, select the element and press CTRL F. The "Search" window then appears, with the selected element appearing automatically in the "Search from" field.
· If the "Search" window is already open, select an element, drag it to the "Search" window and drop it in the "Search from" field.
Example of a simple search
The screenshot below shows an example of a simple search for the expression "Training" in the model.

Carrying out a simple search
Steps:
1.
Click on the
"Search" icon to open the
"Search" box.
2. Enter the expression you want to search for, in our example "Training".
3. Choose your search option mode ("Contains", "Begins with...", "Ends with..." or "Matches exactly"), in our example "Contains".
4. Choose where you want your search to be carried out.
5. Click on "Search" to launch the search operation.
For our model, the following results are obtained.

Search results
Each element found is shown with its associated icon, indicating the type of element concerned (package, class, operation, and so on).
Note: If we had checked the "Case sensitive" tickbox when searching for "Training", the "trainingEvaluation" operation and the "trainingCalendar" class would not have figured in the "Search results" window.
If you double-click on a search result, you automatically jump to the element concerned in the explorer.
Advanced search mode
The advanced search mode uses the same "Search" window as the simple mode, but with a certain number of additional fields (as shown below). To pass to advanced mode from simple mode, you should simply click on the "Advanced>>" button.
In the advanced mode, you have access to the same fields as with the simple mode, and you can also specify whether you want to run your search in the model, in notes and constraints, in diagrams or in all of the above. It is also possible to indicate the type of element you want to search for and define a filter condition using the J language.

The "Search" window in advanced mode
Key:
1. The "Search in" field (which is visible but not accessible in simple mode) is used to indicate whether you wish to search in the model, in notes and constraints, in diagrams or all of the above. If you select a search in diagrams or in notes and constraints, certain additional fields appear (please see below for more details).
2. The "Element type" field is used to indicate the type of element you wish to search for. The available types depend on the type of search to be carried out.
3. The "J filter condition" field is used to enter a J expression (which will return a boolean) which will be used to filter all those elements found. If this expression returns true, the element is retained. Otherwise, it is deleted from the results list.
Different types of search in advanced mode
In advanced mode, the following types of search are available with the Objecteering search facility:
· search in the model (select "Model" in the "Search in" field of the "Search" window)
· search in notes and constraints (select "Notes and constraints" in the "Search in" field of the "Search" window)
· search in diagrams (select "Diagrams" in the "Search in" field of the "Search" window)
· search in all of the above (select "All" in the "Search in" field of the "Search" window)
Searching in the model
Running a search in the model allows you to browse the elements which figure in the model, in view of selecting them in an explorer. The elements found correspond to model or metamodel elements.
To run a search for an expression in the model, you should simply carry out the steps shown in the following screenshot.

Searching in the model
Steps:
1. After defining the expression you wish to find, as well as your search option and where you wish to search from, select "Model" in the "Search in" field.
2. In the "Element type" field, select the element type you want to search for (in our example, we have indicated that we want to search for classes only).
3. Click on "Search" to run the search.
Searching in notes and constraints
Running a search in notes and constraints allows you to browse textual elements and search inside notes and constraints.
To run a search for an expression in notes and constraints, you should simply carry out the steps shown below.

Searching in notes and constraints
Steps:
1. After defining the expression you wish to find, as well as your search option and where you wish to search from, select "Notes and constraints" in the "Search in" field. This action opens the "Parent type" and "Type" fields (see step 3).
2. In the "Parent type" field, select the type of the parent element inside which you want to search notes and constraints (in our example, we have indicated that we want to search notes and constraints belonging to packages).
3.
Click on the
"Browse" icon to the right of
the "Type" field. This
opens the "Available types" window.
4. In the "Available types" window, select the types of note or constraint you wish to search. The two icons on the right of this window are used to select or unselect all the proposed types.
5. Click on "OK" to confirm (the selected note and constraint types then appear in the "Type" field) and then click on "Search" to run your search.
Searching in diagrams
Running a search in diagrams allows you to only search for the required expression within the diagrams which exist within your project.
To run a search for an expression in diagrams, you should simply carry out the steps shown in the following screenshot.

Searching in diagrams
Steps:
1. After defining the expression you wish to find, as well as your search option and where you wish to search from, select "Diagrams" in the "Search in" field. This action opens the "Diagram type" field (see step 3).
2. In the "Element type" field, select the element type you want to search for (in our example, we have indicated that we want to search for classes only).
3.
Click on the
"Browse" icon to the right of
the "Diagram type" field.
This opens the "Available types" window.
4. In the "Available types" window, select the types of diagram inside which you want to search for your expression. The two icons on the right of this window are used to select or unselect all the proposed diagram types.
5. Click on "OK" to confirm (the selected diagram types then appear in the "Diagram type" field) and then click on "Search" to run your search.
Searching in the model, notes, constraints and diagrams
To run a search in the model, notes, constraints and diagrams, simply carry out the steps shown below.

The "All" option in the "Search in" field
Steps:
1. After defining the expression you wish to find, as well as your search option and where you wish to search from, select "All" in the "Search in" field.
2. Click on "Search" to run the search.
Note: This type of search can be time-consuming, as it combines the three
previously discussed types of search.
Example of an advanced search
The following screenshot shows an example of an advanced search for representations of the "ResponsibleForTraining" class in diagrams.

Carrying out a search in advanced mode
Steps:
1. Enter the name of the element you wish to search for, in this case, the "ResponsibleForTraining" class.
2. Click on the "Advanced>>" button to access the advanced search mode.
3. Select "Diagrams" in the "Search in" field.
4. Choose the type of element you wish to search for in the "Element type" field. In this case, we have specified that we are searching for a class.
5. If necessary, define the different types of diagram you wish to search. In our example, we have chosen to search all types of diagram.
6. Click on the "Search" button to run the search.
The result of this search is shown below.

The results of the search