Multi-Representation Examples - 6.3

Talend Data Mapper User Guide

EnrichVersion
6.3
EnrichProdName
Talend Big Data Platform
Talend Data Fabric
Talend Data Management Platform
Talend Data Services Platform
Talend MDM Platform
Talend Real-Time Big Data Platform
task
Design and Development
EnrichPlatform
Talend Studio

To access the examples, go to Other Projects>Examples>Maps>MultiInputOutput.

  • The PurchaseOrdersToMandP map shows use of multiple representations within a single map.

    A common use case is processing multiple unrelated XML documents in a single input. In some cases you want to concatenate the documents, in others you might select a document based on what content is actually provided in the input.

    This example shows processing of two existing structures representing different XML documents and automatically choosing between them. This is accomplished by having creating an enclosing structure (the map's input structure) which has an element that inherits from each of the desired XML structures. The enclosing structure uses the Flat representation and has a choice (note the group type of the Root element). Each of the members of a choice specifies an initiator string that is the initial part of the element of the member's XML document. A ReadNested function signals that the representation is to change to that of the enclosing structure (by default the representation does not need to be specified on the properties of the ReadNested).

    This example also shows the use of Map Inheritance where the from the AcmePOToMaAndPa map is used between the POFile structure and the MandPPOFile structure. This allows you to build and test a map between the two XML documents and then completely reuse the map in other cases (like this one).

  • Another example shows embedding flat content inside of XML. The /Examples/Maps/Simple/POMap example illustrates this. If you look at the POs/PO/Vendor element, you can see that it has a ReadNested function as its I/O expression.

    To view POMap, go to Other Projects>Maps>Simple.