Third-party Methods of Generating ExternalId¶
Universe MDM provides the ability to implement third-party methods of generating External ID. The implemented methods become available for selection when configuring the entity/reference set and code attribute properties.
To use third-party generation methods:
Implement a Java interface that describes the algorithm for the third-party strategy. Example:
public interface ExternalIdGenerator { /** * Generate external id by ctx * @param ctx ctx * @return return external id */ Object generateExternalId(ExternalIdResettingContext ctx); }
Place the JAR file containing the implementation of the strategies in the <TOMCAT_HOME>/universe-integration directory.
Include third-party strategies in the universe-conf.xml file in the externalIdStrategies section. Configuration example:
<conf:configuration xmlns:conf="http://conf.mdm.universe.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://conf.mdm.universe.com/"> <conf:externalIdStrategies> <conf:strategy id="randomIdStrategy" name="Random ID Strategy" description="Generates random "long" value" class="com.unidata.mdm.backend.common.integration.strategy.RandomLongExt ernalIdGeneratorTest"/> ... </conf:externalIdStrategies> <conf:exits>
The id and name fields are mandatory. It is recommended to add a description of the strategy in the description.
Restart the system server.