
Component |
Talend MDM |
|
Function |
tMDMSP |
|
Purpose |
tMDMSP |
|
Basic |
Schema and |
In SP principle, the schema is an input A schema is a row description, it defines The schema of this component is |
Use an existing connection |
Select this check box if you want to use a configured tMDMConnection component. |
|
|
URL |
Type in the URL of the MDM server. |
|
Username and |
Type in the user authentication data for the To enter the password, click the […] button next to the |
|
Version |
Type in the name of the master data Leave this field empty if you want to |
|
Data Container |
Type in the name of the data container that |
Type |
Select Master or Staging to specify the database on |
|
|
Procedure Name |
Type in the exact name of the Stored |
|
Parameters (in |
Click the Plus button and select the various NoteThe SP schema can hold more columns than |
Advanced |
tStatCatcher |
Select this check box to gather the |
Connections |
Outgoing links (from this component to Row: Main
Trigger: Run if; Incoming links (from one component to this
Row: Main,
Trigger: Run if, For further information regarding |
|
Global |
ERROR_MESSAGE: the error message generated by the A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see Talend Studio |
|
Usage |
This component is used as intermediary |
|
Limitation |
N/A |
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:
1 2 3 4 |
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:
-
Drag and drop the following components used in this example:
tFixedFlowInput,
tMDMSP, tExtractXMLField, tLogRow. -
Connect the components using the Row
Main link. -
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. -
On the Component view, click
the […] button next to
Edit schema to open
the schema editor of this component. -
In the schema editor, add the two parameters
min and
max that are used to define the
price range. -
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. -
In the Value column of the
Values table, enter
10 for the min parameter and 17 for the
max parameter. -
Double-click on tMDMSP to
open its Component
view. -
In the URL field of the
Component view,
type in the MDM server address, in this example,
http://localhost:8080/talend/TalendPort. -
In Username and Password, enter the
authentication information, in this example,
admin and
talend. -
In Data Container and
Procedure Name,
enter the exact names of the data container
Product and of the stored
procedure PriceAddition. -
Under the Parameters (in
order) table, click the plus button two
times to add two rows in this table. -
In the Parameters (in order)
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. -
Double-click on tExtractXMLField to open its Component view.
-
On the Component view, click
the […] button next to
Edit schema to open
the schema editor of this component. -
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. -
Click OK to validate the
configuration and the two columns display in the Mapping table of the
Component
view. -
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> -
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. -
Eventually, double-click tLogRow to open its Component view.
-
Synchronize the schema with the preceding component.
-
And select the Print values in cells of
a table check box for reading
convenience. -
Then press F6 to execute the
Job. -
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.