Sample domain object transforms
The IBM® Master Data Connect assets include a JAR file that contains sample domain object transforms, including the source code.
The sample transforms are located in the following file: /usr/ibmpacks/current/operational-cache/etc/transform-sample/analytics-graph-extension-transform-custom-<version>.jar.
- CustomJSONPropertyKeyTransformer.java
-
This example custom transformer transforms custom search property keys into InfoSphere® MDM model property keys when running a search. The custom properties are mapped to the following respective InfoSphere MDM model properties:
customAddress1maps toPrimaryResidence.Address.AddressLine1customAddress2maps toPrimaryResidence.Address.AddressLine2customAddress3maps toPrimaryResidence.Address.AddressLine3customAddressCitymaps toPrimaryResidence.Address.CitycustomAddressStatemaps toPrimaryResidence.Address.ProvinceStateValuecustomAddressZipmaps toPrimaryResidence.Address.ZipPostalCodecustomAddressCountrymaps toPrimaryResidence.Address.CountryValuecustomFirstNamemaps toLegalName.GivenNamecustomMiddleNamemaps toLegalName.MiddleNamecustomLastNamemaps toLegalName.LastName
This transformer also transforms the results of a search so that the model property keys are transformed back into the custom property keys.
- CustomXMLTransformer.java
-
This example custom transformer transforms a custom XML search request into a Criteria object that is accepted by the InfoSphere MDM application. The result of a search is also transformed from a SearchResult object back into the custom XML format.
Note: Because CustomXMLTransformer is annotated with the@alternativeannotation, the CustomJSONPropertyKeyTransformer will be used by default. To use the CustomXMLTransformer instead, you must modify theWEB-INF/beans.xmlfile in the analytics-graph-api-rest.war file by adding the following lines:<beans> <alternatives> <class>com.ibm.entity.analytics.graph.extension.transform.CustomXMLTransformer</class> </alternatives> </beans>After modifying the
WEB-INF/beans.xmlfile, restart all services in the MDM operational cache deployment.
Using the sample transforms
- Place the JAR file containing the sample transforms into the /usr/ibmpacks/current/operational-cache/analytics/lib directory.
- Restart all services in the Master Data Connect deployment.