Integrate > Micro Focus UCMDB > Using the ServiceManagerAdapter9.41 Adapter > Tailoring the Integration > Integration Tailoring Options > How to Map Each Relationship Type's Attributes to Web Service Objects

How to Map Each Relationship Type's Attributes to Web Service Objects

This example illustrates how to create an XSL transformation file to map the attributes of the Ownership relationship type to web service objects.

  1. Log in to UCMDB as an administrator.
  2. Navigate to Data Flow Management > Adapter Management.
  3. Click the Create new resource button .
  4. Select New Configuration File.
  5. Select the ServiceManagerAdapter9.41 package.
  6. Enter the full file name using this format: <AdapterID>/<filename>. For example, ServiceManagerAdapter9.41/cost_to_costcategory_population.xslt.
  7. Click Yes to ignore the file extension warning. The file is added to the Configuration Files folder.
  8. Copy the content of an existing relationship population XSLT file (for example, computer_to_computer_connects_population.xslt) to the new XSLT file.

    Note In the next step, you will update the <ci class> names and linkType value.

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:template match="/Retrievecirelationship1to1ListResponse">
            <topology>  
                <xsl:for-each select="instance">
                    <ci class="node">
                        <attribute name="name" type="String"><xsl:value-of select=
    "upstreamci.logical.name"/></attribute>
                        <attribute name="sm_id" type="String"><xsl:value-of select=
    "upstreamci.id"/></attribute>
                        <link direction="outgoing" linkType="tcp">
                            <ci class="node">
                                <attribute name="name" type="String"><xsl:value-of select=
    "downstreamci.logical.name"/></attribute>
                                <attribute name="sm_id" type="String"><xsl:value-of select=
    "downstreamci.id"/></attribute>
                            </ci>
                        </link>
                   </ci>
                </xsl:for-each>
            </topology>
        </xsl:template>
    </xsl:stylesheet>
  9. Change the <ci class> names to cost and cost_category, and linkType to ownership.
    ...
    <ci class="cost">
                        <attribute name="name" type="String"><xsl:value-of select=
    "upstreamci.logical.name"/></attribute>
                        <attribute name="sm_id" type="String"><xsl:value-of select=
    "upstreamci.id"/></attribute>
                        <link direction="outgoing" linkType="ownership">
                            <ci class="cost_category">
    ...

    ci class: the name (not display name) of the each CI type involved in the relationship. It should be the Name field value on the General Details tab of the CI type definition.

    linkType: the name of the relationship type. It should be the Name field value on the General Details tab of the relationship type definition.

    Note In this example, you do not need to change the link direction (outgoing). This is because the relationship (Ownership) direction is from cost to cost_category, that is, from a <ci class> outside of the <link> element to a <ci class> inside it).

  10. Save the XSL transformation file.