How to Define a Query Mapping for Each Relationship Type

For each relationship type of the new CI type, you need to define a query mapping in the smPopConfFile.xml file.

  1. Log in to UCMDB as an administrator.
  2. Navigate to Data Flow Management > Adapter Management > ServiceManagerAdapter9.41 > Configuration Files > smPopConfFile.xml.
  3. In the smPopConfFile.xml file, add a query mapping for the relationship type, by copying an existing query mapping element.

    Note In the next step, you will update the highlighted values with values of the new relationship type.

    <tql name="SM Biz To Biz With Usage" 
    xslFile="businessservice_to_businessservice_usage_population.xslt">
       <request type="Retrieve" dataType="relationship" 
           retrieveKeysQueryName="Retrievecirelationship1to1KeysListRequest"
           retrieveListQueryName="Retrievecirelationship1to1ListRequest"
           basicQueryCondition="upstreamci.type=&quot;bizservice&quot; and 
    downstreamci.type=&quot;bizservice&quot; and relationship.subtype=&quot;Usage&quot;"
           fullQueryCondition="status~=&quot;Removed&quot;"
           changedCreationQueryCondition="create.datetime&gt;'{fromDate}' and 
    status~=&quot;Removed&quot;"
            changedUpdateQueryCondition="created.datetime&lt;='{fromDate}' and 
    update.datetime&gt;'{fromDate}' and status~=&quot;Removed&quot;"
            changedDeletionQueryCondition="update.datetime&gt;'{fromDate}' and 
    status=&quot;Removed&quot;"/>
    </tql>
  4. Update the TQP mapping element with the values of the new relationship type.

    Note For the query name, you can enter any descriptive name as you like (for example, SM Cost to CostCategory with Ownership). This query does not really exist, since population does not require it.

    The upstreamci.type, downstreamci.type, and relationship.subtype values are defined in the cirelationship1to1 table in Service Manager.

    <tql name="SM Cost to CostCategory with Ownership" 
    xslFile="cost_to_costcategory_population.xslt">
       <request type="Retrieve" dataType="relationship" 
           retrieveKeysQueryName="Retrievecirelationship1to1KeysListRequest"
           retrieveListQueryName="Retrievecirelationship1to1ListRequest"
           basicQueryCondition="upstreamci.type=&quot;cost&quot; and 
    downstreamci.type=&quot;costcategory&quot; and 
    relationship.subtype=&quot;Ownership&quot;"
           fullQueryCondition="status~=&quot;Removed&quot;"
           changedCreationQueryCondition="create.datetime&gt;'{fromDate}' and 
    status~=&quot;Removed&quot;"
            changedUpdateQueryCondition="created.datetime&lt;='{fromDate}' and 
    update.datetime&gt;'{fromDate}' and status~=&quot;Removed&quot;"
            changedDeletionQueryCondition="update.datetime&gt;'{fromDate}' and 
    status=&quot;Removed&quot;"/>
    </tql>
  5. Save the population configuration file.
  6. Note When you create/edit and then save a configuration file in Adapter Management, UCMDB automatically restarts the adapter with the new configuration file.

Now the relationship type is added to the integration for population. Next, you need to add the relationship query name you specified in the population configuration file (in this example, SM Cost to CostCategory with Ownership) to a relationship population job, so that the integration can populate this type of relationships to UCMDB. See the following figure and also How to Add Custom queries to Integration Population Jobs.

Refer to the following screenshot to add a new relationship query name to a relationship population job: