Overview
Talend MDM (Master Data Management) provides a beforeSaving_xxx process to validate the data when you update a Talend MDM record. Furthermore, it is possible to change the XML record in beforeSaving_xxx by providing one special output variable, output_item. This article explains how to do it.
Environment
This procedure applies to Talend MDM v5.1.x or higher.
Resolution
In a beforeSaving_xxx process, there is a special output variable, output_report, used to show the update report message as in the formatted string below:
<report> <message type="info|error"> xxx report message xxx </message> </report>
- info: validation OK.
- error: validation failed.
There is another output variable, output_item, used to change the XML record as in the formatted string below:
<exchange> <item> xxx the updated xml record string xxx </item> </exchange>
Here is an example of how to change the XML record in a beforeSaving_xxx process:
The beforeSaving_Entity_3 process contains 2 steps: Change and Check.
-
Change the step as below:
-
Check the step as below:
Steps to reproduce the issue
- Import mdmitems.zip (attached) to the Studio, then deploy all items to MDM server.
- Import jobs.zip (attached) to the Studio, then deploy the 2 Jobs to the MDM server.
- Log in to the Web User Interface, create one Entity_3 record, and save it.
- Update Field_2 and Field_3, then Save. The Date will be updated with the value of the current time.
The files jobs.zip and mdmitems.zip are exported from Talend 5.3.1.
Related Jira Issues
TMDM-1816 - Let a before saving process alter the item before it is committed to the db - Closed