This documentation supports the 20.08 version of BMC CMDB, which is available only to BMC Helix subscribers (SaaS).

To view an earlier version, select the version from the Product version menu.

Mapping complex queries to a class

BMC CMDB has predefined complex queries that you can map to a class and also assign a priority.  Some of the predefined complex queries for incidents created by monitoring tools are mapped by default to some classes in BMC CMDB. You can use the Class Query Mappings page in CMDB to modify these mappings or map additional complex queries to a class.

The use case for complex queries

When an event is created by an event monitoring system, BMC Helix Integration Service creates an incident and passes various event attributes to ITSM to find the CI. ITSM passes these queries as a REST API to CMDB. If the query is complex, the CMDB REST API uses the predefined complex queries mapped by default to classes to perform the search. The search runs at the time of incident creation, and the CI information is automatically added to the incident. For more information on the use case, see Associating a CI to an incident.

Before you begin

You must configure a monitoring tool to create an event that is passed on to BMC Helix Integration Service and ITSM to be able to associate the CI to the incident.

You must have Administrator or Reconciliation Engine Definition Author (RE Definition Author) permissions to be able to access the Class Query Mappings page in BMC CMDB.

For integration with Proactive Service Resolution (PSR), you must also make the settings required for ITSM to run REST APIs in CMDB as described in Providing ITSM with access to CMDB.

To map complex queries to a class

Apart from the complex queries mapped by default, you can map additional predefined complex queries to a class, or remove existing mappings.

  1. Log in to BMC CMDB.
  2. Open the CMDB Class Query Mappings page.
    CIs > Class Query Mapping
  3. In the pane on the left, select a class or enter any keyword to search for a class.
    For example, to search for the class BMC_ComputerSystem, enter computer in the search field.


    To view the existing mappings of classes to complex queries, select the View Classes with Query Mappings check box.

  4. Select the class to view the complex queries mapped to that class.
  5. On the right-hand pane, you can click the  button to create a mapping.
    The query mapping options appear.

    1. From the Category list, select the monitoring application which creates the event. 
      TSOM is the default category. You can create new categories. The category helps you differentiate queries from different sources. For example, a category called Manual can be defined for manually created incidents.
    2. In the Priority field, add an integer value that must be assigned to the query.
      When you map multiple queries to a class, this value specifies the priority of execution for that query.
    3. From the Query Name list, select all the required predefined complex queries.
      You can choose from a list of predefined complex queries. 
  6. Click Save to map the query to the selected class.


    You can repeat the procedure to map multiple queries of different priorities to the selected class. The CI that is found from the search is automatically associated with the incident.

Example of a complex query in CMDB REST API 

ITSM passes the complex query as a CMDB REST API to find the CI associated with an incident. An example of a complex query is to look for a server with the Model attribute value IBM DB2 Database Server and InstanceName attribute value db2inst1 inside a BMC_SoftwareServer class running on a computer with IP address 7x.3x.4x.2xx. The CMDB REST API refers the queries mapped to BMC_SoftwareServer class in CMDB and runs the queries mapped to the class based on the priority. The example query in CMDB REST API format has the following syntax:

"BMC.CORE:BMC_SoftwareServer:Model":"IBM DB2 Database Server",

For more details, see Endpoints in the REST API.

Troubleshooting issues with queries

If more than one CI matches the complex query critiera, BMC CMDB returns the first CI that matches the criteria. To find other CIs that might be causing the issue, you may have to run a manual search with the search criteria. For more information on running a search, see Qualification Builder overview.

If the search does not find any CI, you can map additional predefined complex queries to the class.

Related topics

Use case: Automatically associating CIs related to an incident

Was this page helpful? Yes No Submitting... Thank you