In the following example, you want to create a new pricing engine that prices handling costs separately from shipping. You create a HandlingPricingEngine that acts independently of the ShippingPricingEngine.

  1. Create an interface called HandlingPricingEngine that extends PricingEngine.

  2. Create an implementation called HandlingPricingEngineImpl that extends PricingEngineService.

  3. Create a HandlingPricingInfo that extends the AmountInfo price holding class. (For more information, see AmountInfo.)

  4. Create a calculator called HandlingPricingCalculator and implementations of it that calculate and discount handling as your business requires.

  5. Modify the Promotions repository definition file (by default, pricingModels.xml). Add an item-descriptor for the Handling discount type and sub-descriptors for the various implementations of the HandlingPricingCalculator that you created.

  6. Create properties files for the HandlingPricingEngine and each of the calculators.

Your engine is ready for use. You may also want to add preCalculators that calculate the base cost of handling.

Copyright © 1997, 2012 Oracle and/or its affiliates. All rights reserved. Legal Notices