August 17, 2023

tMDMTriggerInput – Docs for ESB 5.x

tMDMTriggerInput

tMDMTriggerInput_icon32_white.png

tMDMTriggerInput properties

Component family

Talend
MDM

 

Function

Once executed, tMDMTriggerInput
reads the XML message (Document
type) sent by MDM and passes them to the component that
follows.

Note

This component works alongside the new trigger service and
process plug-in in MDM version 5.0 and higher. The MDM Jobs,
triggers and processes developed in previous MDM versions remain
supported. However, we recommend using this component when
designing new MDM Jobs.

Purpose

Every time when you save a change in your MDM, the corresponding
change record is generated in XML format. At runtime, this component
reads this record and sends the relative information to the
following component.

With this component, you do not need to configure your Job any
more in order to communicate the data changes from MDM to your
Job.

Basic settings

Property Type

Either Built-in or Repository.

Since version 5.6, both the Built-In mode and the Repository mode are
available in any of the Talend solutions.

 

 

Built-in: No property data stored
centrally.

tMDMTriggerInput is expected to
use this option in order to apply the default read-only schema.
MDM_message is the only column
of this schema.

 

 

Repository: Select the repository
file where properties are stored. The fields that follow are
completed automatically using the fetched data.

As tMDMTriggerInput provides a
fixed read-only schema, you are expected to use the Built-in option.

 

Schema and Edit
Schema

A schema is a row description, it defines the number of fields that will be processed
and passed on to the next component. The schema is either built-in
or remote in the Repository.

Since version 5.6, both the Built-In mode and the Repository mode are
available in any of the Talend solutions.

Click Edit schema to make changes to the schema. If the
current schema is of the Repository type, three options are
available:

  • View schema: choose this option to view the
    schema only.

  • Change to built-in property: choose this option
    to change the schema to Built-in for local
    changes.

  • Update repository connection: choose this option to change
    the schema stored in the repository and decide whether to propagate the changes to
    all the Jobs upon completion. If you just want to propagate the changes to the
    current Job, you can select No upon completion and
    choose this schema metadata again in the [Repository
    Content]
    window.

 

 

Built-in: The schema will be
created and stored for this component only. Related Topic: see
Talend Studio User
Guide
.

This is the default option for tMDMTriggerInput. With this option, the read-only
schema is used to deal with the XML-format MDM message.

 

 

Repository: The schema already
exists and is stored in the repository. You can reuse it in various
projects and jobs. Related Topic: see Talend Studio User Guide.

As tMDMTriggerInput provides a
fixed read-only schema, you are expected to use the Built-in option.

 Advanced settings

tStatCatcher Statistics

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

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

Use this component as a start component. It needs an output
flow.

To receive the message from MDM, you need to deploy the Job using
this component on your MDM server and generate the corresponding
trigger and process in MDM to invoke this Job.

For further information about how to deploy a Job onto MDM server
and how to generate a trigger or a process, see
Talend Studio User Guide.

For further information about how to change a record in MDM, see
Talend MDM Web User Interface User Guide.

Limitation During the deployment of this
component on the MDM server, you need to select the Hosted (Zip) type as the format of the
deployed Job. If you deploy it in the Distributed
(War)
type, the relative Job cannot be invoked. For
further information about the available types, see
Talend Studio User Guide.

Scenario: Exchanging the event information about an MDM record

In this scenario, a four-component Job is used to exchange the event information about
a product record. Using an established MDM connection from the Repository, this Job is triggered by Talend Studio once you have
updated a product record.

To replicate this scenario, accomplish the following tasks sequentially:

  1. Create an MDM connection of the Receive type
    in the Repository of the Studio. This
    connection is to the MDM hub holding the record you want to update.

  2. Create the Job receiving and sending the MDM update message.

  3. Generate the process invoking this Job created.

  4. Update a specific MDM record.

To create the MDM records, model and container used in this scenario, you can execute
the Jobs in the MDM demo project in Talend Studio and then update
the MDM server to deploy the objects thus created for them to be taken into account at
runtime. You will use this server all through this scenario.

For further information about how to import a demo project, see Talend Studio User Guide.

For further information about how to update the server for deploying objects, see
Talend Studio User Guide.

For further information about an MDM event and the event management, see
Talend Studio User Guide.

Creating an MDM connection

Establishing the connection

  1. Launch the MDM server with which you need to communicate the update
    message.

  2. In the Integration perspective
    of Talend Studio,
    expand the Metadata node in the Repository.

  3. Right-click the Talend MDM item and
    select Create MDM connection.

    use_case-tmdmtriggerinput2.png
  4. Enter the Name you want to use for this
    connection and if required, added the Purpose and the Description
    in the corresponding fields. For example, we name this connection as
    receive_update.

  5. In the Next step, enter the
    authentication information used to connect to the MDM web service through
    which you manage the record to be updated.

    Once you click the Check button and the
    connection is shown successful, the Next
    button becomes clickable.

    use_case-tmdmtriggerinput3.png
  6. In the Next step, select the Version (deprecated), the Data
    model
    and the Data Container
    used by the record to be updated. In this scenario, the model and the
    container are both Product.

  7. Click Finish to validate the creation.
    The connection created appears under the Metadata node in the Repository.

Retrieving entities

  1. Right-click the connection created and from the contextual menu, select
    Retrieve entities. Then the wizard
    appears.

  2. Select Receive MDM and click Next to continue.

    use_case-tmdmtriggerinput5.png
  3. Select the entity to be retrieved. In this scenario, it is Product. Then the name field is entered
    automatically.

    use_case-tmdmtriggerinput6.png
  4. In the Next step, drop the elements you
    need to retrieve from the Source Schema
    area to the Target Schema area. In this
    scenario, the Features element is the
    loop and the Id, the Name and the Description elements are the fields to extract.

    use_case-tmdmtriggerinput7.png
  5. In the Next step, if required, change the
    description of the schema retrieved; otherwise, click Finish to finalize retrieving this entity. In this scenario,
    we keep the default schema description and click Finish.

    The schema of the product entity is retrieved. For further information
    about the container and the data model used by , see Talend Studio User Guide.

Creating the Job communicating the MDM message

Linking the components

  1. In the Integration perspective
    of Talend Studio,
    select Create Job from the Job Design node in the Repository tree view. Then the [New
    Job]
    wizard appears.

    use_case-tmdmtriggerinput8.png
  2. Name this new Job and click Finish to
    close the wizard and validate the creation. An empty Job is opened on the
    workspace of the Studio.

  3. Drop tMDMTriggerInput, tXMLMap, tMDMTriggerOutput and tLogRow from Palette onto
    the workspace.

  4. Right-click tMDMTriggerInput and from the
    contextual menu, select the Row > Main link to connect it to tXMLMap.

  5. Do the same to connect tXMLMap to
    tMDMTriggerOutput. When doing so, a
    dialog box appears to prompt you to name this link created.

    use_case-tmdmtriggerinput9.png
  6. Double-click tMDMTriggerOutput to open
    its Component view.

  7. Click Edit schema to open the
    editor.

  8. Select the single pre-defined column of tMDMTriggerOutput, then, click schema_icon-left_arrow.png to reproduce this column on the input side (left).

Configuring the transformation of the MDM message

  1. Double-click tXMLMap to open its
    editor.

  2. In the table representing the input flow (up-left of the editor),
    right-click the column name MDM_Message on
    the top of the XML tree and select Import from
    repository
    . The [Metadata]
    wizard appears.

  3. Select the entity schema retrieved earlier using the Receive MDM model, then click OK. In this scenario, the
    entity schema is ProductReceive.

  4. A dialog box appears prompting you to add the schema of the Update Report
    to the input XML tree. Click OK to accept
    it. This builds a complete input document for an MDM event. In the input XML
    tree, the Features element is set as loop
    element automatically.

    use_case-tmdmtriggerinput11.png
  5. In the table representing the output flow (up-right of the editor),
    develop the output XML tree as presented in the figure below. This tree is
    constructed depending on the required static model of the MDM output
    report.

    use_case-tmdmtriggerinput10.png

    Note

    The XML construct required to return the validation-success message is

    The XML construct required to return the validation-failure message is

  6. Map the OperationType element on the
    input side with the message element on
    the output side. This will output the information about the type of the
    event occurring on the MDM record.

    To get more information, you can build the concatenation of the input
    elements you need to extract in the Expression column of this message element. Both tMap and tXMLMap
    allow you to edit expressions using the expression editor. For further
    information about how to edit an expression, see Talend Studio User Guide.

  7. In the Expression column, enter
    "info" in the row corresponding to @type.

  8. Click the pincer icon to display the output settings panel, then set the
    All in one option as true.

  9. Click OK to close the editor and validate
    these changes.

  10. Double click tLogRow to open its
    Component view, then, click Sync columns.

This Job is finalized. For further information about the input document and the
output report of an MDM event, see Talend Studio User
Guide
.

Generating the process invoking the Job created

Deploying the Job to be called onto the MDM server

  1. Switch to the MDM perspective by
    clicking the corresponding button in the up-right corner of the
    Studio.

  2. In MDM Repository, click the refresh
    button so that the Job created appears under the Job
    Designs
    node of this Repository’s tree view.

  3. Right-click this Job created, update_product in this scenario, and from the contextual
    menu, select Deploy to in order to deploy
    it to the MDM server.

    use_case-tmdmtriggerinput12.png
  4. The deployment wizard appears. From the server list, select the MDM server
    you are using, then click OK.

  5. In the [Deploy to Talend MDM] window that
    pops up, select the Export type and the
    Context scripts for the Job to be
    deployed. In this scenario, keep the default settings: Export type is Hosted (zip)
    and Context scripts is Default.

    For further information about these settings, see
    Talend Studio
    User Guide
    .

  6. Click Finish to validate these settings
    and start the deployment. When the deployment is done, a message box pops up
    to indicate that the deployment is successful.

    use_case-tmdmtriggerinput13.png
  7. Click OK to close this message box, then
    a window pops up to list the objects deployed. In this scenario, it is the
    Job, update_product.

    use_case-tmdmtriggerinput14.png
  8. Click OK to terminate the deployment
    procedure.

Generating the process used to call the Job

  1. Right-click the Job update_product
    again and select Generate Talend Job Caller
    Process
    from the contextual menu.

  2. In the pop-up window, keep the default settings for this scenario:
    Integrated and Embedded. For further information about the available
    options in this window, see Talend Studio
    User Guide
    .

    use_case-tmdmtriggerinput15.png
  3. Click Generate to start the generation.
    Once done, a process named CallJob_update_product appears under the Process node in MDM
    Repository
    .

  4. Right-click this process, then select Deploy
    to
    from the contextual menu to deploy it onto the MDM
    server.

  5. In the pop-up wizard, select the server you are using, then , click
    OK to open the window listing the
    objects deployed.

    use_case-tmdmtriggerinput16.png
  6. Click OK to close this window and
    finalize the deployment. The question mark disappears from the icon of this
    process.

  7. In MDM Repository, right-click the
    CallJob_update_prodcut process, then
    select Rename from the contextual
    menu.

  8. In the pop-up window, rename this process as beforeSaving_update_product depending on the required
    process naming pattern. Then click OK to
    validate it.

  9. Deploy this process again as described earlier.

Updating a product record

  1. Log in the web service of the MDM hub you are using.

  2. In the Actions panel on the right side,
    verify the Data Container and the Data Model you are using are both Product.

  3. In the Data Browser page, launch the
    search in the product entities so as to list all the available product
    records

    use_case-tmdmtriggerinput17.png
  4. Select the product record you need to update from the list, for example,
    Talend Trucker Hat. The details of
    this record appears in the Product tab
    view.

  5. Update one of its attributes. For example, update the price to 11.00, then click Save.

    The message about the operation type of this event has been sent to the
    MDM server and thanks to tLogRow, this
    message is displayed on the window of this MDM server.

    use_case-tmdmtriggerinput18.png

For further information about how to use the MDM web service, see Talend MDM Web User Interface User Guide


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