Overview of the sample for enabling defaulted source values for an existing business object

A sample project has been created to illustrate the use of Default Source Values.

The project contains an OSGi bundle that is included in a composite bundle archive named DefaultSourceValuescba.cba.

The purpose of source values is to establish a standardized approach to store and retrieve information, or values, that come from an external sources when the attributes of those values do not fit the structure of InfoSphere® MDM products. Source values allow you to identify the system, application, or user that provided the value. It also stores the date the value was collected, as well as a history of the source that provided the value and the date when that value changes.

Default Source Values are an entity in their own right, but they are never added or updated independently. Default Source Values entities are only updated within the context of another entity or business object. They are a way for collecting additional information related to that entity without modifying the attributes of the entity itself. For example you can include default source values within the context of updating a Person or an Organization. Default Source Values always refer to another entity in InfoSphere MDM. This is done with the EntityName and InstancePK entries in the DWLDefaultedSourceValueBObj business object.

These two attributes point to an instance of another entity. In order to use Default Source Values, you must embed the DWLDefaultedSourceValueBObj within an existing business object as an extension. To do that, you must create an Extension to the existing business object so that you can include the DWLDefaultedSourceValueBObj as an extending entity.

In this sample, the Person and the Organization Business Objects have been extended. Here are the XML Schemas illustrating how they were extended:
<xsd:element name="DWLOrganizationBObjExt" 
	substitutionGroup="CommonExtensionBObj" 
	type="DWLOrganizationBObjExtType"/>
<xsd:element name="DWLPersonBObjExt" 
	substitutionGroup="CommonExtensionBObj" 
	type="DWLPersonBObjExtType"/>
<xsd:complexType name="DWLOrganizationBObjExtType">
	<xsd:complexContent>
		<xsd:extension base="CommonExtensionBObjType">
			<xsd:sequence>
				<xsd:element ref="ObjectReferenceId" minOccurs="0"/>
				<xsd:element ref="DWLDefaultedSourceValueBObj" 
					minOccurs="0" maxOccurs="unbounded"/>
			</xsd:sequence>
		</xsd:extension>
	</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="DWLPersonBObjExtType">
	<xsd:complexContent>
		<xsd:extension base="CommonExtensionBObjType">
			<xsd:sequence>
				<xsd:element ref="ObjectReferenceId" 
					minOccurs="0"/>
				<xsd:element ref="DWLDefaultedSourceValueBObj" 
					minOccurs="0" maxOccurs="unbounded"/>
			</xsd:sequence>
		</xsd:extension>
	</xsd:complexContent>
</xsd:complexType>

In the prior illustration, two new entities are declared: DWLOrganizationBObjExt and DWLPersonBObjExt. These are declared to be subtypes of the CommonExtensionBObjType. They are declared to contain, in addition to the elements contained in their supertype, the DWLDefaultedSourceValueBObj as an element.

In addition, because we are declaring new business objects as being extensions of existing business objects, we format the blueprint files for business object factories. TCRMOrganizationBObj has been extended with DWLOrganizationExtBObj, and TCRMPersonBObj has been extended with DWLPersonExtBObj. Therefore, a new business object factory must be created to declare the new business objects and ensure that the factory will produce ONLY DWLOrganizationExtBObj and DWLPersonExtBObj. This is illustrated as follows:
<service id="BObjFactoryService"
	interface="com.ibm.mdm.common.bobj.api.BObjFactoryService"
	ranking="20">
	<service-properties>
	<entry key="business.object">
		<list>
			<value>TCRMOrganizationBObj</value>
			<value>TCRMPersonBObj</value>
			<value>DWLOrganizationBObjExt</value>
			<value>DWLPersonBObjExt</value>
		</list>
	</entry>
</service-properties>
	<bean class="com.ibm.mdm.common.bobj.BObjFactoryServiceImpl">
		<argument>
			<map key-type="java.lang.String" value-type="java.lang.Class">
				<entry key="DWLOrganizationBObjExt"
					value="com.ibm.mdm.partydefaultsourcevalues.DWLOrganizationBObjExt"/>
				<entry key="DWLPersonBObjExt" 
					value="com.ibm.mdm.partydefaultsourcevalues.DWLPersonBObjExt"/>
				<entry key="TCRMOrganizationBObj" 
					value="com.ibm.mdm.partydefaultsourcevalues.DWLOrganizationBObjExt"/>
				<entry key="TCRMPersonBObj" 
					value="com.ibm.mdm.partydefaultsourcevalues.DWLPersonBObjExt"/>
			</map>
		</argument>
		<argument ref="blueprintBundle"/>
	</bean>
</service>
There’s one more thing that you need to do to enable your object to carry with it Default Source Values. There is a Default Source Value Component much like there is a Party Component; however, the Default Source Value Component is also a behavior extension. It is so by virtue of the fact that it extends the ClientJavaExtensionSet abstract class. Its full name is com.dwl.base.defaultSourceValue.component.DefaultedSourceValueComponent. You don’t need to write any specific behavior extension; this behavior extension is defined in the InfoSphere MDM extension set database and is enabled to execute in four circumstances:
  • after adding a person
  • after updating a person
  • after adding an organization
  • after updating an organization

The job of the behavior extension is to also add or update defaulted source values. If you have defined Default Source Values for other entities, you must modify the behavior extensions data base to include the additional transactions where you would like the default source values to execute. For example if you added Default Source Values to a Product entity, you would need to include the transactions for adding and updating (and possibly deleting) products.



Last updated: 13 Sep 2017