Reading master data from an MDM hub - 6.3

Talend Open Studio for Big Data Components Reference Guide

EnrichVersion
6.3
EnrichProdName
Talend Open Studio for Big Data
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

This scenario describes a two-component Job that fetches master data from an MDM server, and displays the data in the log console.

Prerequisites:

  • Make sure the MDM server is up and running.

  • You have imported the MDM demo project and loaded the sample data into the data container Product by running the Job MDM_LoadAll.

Creating a Job to read master data from MDM

  1. From the Palette, drop tMDMInput and tLogRow onto the design workspace.

  2. Link the two components together using a Row > Main connection.

Configuring basic settings of tMDMInput to read master data from MDM

  1. Double-click tMDMInput to open the Basic settings view.

  2. In the Property Type list, select Built-In.

  3. In the Schema list, select Built-In and click the [...] button next to Edit schema to open a dialog box and define the structure of the master data you want to read from the MDM server.

    In this example, three columns are defined to fetch three elements from the Product entity: Name, Price, and Colors.

  4. After you have defined the schema, click OK to close this dialog box, and then click Yes in the [Propagate] dialog box to propagate the schema changes to tLogRow.

  5. Enter the user name and password for accessing the MDM server.

  6. In the Entity field, enter Product between quotes.

  7. In the Data Container field, enter Product between quotes.

  8. Select Master from the Type list.

  9. Define the query conditions in the Operations area.

    In this example, we want to query the product data records whose names include Shirt.

    1. Click the [+] button to add a row.

    2. Enter Product/Name between quotes in the Xpath field.

      Note

      Apart from elements defined in entities, you can query metadata elements which are also known as built-in elements. To query metadata elements from records in master database, you need to follow the format of metadata:<timestamp|task_id> when defining the path expression to select the XML node to run the query on.

    3. Select Contains from the Function list.

    4. Enter Shirt between quotes in the Value field.

Configuring advanced settings of tMDMInput to read master data from MDM

  1. In the Component view, click the Advanced settings tab.

  2. In the Loop XPath query field, enter /Product between quotes on which the loop is based.

  3. In the XPath query column of the Mapping table, enter the name of the XML node from which you want to collect the master data, next to the corresponding output column name.

  4. Select the Get Nodes check box for the Colors row to retrieve the XML node together with its data.

Configuring the data display mode and executing the Job

  1. Double-click the tLogRow component to display its Basic settings view.

  2. In the Mode area, select Table (print values in cells of a table) for better readability of the result.

  3. Save the Job and press F6 to run it.

    The Product data records whose names include "Shirt" are displayed on the console with the values of three specified columns.