Extending a business object mediator
Occasionally the default business objects provided with HCL Commerce are insufficient to describe the types of data used in certain businesses, making it is necessary to extend or create new business objects. If you have created custom business objects, then you will need to create a custom business object mediator in order to override existing component services to understand them.
Procedure
-
Create the custom mediator:
- Open HCL Commerce Developer.
- Open the Java EE perspective and select the Enterprise Explorer view.
- Go to .
- Right-click src. Select .
- Name the package.
- Click Finish.
- Right-Click the package. Select .
- Name the class.
- Click Finish.
-
Determine the mediator to extend:
- Open the created class. Add the required logic to the class.
- Open the created Java method.
- Import the package from wc-business-object mediator.xml
- Right-click the Java method. Select . Select the method to override.
- Update wc-business-object-mediator.xml to instruct the component service module to use the extended mediator.