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.

The following examples are included in the JAR file:
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:
  • customAddress1 maps to PrimaryResidence.Address.AddressLine1
  • customAddress2 maps to PrimaryResidence.Address.AddressLine2
  • customAddress3 maps to PrimaryResidence.Address.AddressLine3
  • customAddressCity maps to PrimaryResidence.Address.City
  • customAddressState maps to PrimaryResidence.Address.ProvinceStateValue
  • customAddressZip maps to PrimaryResidence.Address.ZipPostalCode
  • customAddressCountry maps to PrimaryResidence.Address.CountryValue
  • customFirstName maps to LegalName.GivenName
  • customMiddleName maps to LegalName.MiddleName
  • customLastName maps to LegalName.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 @alternative annotation, the CustomJSONPropertyKeyTransformer will be used by default. To use the CustomXMLTransformer instead, you must modify the WEB-INF/beans.xml file 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.xml file, restart all services in the MDM operational cache deployment.

Using the sample transforms

  1. Place the JAR file containing the sample transforms into the /usr/ibmpacks/current/operational-cache/analytics/lib directory.
  2. Restart all services in the Master Data Connect deployment.