Extending business objects
Complete this procedure to extend business objects.
Procedure
- Register the extended business objects by adding their
class paths to the extension properties file. The extension business object can flow through existing transactions or newly defined transactions. You must register the extended business objects by adding their class paths to the extension properties file. Also, the extension business object and its attributes must be defined as data in the group/element data tables and the Rules of Visibility tables.
- Provide transaction-level logic for the
addRecord(),updateRecord(), andgetRecord()functions.Each extension object inherits from the parent object. The extended business object should override all of these with transaction-level logic for the add, update and get functions.The
addRecord()andupdateRecord()method in the extension object provide persistence of the extended data when the base product data is persisted. In other words, theaddRecord()method on the extension is invoked when the data contained within the product business object is persisted. Likewise forupdateRecord(). - Provide extension data retrieval logic for the
getRecord()method stub and update thetcrm_extension.propertiesfile.ThegetRecord()method stub provides the inquiry transaction to retrieve client- extended business object values. To use thegetRecord()method stub, override thegetRecord()method stub with your extension data retrieval logic and add an entry to thetcrm_extension.propertiesfile for the extended business object, in the format:
For example,baseBObjName_Extension=FullExtendedBObjClassNameTCRMContractRoleLocationBObj_Extension=com.dwl.tcrm.samples. extension.component.RoleLocationBObjExt. - Define the validations for the extended attributes using
the external validations component, or define them internally within
the extended business object.
You can use the external validation component if you are creating a validation that is specific to your company, and use the external validation to define validations for the extended attributes such as
minlength,disallowed values, and others. Or, if you are creating a validation that is specific to the InfoSphere® MDM product, the validations can be defined internally within the extended business objects. There are two validate methods stubs that are called in a similar fashion to the add and update stubs,validateAdd()andvalidateUpdate(). The validate stubs are invoked as part of the validation process.Note: For an example, see the Contact sample that is available on the InfoSphere MDM Support site.