External rules

The following is a description of the changes to how InfoSphere® MDM uses and handles external rules.

Before OSGi

Rules are defined in an InfoSphere MDM database table containing the rule IDs and the classes that implement those rules. Prior to OSGi, the classes for those rules were loaded by the InfoSphere MDM rule framework using simple Java™ reflection.

With OSGi

Rules are defined to be pluggable components. An external rule can potentially come from any bundle, and so external rules can only be accessed using services. Like business objects and validators, an intermediary factory service is used. If you have customized any of the default external rules, or if you have written your own, here is the blueprint sample you must use to make them available to the InfoSphere MDM external rule framework:
<service id="ExternalRuleLocatorService"
	interface="com.dwl.base.externalrule.RuleLocator" ranking="XX">
   <bean class="com.dwl.base.externalrule.RuleLocatorImpl">
      <property name="bpBundle" ref="blueprintBundle"/>
      <argument>
      	<list>
             <bean class="Rule class name here"/>
             <bean class="Rule class name here"/>
             <bean class="..."/>
      	</list>
      </argument>
   </bean>
</service>

The bundle defining the RuleLocator service must import the following package com.dwl.base.externalrule. In addition, the RuleLocator service must be exported in the CBA for it to be visible to the MDM rule framework. The service ranking must be set to a value greater than 0 if overriding a default (out-of-the-box) rule implementation.

You must still continue to register the rules and the implementations as described in Rule IDs.