Scenario: Routing a record to Event Manager - 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

In this scenario, the tMDMRouteRecord component is used to submit the primary key of an update report record to Event Manager so that a trigger is launched to call a Job which will print out the notification that a data record had been updated.

Prerequisites

  • The MDM server is up and running.

  • The MDM demo project has already been imported.

  • The data container Product has already been populated with some data records.

For further information about how to create a data container and a data model, see your Talend Studio User Guide.

For further information about how to create a record and access its viewable attributes, see the Talend MDM Web User Interface User Guide.

Creating a Job to notify that a data record has been updated

In this scenario, a Job called message is created with only one tJava component to inform the users of the update of an existing data record.

  1. Drop a tJava component onto the design workspace.

  2. Double-click the component to display its Basic settings.

  3. In the Code field, enter System.out.println("------- A Product is Updated.--" + new java.util.Date());.

  4. Save your Job and deploy it to the MDM Server.

For further information about the tJava component, see tJava.

For further information about how to deploy a Job onto the MDM Server, see the Talend Studio User Guide.

Generating a Job Caller Trigger and deploying it to the MDM server

In this scenario, once the Job message is created, a trigger calling this Job can be generated.

  1. In the MDM Repository tree view, under the Job Designs node, right click the message Job.

  2. In the contextual menu, select Generate Talend Job Caller Trigger, accept the default options and click Generate.

    A trigger used to call the message Job is generated and stored under Event Management > Trigger. Its name is CallJob_Message, and its Service JNDI Name is callJob.

  3. In the Trigger xPath Expressions area, customize the conditions of the trigger according to your needs.

    In this example, add the following conditions:

    XPathOperatorValueCondition
    Update/DataClusterMatchesProductC1
    Update/DataModelMatchesProductC2
    Update/OperationTypeMatchesUPDATEC3
  4. In the Conditions area, combine the conditions using the predicates.

    In this example, enter the following: C1 AND C2 AND C3.

    In this way, this Trigger will be executed on a record in the Update entity only when a Product data record has been updated.

  5. Deploy the customized Trigger to the MDM server.

Updating a data record in a specific data container

  1. Log onto your Talend MDM Web User Interface.

    For further details about how to log onto the Talend MDM Web User Interface, see Talend MDM Web User Interface User Guide.

  2. In the upper right corner of the web page, make sure the Actions panel is displayed.

  3. In the Domain Configuration area, select the required data container and data model.

    In this example, select Product for both the data container and the data model.

  4. Click Save to save your changes.

  5. Go to the Master Data Browser page, and select the Product entity from the list.

  6. Double-click one of the product records to display its viewable attributes in a new view dedicated to this product.

    In this example, open the product record Talend Mug with the Unique Id of 231035938.

  7. Update one of the attribute values in the product record.

    In this example, update the record by selecting the Availability check box to make it available.

  8. Click Save to validate this update.

Accessing the Update Reports

  1. In the MDM Repository tree view, double click Data Container > System > UpdateReport to open the UpdateReport view.

    An Update Report is a complete track of all create, update or delete actions on any master data.

    If the UpdateReport data container is not available, you may first have to import it from your MDM Server. For details of how to import system objects from the MDM Server to your local repository, see the Talend Studio User Guide.

  2. Next to the Entity field of this view, click the search button to search all the action records in the UpdateReport.

    Note that the Update entity does not necessarily mean that the corresponding action recorded is update, since it is just the entity name defined by the data model of UpdateReport and may record different actions including create, delete, and update.

  3. Locate the record that corresponds to your action of updating the data record as described in Updating a data record in a specific data container.

    The update report record will be routed to Event Manager, whose primary key is genericUI.1499236505686.

Setting up the Job to route the update report record to Event Manager

  1. In the Integration perspective, right-click Job Designs in the Repository tree view and select Create Standard Job in the contextual menu.

  2. Enter RouteRecord in the Name field in the wizard that opens, and then click Finish.

  3. Drop the tMDMRouteRecord component from the Palette onto the design workspace.

  4. Double click this component to open its Component view.

  5. In the URL field, enter the URL for accessing your MDM server.

    In this example, enter http://localhost:8180/talendmdm/services/soap.

  6. In the Username and the Password fields, enter the credentials for accessing the MDM server.

  7. In the Data Container field, enter the data container name that stores the record you want to route.

    It is UpdateReport in this example.

  8. In the Entity Name field, enter the entity name that the record you want to route belongs to.

    It is Update in this example.

  9. In the IDS area, click the plus button under the table to add a new line.

    In the newly added line, fill in the primary key of the update report record to be routed to Event Manager, which was read earlier from the UpdateReport data container.

    In this example, the primary key is genericUI.1499236505686.

Saving and executing the Job

  1. Press Ctrl+S to save the Job.

  2. Press F6 to run this Job.

    In this example, since the Product data record with the Unique Id of 231035938 is updated, the component tMDMRouteRecord submits the primary key of the corresponding update report record to the Event Manager.

    When the Event Manager checks this record and confirms that this record meets the conditions in the trigger CallJob_Message's configuration view, the Event Manager calls the trigger to invoke the message Job.

  3. Verify the execution results of this Job by consulting the MDM server log to see that the notification ------- A Product is Updated.-- is printed out.

    You can check the server log in one of the following ways:

    • In the Server Explorer panel, right-click the connection to the server where MDM server is installed, and then click View Server Log. A Console opens displaying the most recent contents of the mdm.log file.

    • You can also view the contents of the mdm.log file in a browser. For more information, see the Talend Studio User Guide.

    • If you have direct access to the MDM server, you can also consult the file directly in the <$INSTALLDIR>/log directory, with INSTALLDIR indicating where the MDM server is installed.