Customizing external entity dependencies

The external entities of the promotion component might not expose sufficient attributes to support your promotions. In this case, you must introduce additional attributes.

CAUTION: Dynamic attribute support has not undergone vigorous testing. While it is supported, it may generate unexpected results.

About this task

In the promotions system, external entities are implemented using the following pattern (using order as an example):
external entity implementation

Procedure

To introduce a custom attribute:
  1. Extend the WCSOrder object so that the new class exposes the new attribute.
  2. Extend the WCSOrderFactory class so that the new implementation starts to serve up the extended WCSOrder objects
  3. Implement the custom OrderFactory implementation class.
  4. Register the custom implementation in the ExternalEntityFactoryRegistry section of the PromotionEngine configuration.
  5. Restart HCL Commerce so the changes take effect.