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.
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.
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.
Drop a tJava component onto the design workspace.
Double-click the component to display its Basic settings.
In the Code field, enter
System.out.println("------- A Product is Updated.--" + new java.util.Date());.
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.
In this scenario, once the Job message is created, a trigger calling this Job can be generated.
In the MDM Repository tree view, under the Job Designs node, right click the message Job.
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.
In the Trigger xPath Expressions area, customize the conditions of the trigger according to your needs.
In this example, add the following conditions:
XPath Operator Value Condition Update/DataCluster Matches Product C1 Update/DataModel Matches Product C2 Update/OperationType Matches UPDATE C3
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.
Deploy the customized Trigger to the MDM server.
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.
In the upper right corner of the web page, make sure the Actions panel is displayed.
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.
Click Save to save your changes.
Go to the Master Data Browser page, and select the Product entity from the list.
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.
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.
Click Save to validate this update.
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.
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.
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.
In the Integration perspective, right-click Job Designs in the Repository tree view and select Create Standard Job in the contextual menu.
Enter RouteRecord in the Name field in the wizard that opens, and then click Finish.
Drop the tMDMRouteRecord component from the Palette onto the design workspace.
Double click this component to open its Component view.
In the URL field, enter the URL for accessing your MDM server.
In this example, enter
In the Username and the Password fields, enter the credentials for accessing the MDM server.
In the Data Container field, enter the data container name that stores the record you want to route.
It is UpdateReport in this example.
In the Entity Name field, enter the entity name that the record you want to route belongs to.
It is Update in this example.
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.
Press Ctrl+S to save the Job.
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.
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.