August 17, 2023

tMDMSP – Docs for ESB 5.x

tMDMSP

tMDMSP_icon32_white.png

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
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
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.

 

Version
(deprecated)

Type in the name of the master data
management Version you want to connect to, for
which you have the user rights required.

Leave this field empty if you want to
display the default perspective.

 

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.

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.

Use_Case_tMDMSP1.png

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.

Use_Case_tMDMSP2.png

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:

Use_Case_tMDMSP6.png

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.

    Use_Case_tMDMSP3.png
  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.

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

    Use_Case_tMDMSP5.png
  9. In the URL field of the
    Component view,
    type in the MDM server address, in this example,
    http://localhost:8080/talend/TalendPort.

  10. In Username and Password, enter the
    authentication information, in this example,
    admin and
    talend.

  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 (in
    order)
    table, click the plus button two
    times to add two rows in this table.

  13. 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.

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

    Use_Case_tMDMSP7.png
  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.

    Use_Case_tMDMSP8.png
  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.

    Use_Case_tMDMSP9.png
  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.

    Use_Case_tMDMSP10.png

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


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x