Introduction to plug-in development

With the Open Plug-in Architecture, Semarchy xDM allows extending its capabilities using Java code and external APIs. Through the plug-ins, existing services or information systems can contribute to the master data processing and enrichment.

You can extend the following capabilities in Semarchy xDM:

  • Enrichers: By adding new enrichers, you can perform record-level enrichment to update, augment or standardize existing attribute values, or create new content in attributes. For example, you can connect to an external web service to retrieve stock ticker symbols from company names.

  • Validations: By adding new validations, you can check records against complex data quality rules. For example, you can connect to an external provider to check whether a billing or shipping address is accurate or not.

Develop your plug-ins

Plug-ins are developed in Java using the Semarchy xDM Open Plug-in API. This API exposes several Java interfaces that your code must implement to interact with Semarchy xDM.

The plug-ins are developed in plug-in projects into which you defined extension endpoints. Each endpoint appears as an enricher or validation plug-in available in Semarchy xDM. These endpoints are based on two predefined endpoints types:

  • rowTransformer for an Enricher.

  • rowValidator for a Validation.

Each extension endpoint has:

  • A set of Parameters to optionally configure the plug-in behavior.

  • One or more Input fields. In the case of an enricher, these fields are pushed to the enricher for transformation. In the case of a validation, these fields are checked against the data quality rules implemented in the plug-in.

  • One or more Output fields (only for enrichers). These are the values returned by the enricher. In the case of a validation, there is no output field, as the validation only returns a Boolean indicating whether the validation is passed or failed.

To design a plug-in, you define first the plug-in metadata, then you implement the code, based on this metadata. The metadata is used in the Semarchy Application Builder to expose the plug-in information, parameters and input/output fields.

Package and deploy your plug-ins

Plug-ins are packaged as bundles that can be installed or updated from the Semarchy xDM Configuration user interface in a running instance of Semarchy xDM. The server does not need to restart to take new or updated bundles into account.

Bundles are tagged with a version number. Installing a new version of an existing plug-in will automatically make the platform take into account and work with the new version of the plug-in.

Plug-in development process

Run the following steps create a plug-in:

  1. Create a plug-in project to host one or more plug-ins.

  2. Define the plug-in metadata.

  3. Implement the plug-in code.

  4. Test the plug-in by implementing a test project and JUnit test cases.

  5. Generate the plug-in binaries.

  6. Deploy the plug-in in Semarchy xDM.

About the example

In the next steps, you will design a sample enricher plug-in called International Phone Standardizer.
This plug-in:

  • Takes a phone number in an input field called INPUTPHONE.

  • Standardizes it as an output phone number called STANDARDIZEDPHONE.

  • Has a NULLIFYONERROR parameter. If this parameter is set to 1, phone numbers that cannot be standardized are transformed to a null value. Otherwise, the original phone number is returned.

To keep the code simple, the standardization algorithm provided in this sample plug-in only works for phone numbers from France. It standardizes them to the +33<9 digits> format. It is intended for demonstration purposes and not for production environments.

The source code of the example plug-in is available for download: