Create Search Definitions

Search definitions are created using the search manager panel. To display this panel:

  1. On the Model Search tab, click on the arrow button to the right of the Options button. The search manager panel displays underneath the Search Term and Search fields.

To create a new search definition, follow the steps below:

  1. Click on the New Search icon in the toolbar. The Create New Search Query dialog displays.
  2. In the Search Name field, type a name for your new search.
  3. Select the radio button for the type of search you require:
  • The Query Builder option provides an interface that enables you to design your own search.
  • The SQL Editor option enables advanced users to directly write SQL Select statements.
  • The Add-In Search option enables you to supply the name of your Add-In and a method (for example MyAddin.RunThisMethod). This method is called whenever the search is run. This search can be exported and distributed as a part of your Add-In. For more information, see Enterprise Architect Add-In Model.
  1. Click on the OK button.


User-defined searches are stored in the Program Files directory, and not in the project repository.

Query Builder

Your search definition now appears as being selected in the Search drop-down field. You can now click on the Add Filter toolbar icon to Add Filters.

searchproject-create definitions

SQL Editor

The Custom SQL dialog displays, enabling you to input your SELECT statement. The SQL editor is based on the common Code Editor, and provides an intellisense autocompletion list populated with Enterprise Architect's repository structure. You can display the autocompletion list by pressing [Ctrl]+[Spacebar].

For more details on intellisense and the common Code Editor, see the Code Editors topic.

Custom SQL Search Dialog

Enterprise Architect also enables you to use #xxx# macros as string replacers in WHERE statements, so that the same search can be used by different people in different environments. These macros include:

  • #WC# - Gets the appropriate wild card for the current database, and so enables the search to be performed on models on different databases; for example, t_object.Name LIKE '#WC#Test#WC#'
  • #Author# - Takes the value of the Author field in the Options dialog General page, and enables the defined search to be performed on objects created by that user (this value can be manually re-set in the Options dialog)
  • #DB=<DBNAME># where <DBNAME> can be one of the following:
  • JET
  • ASA

       For example, #DB=ORACLE# t_object.ModifiedDate >= (SYSDATE - INTERVAL '<Search Term>' DAY)

  • #UserName# - Gets the name of the person logged into version control; for example, t_package.PackageFlags LIKE '#WC#VCCFG=#WC#CheckedOutTo=#UserName##WC#' (this is from Enterprise Architect's built in search My Checked Out Packages).



For all Enterprise Architect functions in which you use a custom SQL statement (such as RTF reporting or Model Views) the statement must return the guid and type of the object found so that Enterprise Architect can search for the selected item in the Project Browser. For example:

SELECT ea_guid AS CLASSGUID, Object_Type AS CLASSTYPE, Name FROM t_object

You can extend the usability of your SQL searches using the aliases CLASSGUID and CLASSTYPE. These enable Enterprise Architect to display the Properties dialog and icon for elements, connectors, attributes or operations, as well as selecting them in the Project Browser. Some simple examples for using these aliased fields are provided below:

SELECT ea_guid AS CLASSGUID, Object_Type AS CLASSTYPE, Name FROM t_object

SELECT ea_guid AS CLASSGUID, Connector_Type AS CLASSTYPE, Name FROM t_connector

SELECT ea_guid AS CLASSGUID, 'Operation' AS CLASSTYPE, Name FROM t_operation

SELECT ea_guid AS CLASSGUID, 'Attribute' AS CLASSTYPE, Name FROM t_attribute.

When you have defined the SELECT statement, click on the Save button to save this search. The search is then available from the Search drop-down list.

Add-In Search

Type in the field the name of your Add-In, a period (full stop) and then the name of the method to be called (for example, MyAddin.RunThisMethod). Your search is automatically saved and available from the Search drop-down list.