Extending business objects

Complete this procedure to extend business objects.

Procedure

  1. 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.
  2. Provide transaction-level logic for the addRecord(), updateRecord(), and getRecord() 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() and updateRecord() method in the extension object provide persistence of the extended data when the base product data is persisted. In other words, the addRecord() method on the extension is invoked when the data contained within the product business object is persisted. Likewise for updateRecord().

  3. Provide extension data retrieval logic for the getRecord() method stub and update the tcrm_extension.properties file.
    The getRecord() method stub provides the inquiry transaction to retrieve client- extended business object values. To use the getRecord() method stub, override the getRecord() method stub with your extension data retrieval logic and add an entry to the tcrm_extension.properties file for the extended business object, in the format:
    baseBObjName_Extension=FullExtendedBObjClassName
    For example, TCRMContractRoleLocationBObj_Extension=com.dwl.tcrm.samples. extension.component.RoleLocationBObjExt.
  4. 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() and validateUpdate(). 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.