Foreign Keys and cross referencing - Cloud - 8.0

Talend Studio User Guide

Version
Cloud
8.0
Language
English
Product
Talend Big Data
Talend Big Data Platform
Talend Cloud
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Design and Development
Last publication date
2024-02-29
Available in...

Data Fabric

MDM Platform

Talend MDM sends the XML record, without resolving the FKs. It is up to the Smart View to lookup/resolve them.

As the Process is a multi-step pipeline, you can have one or several steps before the final XSLT step. So you will need to insert a step to resolve your FKs and/or cross referencing. You can use a Talend Job deployed as a ZIP or you can use a <parameters>

<CrossRef>

<xrefName>Country</xrefName>

<xrefCluster>crossreferencing</xrefCluster>

<xrefRootElement>/Product</xrefRootElement>

<xrefIn>

<mapping>

<xrefElement>CountryCode</xrefElement>

<xrefPath>Countries/ISO2</xrefPath>

</mapping>

</xrefIn>

<xrefOut>

<mapping>

<xrefElement>CountryName</xrefElement>

<xrefPath>Countries/Name</xrefPath>

</mapping>

</xrefOut>

</CrossRef>

</parameters> step.

First example: if the data model is Product with a FK to ProductFamily, use the following parameters to resolve the product family, which is the raw family code (e.g. "[1234]"), to the actual family name:

<parameters> 
   <CrossRef> 
       <xrefName>FamilyFK</xrefName>  
       <xrefCluster>Product</xrefCluster>  
       <xrefRootElement>/Product</xrefRootElement>  
       <xrefIn> 
            <mapping> 
                <xrefElement>Family</xrefElement>  
                <xrefPath>ProductFamily/Id</xrefPath> 
            </mapping> 
       </xrefIn>  
       <xrefOut> 
            <mapping> 
                <xrefElement>Family</xrefElement>
             <xrefPath>ProductFamily/Name</xrefPath> 
        </mapping> 
      </xrefOut> 
   </CrossRef> 
</parameters>

Second example: if there is a Countries cross reference table with key = ISO2 and value = Name and you want to resolve Product/CountryCode into Product/CountryName, use the following parameters:

<parameters> 
   <CrossRef> 
       <xrefName>Country</xrefName>  
       <xrefCluster>crossreferencing</xrefCluster>  
       <xrefRootElement>/Product</xrefRootElement>  
       <xrefIn> 
          <mapping> 
              <xrefElement>CountryCode</xrefElement>  
              <xrefPath>Countries/ISO2</xrefPath> 
          </mapping> 
       </xrefIn>  
       <xrefOut> 
          <mapping> 
              <xrefElement>CountryName</xrefElement>  
              <xrefPath>Countries/Name</xrefPath> 
          </mapping> 
       </xrefOut> 
    </CrossRef> 
</parameters>