tMDMSP - 6.1

Talend Components Reference Guide

EnrichVersion
6.1
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

tMDMSP Properties

Component family

Talend MDM

 

Function

tMDMSP calls the MDM Hub stored procedure.

Purpose

tMDMSP offers a convenient way to centralize multiple or complex queries in a MDM Hub and call them easily.

Basic settings

Schema and Edit Schema

In SP principle, the schema is an input parameter.

A schema is a row description, it defines the number of fields to be processed and passed on to the next component.

The schema of this component is read-only.

 Use an existing connectionSelect this check box if you want to use a configured tMDMConnection component.
 

MDM version

By default, Server 6.0 is selected. You need to select 5.6 URL compliance if you are migrating Jobs created with version 5.6.x of Talend Studio.

 

URL

Type in the URL of the MDM server.

 

Username and Password

Type in the user authentication data for the MDM server.

To enter the password, click the [...] button next to the password field, and then in the pop-up dialog box enter the password between double quotes and click OK to save the settings.

 

Data Container

Type in the name of the data container that stores the procedure you want to call.

Type

Select Master or Staging to specify the database on which the action should be performed.

 

Procedure Name

Type in the exact name of the Stored Procedure

 

Parameters (in order)

Click the Plus button and select the various Input Columns that will be required by the procedures.

Note

The SP schema can hold more columns than there are parameters used in the procedure.

Advanced settings

tStatCatcher Statistics

Select this check box to gather the processing metadata at the Job level as well as at each component level.

Connections

Outgoing links (from this component to another):

Row: Main

Trigger: Run if; On Component Ok; On Component Error, On Subjob Ok, On Subjob Error.

Incoming links (from one component to this one):

Row: Main, Iterate;

Trigger: Run if, On Component Ok, On Component Error, On Subjob Ok, On Subjob Error

For further information regarding connections, see Talend Studio User Guide.

Global Variables

ERROR_MESSAGE: the error message generated by the component when an error occurs. This is an After variable and it returns a string. This variable functions only if the Die on error check box is cleared, if the component has this check box.

A Flow variable functions during the execution of a component while an After variable functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl + Space to access the variable list and choose the variable to use from it.

For further information about variables, see Talend Studio User Guide.

Usage

This component is used as intermediary component. It can be used as start component but only no input parameters are thus needed for the procedure to be called. An output link is required.

Log4j

If you are using a subscription-based version of the Studio, the activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User Guide.

For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html.

Limitation

N/A

Scenario: Executing a stored procedure in the MDM Hub

The following job is intended for calculating the total price of each kind of products recorded on your MDM Web UI.

This Job will generate parameters used to execute a stored procedure in the MDM Hub, then extract the desired data from the returned XML-format result and present the extracted data in the studio.

The products of which the prices are to be treated are listed on your MDM Web UI.

This Job requires you to have previously created a stored procedure called PriceAddition in the MDM Repository tree view and deployed this stored procedure to the server. The procedure uses the following steps:

for $d in distinct-values(//Product/Name)
let $product := //Product[Name= $d and Price >= %0 and Price <=%1]
order by $d
return <result><Name>{$d}</Name><Sum>{sum($product/Price)}</Sum></result>

For more information on working with stored procedures, see Talend Studio User Guide.

To create this Job, proceed as follows:

  1. Drag and drop the following components used in this example: tFixedFlowInput, tMDMSP, tExtractXMLField, tLogRow.

  2. Connect the components using the Row Main link.

  3. The tFixedFlowInput is used to generate the price range of your interest for this calculation. In this example, define 10 as the minimum and 17 as the maximum in order to cover all of the products. To begin, double-click on tFixedFlowInput to open its Component view.

  4. On the Component view, click the [...] button next to Edit schema to open the schema editor of this component.

  5. In the schema editor, add the two parameters min and max that are used to define the price range.

  6. Click OK.

    In the Values table, in the Mode area of the Component view, the two parameters min and max that you have defined in the schema editor of this component display.

  7. In the Value column of the Values table, enter 10 for the min parameter and 17 for the max parameter.

  8. Double-click on tMDMSP to open its Component view.

  9. In the URL field of the Component view, type in the MDM server address, in this example, http://localhost:8180/talendmdm/services/soap.

  10. In the Password field, enter the authentication information.

  11. In Data Container and Procedure Name, enter the exact names of the data container Product and of the stored procedure PriceAddition.

  12. Under the Parameters table, click the plus button two times to add two rows in this table.

  13. In the Parameters table, click each of both rows you have added and from the drop-down list, select the min parameter for one and the max parameter for the other.

  14. Double-click on tExtractXMLField to open its Component view.

  15. On the Component view, click the [...] button next to Edit schema to open the schema editor of this component.

  16. In the schema editor, add two columns to define the structure of the outcoming data. These two columns are name and sum. They represent respectively the name and the total price of each kind of product recorded in the MDM Web UI.

  17. Click OK to validate the configuration and the two columns display in the Mapping table of the Component view.

  18. In the Loop XPath query field, type in the node of the XML tree, which the loop is based on. In this example, the node is /result as you can read in the procedure code: return <result><Name>{$d}</Name><Sum>{sum($product/Price)}</Sum></result>.

  19. In XPath query of the Mapping table, enter the exact node name on which the loop is applied. They are /result/Name used to extract the product names and /result/Sum used to extract the total prices.

  20. Eventually, double-click tLogRow to open its Component view.

  21. Synchronize the schema with the preceding component.

  22. And select the Print values in cells of a table check box for reading convenience.

  23. Then press F6 to execute the Job.

  24. See the outcoming data in the console of the Run view.

The output lists the four kinds of products recorded in the MDM Web UI and the total price for each of them.