Introduction to plugin development

With the open plugin architecture, Semarchy xDM allows extending its capabilities using Java code and external APIs. Through the plugins, existing services or information systems can contribute to the master data processing and enrichment.

You can extend the following capabilities in 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 plugins

Plugins are developed in Java using the xDM open plugin API. This API exposes several Java interfaces that your code must implement to interact with xDM.

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

  • rowTransformer for an enricher.

  • rowValidator for a validation.

Each extension endpoint has:

  • A set of parameters to optionally configure the plugin 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 plugin.

  • 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 plugin, you define first the plugin metadata, then you implement the code, based on this metadata. The metadata is used in the Application Builder to expose the plugin information, parameters and input/output fields.

Package and deploy your plugins

Plugins are packaged as bundles that can be installed or updated from the Configuration user interface in a running instance of 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 plugin will automatically make the platform take into account and work with the new version of the plugin.

Plugin development process

Run the following steps to create a plugin:

  1. Create a plugin project to host one or more plugins.

  2. Define the plugin metadata.

  3. Implement the plugin code.

  4. Test the plugin by implementing a test project and JUnit test cases.

  5. Generate the plugin binaries.

  6. Deploy the plugin in xDM.

About the example

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

  • 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 plugin 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 plugin is available for download: