Add a New Mapping to the Integration

This example shows how to add a new TQL query and push-mapping to the integration for a CIT called Example. It consists of the following steps:

Step 1: Create a TQL Query

  1. Go to Modeling > Modeling Studio > New > Query.

  2. From the CI Types tab, add Example CIT to the query.

  3. Right-click the Example Query Node and select Query Node Properties.

  4. Go to the Element Layout tab.

  5. Select Select attributes for layout.

  6. In the Attributes condition drop down, select Specific Attributes, and add the new attributes that you want to map and push to Service Anywhere.

  7. Click OK.

  8. Save the query to Modeling > Modeling Studio > Resources > Queries > Root > Integration > Service Anywhere Push.

Step 2: Create a Push-Mapping

  1. Go to Data Flow Management > Adapter Management > SAWPushAdapter.

  2. Click Create new resource and select New Configuration File.

  3. Type the a name for the file.

  4. Select the SAWPushAdapter package.

  5. Click OK.

  6. Copy the following into the newly created XML file, replacing ExampleCI with the name of the relevant CI:

    <integration 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="../generic-push-adapter.xsd">
     <info>
      <source name="UCMDB" versions="10.0" vendor="HP"/>
      <target name="ServiceAnywhere" versions="1.0" vendor="HP"/>
     </info>
     <import>
      <scriptFile path="mappings.scripts.SAWPushFunctions"/>
     </import>
     <targetcis>
      <source_ci_type query-element-name="ExampleCI*">
       <target_ci_type name="ExampleCI">
         <variable name="externalId" datatype="STRING" 
          value="ExampleCI['external_id_obj']"/>
         <variable name="serviceName" datatype="STRING" 
          value="'CMDB_UDM_1_6'"/>
         <variable name="attributesHierarchy" datatype="STRING" 
          value="'model.instance'"/>
         <variable name="keysHierarchy" datatype="STRING" 
          value="'model'"/>
         <variable name="keyTag" datatype="STRING" value="'ID'"/>
         <variable name="keyVal" datatype="STRING" 
          value="ExampleCI['cmdb_id']"/>
         <variable name="retrieveRequestName" datatype="STRING" 
          value="'RetrieveExampleCI'"/>
         <variable name="createRequestName" datatype="STRING" 
          value="'CreateExampleCI'"/>
         <variable name="deleteRequestName" datatype="STRING" 
          value="'DeleteExampleCI'"/>
         <variable name="updateRequestName" datatype="STRING" 
          value="'UpdateExampleCI'"/>
         <target_mapping name="Name" datatype="STRING" 
          value="ExampleCI.attributeExists('name') ? 
          ((ExampleCI['name']==null)
          ?ExampleCI['display_label']:ExampleCI['name']) : 
          'MISSING'"/>
         <target_mapping name="Description" datatype="STRING" 
          value="ExampleCI.attributeExists('description') 
          ? ExampleCI['description'] : 'MISSING'"/>
         <target_mapping name="DisplayLabel"  datatype="STRING" 
          value="ExampleCI.attributeExists('display_label') 
          ? ExampleCI['display_label'] : 'MISSING'"/>
         <target_mapping name="GlobalId"  datatype="STRING" 
          value="ExampleCI.attributeExists('global_id') 
          ? ExampleCI['global_id'] : 'MISSING'"/>
        </target_ci_type>
      </source_ci_type>
     </targetcis>
    </integration>
  7. Click OK.

Step 3: Create a Job with the New TQL Query

  1. Go to Data Flow Management > Integration Studio.

  2. Create an Integration Point with Service Anywhere.

  3. In the Integration Jobs tab, click New Integration Job .

  4. Insert a job name in the Name field.

  5. Click Add Query , and choose the newly created query.

  6. Click OK.

Step 4: Run the Job

  1. Click on the job created in Step 3: Create a Job with the New TQL Query.

  2. Click Full Synchronization .

  3. Wait for the job to complete; click Refresh multiple times as needed until the job is completed.

  4. Make sure that the status is Succeeded.

Step 5: View the Results

  1. Go to Service Anywhere.

  2. Validate that the new attribute, pushed in the previous steps, is displayed.