Adding a custom service to Management Center

You can define a custom service and associate it with a Management Center business object definition. Use a custom service to perform a processing action on a business object. For example, to activate a promotion. Do not use a custom service to perform the basic business operations, such as to create, update, and delete objects.

Before you begin

Ensure that you customize the persistence layer and the Business Object Manager to support your custom service:

Procedure

  1. Open HCL Commerce Developer and switch to the Enterprise Explorer view.
  2. Expand LOBTools > WebContent > WEB-INF > src > xml > commerce > component > objectDefinitions, where component is the name of the Management Center component.
  3. Open the primary object definition file for the business object that you want to associate with your custom service.
  4. Define the use of the custom service for business object by adding CustomService elements as child elements of the primary object definition.
    For example, the following code snippet demonstrates the definition of a custom service that activates a promotion.
    
    <CustomService url="/cmc/ActivatePromotion" toolbarIcon="activateToolbarIcon" 
     displayName="${promotionResources.promotionList_activate_displayName}">
     <EnablementCondition conditionId="activate" propertyName="status"
      enablementValue="Inactive" />
     <ServiceParam name="promotionId" propertyName="promotionId"/>
    </CustomService>
  5. Save and publish your changes.