Changes in ServiceNowConfig.xml

In this version, the configuration for populating relationship topologies and referencing topologies is specified in the ServiceNowConfig.xml configuration file. The parameters are described as follows and are used to build UCMDB relationships. The different parameters are described based on the different scenarios that they are used for.

  1. Referencing topology example:

    SNOW Business Service Referencing Topology Population 1.0

    Example

    <!--  REFERENCING topology example -->
      <!--  REFERENCING topology example -->
        <!--  <ci ciType="business_service" targetTable="cmdb_ci_service">
          <relations>
    	<relation childCiType="person" type="ownership" populationType="referencing" childCiTargetTableField="owned_by"/>
          </relations>
        </ci>               -->
        <ci parentRef="owned_by" ciType="person" targetTable="sys_user">
        </ci>

    TQL query

    Mapping file

    <target_entities>
      <source_instance query-name="SNOW Business Service Referencing Topology Population 1.0" root-element-name="cmdb_ci_service">
        <target_entity name="Root">
          <target_mapping datatype="STRING" name="name" value="cmdb_ci_service['name']"/>
          <target_mapping datatype="STRING" name="global_id" value="cmdb_ci_service['correlation_id']"/>
          <target_mapping datatype="STRING" name="owned_by" value="cmdb_ci_service['owned_by']"/>
          <target_mapping datatype="STRING" name="sys_id" value="cmdb_ci_service['sys_id']"/>
        </target_entity>
        <for-each-source-entity count-index="i" source-entities="cmdb_ci_service.sys_user">
          <target_entity name="Person">
            <target_mapping datatype="STRING" name="name" value="cmdb_ci_service.sys_user[i]['name']"/>
            <target_mapping datatype="STRING" name="global_id" value="cmdb_ci_service.sys_user[i]['correlation_id']"/>
            <target_mapping datatype="STRING" name="sys_id" value="cmdb_ci_service.sys_user[i]['sys_id']"/>
          </target_entity>
        </for-each-source-entity>
      </source_instance>
    </target_entities>

    Note The mapping for this job SNOW Business Service Referencing Topology Population 1.0 does not cover the OOTB identification criteria. If you want to make them work in OOTB perspective, you need to change the identification for the corresponding CIT by the key attribute name.

  2. Relationship topology example:

    • SNOW Business Application Relationship Topology Population 1.0

      Example

      <!-- RELATIONSHIP topology example -->
      <ci ciType="business_application" targetTable="cmdb_ci_appl">
        <relations>
          <relation childCiType="node" type="containment" populationType="relationship" reverseParenthood="false" targetRelType="Runs on::Runs"/>
          <relation childCiType="nt" type="containment" populationType="relationship" reverseParenthood="false" targetRelType="Runs on::Runs"/>
          <relation childCiType="unix" type="containment" populationType="relationship" reverseParenthood="false" targetRelType="Runs on::Runs"/>
        </relations>
      </ci>

      TQL query

      Maping file

      <target_entities>
        <source_instance query-name="SNOW Business Application Relationship Topology Population 1.0" root-element-name="cmdb_ci_appl">
          <target_entity name="Root">
            <target_mapping datatype="STRING" name="name" value="cmdb_ci_appl['name']"/>
            <target_mapping datatype="STRING" name="global_id" value="cmdb_ci_appl['correlation_id']"/>
          </target_entity>
          <for-each-source-entity count-index="i" source-entities="cmdb_ci_appl.cmdb_ci_win_server">
            <target_entity name="Windows">
              <target_mapping datatype="STRING" name="name" value="cmdb_ci_appl.cmdb_ci_win_server[i]['name']"/>
              <target_mapping datatype="STRING" name="global_id" value="cmdb_ci_appl.cmdb_ci_win_server[i]['correlation_id']"/>
            </target_entity>
          </for-each-source-entity>
        </source_instance>
      </target_entities>

      Note The reverseParenthood parameter by default is false, which means that the Root item in UCMDB TQL is the Parent in the ServiceNow relationship pair. If the value is set to true, the Parent in the ServiceNow is the Root item in UCMDB TQL.

    • SNOW BA and BS to Linux Relationship Topology Population 1.0

      Example

      <ci ciType="unix" targetTable="cmdb_ci_linux_server">
        <relations>
          <relation childCiType="business_application" type="containment" populationType="relationship" reverseParenthood="true" targetRelType="Runs on::Runs"/>
          <relation childCiType="business_service" type="containment" populationType="relationship" reverseParenthood="true" targetRelType="Runs on::Runs"/>
        </relations>
      </ci>

      TQL query

      Mapping file

      <target_entities>
        <source_instance query-name="SNOW BA and BS to Linux Relationship Topology Population 1.0" root-element-name="cmdb_ci_linux_server">
          <target_entity name="Root">
            <target_mapping datatype="STRING" name="name" value="cmdb_ci_linux_server['name']"/>
            <target_mapping datatype="STRING" name="global_id" value="cmdb_ci_linux_server['correlation_id']"/>
          </target_entity>
          <for-each-source-entity count-index="i" source-entities="cmdb_ci_linux_server.cmdb_ci_appl">
            <target_entity name="BusinessApplication">
              <target_mapping datatype="STRING" name="name" value="cmdb_ci_linux_server.cmdb_ci_appl[i]['name']"/>
              <target_mapping datatype="STRING" name="global_id" value="cmdb_ci_linux_server.cmdb_ci_appl[i]['correlation_id']"/>
            </target_entity>
          </for-each-source-entity>
          <for-each-source-entity count-index="i" source-entities="cmdb_ci_linux_server.cmdb_ci_service">
            <target_entity name="BusinessService">
              <target_mapping datatype="STRING" name="name" value="cmdb_ci_linux_server.cmdb_ci_service[i]['name']"/>
              <target_mapping datatype="STRING" name="global_id" value="cmdb_ci_linux_server.cmdb_ci_service[i]['correlation_id']"/>
            </target_entity>
          </for-each-source-entity>
        </source_instance>
      </target_entities>

      Note It is very important to note that configurations inside the ServiceNowConf file are dependable to each other. So, for example, if you are populating referencing and relationship topologies, and the CITs that you are fetching overlap, the best approach is to combine the configurations in one configuration. For example:

      <ci ciType="business_service" targetTable="cmdb_ci_service">
        <relations>
          <relation childCiType="node" type="containment" populationType="relationship" targetRelType="Runs on::Runs"/>
          <relation childCiType="nt" type="containment" populationType="relationship" targetRelType="Runs on::Runs"/>
          <relation childCiType="unix" type="containment" populationType="relationship" targetRelType="Runs on::Runs"/>
          <relation childCiType="person" type="ownership" populationType="referencing" childCiTargetTableField="owned_by"/>
        </relations>
      </ci>
      <ci parentRef="owned_by" ciType="person" targetTable="sys_user">
      </ci>