Population Flow

Looking from the adapter perspective, the population flow consists of the following steps:

  1. The adapter receives the information about the CI and relation data that needs to be obtained from ServiceNow.
  2. Then it connects to ServiceNow and transfers the required data using ServiceNow REST API. The CIs and relations are fetched directly from target tables (no staging tables here) and handed over to the next stage in the pipeline.
  3. After the CIs and relations are transformed and inserted into UCMDB then the UCMDB sends the information about the assigned global_id values for each CI to the adapter
  4. The adapter updates the correlation_id (or custom) fields of the populated records with the assigned global_id values. This step is optional and can be disabled in the adapter configuration file.

The information about the ServiceNow tables to populate the data from is specified in mapping files.

Consider the following example from the mapping file:

<target_entities>
    <source_instance query-name="TEST UNIX Population 1.0" root-element-name="cmdb_ci_unix_server">
<target_entity name="Root">
<target_mapping datatype="STRING" name="name" value="cmdb_ci_unix_server['name']"/>
<target_mapping datatype="STRING" name="sys_id" value="cmdb_ci_unix_server['sys_id']"/>
<target_mapping datatype="STRING" name="global_id" value="cmdb_ci_unix_server['correlation_id']"/>
...
</source_instance>
</target_entities>

In this example the adapter will query the table cmdb_ci_unix_server for target entity named Root.

Additionally, there are some fields that deserve special attention in the mapping XML. This can be seen in the above example:

  1. correlation_id (or a custom ServiceNow field) needs to be mapped to UCMDB global_id property. This greatly helps in UCMDB reconciliation process. Please note that if this mapping is not specified UCMDB will still do the reconciliation on the CI properties themselves but this is not recommended. Using correlation_id-global_id mapping exactly correlates the CIs from the two servers. For more details, see CI Reconciliation.
  2. ServiceNow sys_id field must be mapped to UCMDB CI sys_id property. (This is a virtual UCMDB property). This mechanism is essential for adapter in order to update the ServiceNow correlation_id (or a custom ServiceNow field) with the assigned global_id value. If this mapping is not specified, then the adapter can’t deduce the source CI sys_id value and cannot perform the update.