Friday, April 27, 2012

Class Qualifier : ATG


Class Qualifier

atg.commerce.pricing.Qualifier

All Implemented Interfaces:

NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener


public class Qualifier extends GenericService


A Helper class for discount calculators. Calculators call their helper method in this class to determine to which items they should apply their discount. As a side effect, the Qualifier also keeps track of which items acted as qualifiers for the input promotion, if applicable, and marks their priceInfos as appropriate.
  • ItemDiscountCalculator uses findQualifyingItems
  • OrderDiscountCalculator uses findQualifyingOrder
  • ShippingDiscountCalculator uses findQualifyingShipping
  • TaxDiscountCalculator uses findQualifyingOrder

This class can be extended. New "findQualifyingX" methods can be added to act as helper methods to new kinds of PricingCalculator. Any calculator that needs a rule to determine whether to apply a discount might use the Qualifier class.
By default, the Qualifier evaluates rules written in PMDL (Pricing Model Description Language). evaluateQualifier and evaluateTarget evaluate the qualfier and target elements of PMDL repspectively. The evaluateQualfier and evaluateTarget methods are protected and are available to be extended.
  • licenseFileNames is the component names of the license files which this component requires.
  • pmdlCache is the cache which maps pricing model RepositoryItems to their parsed PMDL bean representations.
  • pricingModelProperties is a list of the names of the properties of a pricing model RepositoryItem.
There are a number of properties that can be configured to adjust the way in which CommerceItems are allowed to participate in pricing rule evaluation. There are two rules which make up a PMDL rule: the qualifier rule and target rule. Accordingly, there two categories of filter property: filterForQualifier and filterForTarget.
In all of the properties listed below, a value of true indicates that items with the specified attributes should be excluded from the qualification process.

Qualifier filters:


  • filterForQualifierNegativePrices: default = true. Toggle whether items with negative prices should be allowed to act as qualifiers.
  • filterForQualifierZeroPrices: default = true. Toggle whether items with zero prices should be allowed to act as qualifiers
  • filterForQualifierOnSale: default = false. Toggle whether items that were priced with a sale price should be allowed to act as qualifiers
  • filterForQualifierDiscountedByCurrentDiscountId: default = true. Toggle whether items discounted by the "current" discount should be allowed to act as qualifiers
  • filterForQualifierDiscountedByAnyDiscountId: default = true. Toggle whether items discounted by any discount should be allowed to act as qualifiers. Masks filterForQualifierDiscountedByCurrentDiscountId (if this property is on, it doesn't matter what the other property is set to)

Target filters:

  • filterForTargetNegativePrices: default = true. Toggle whether items with negative prices should be allowed to receive the current discount
  • filterForTargetZeroPrices: default = true. Toggle whether items with zero prices should be allowed to receive the current discount
  • filterForTargetPricesLessThanOrEqualToPromotionPrice: default = true. Toggle whether items with prices that are already less than the price that would be granted by a "fixed price" promotion should receive the promotion.
  • filterForTargetOnSale: default = false. Toggle whether items that were priced with a sale price should be allowed to receive the current discount
  • filterForTargetDiscountedByCurrentDiscountId: default = true. Toggle whether items that have been discounted by the current discount should be allowed to receive the discount again
  • filterForTargetDiscountedByAnyDiscountId: default = true. toggle whether items that have been discounted by any discount should be allowed to receive the discount again
  • filterForTargetActedAsQualifierForAnyDiscount: default = true. toggle whether items that have acted as a qualifier for any discount should be allowed to receive the current discount

No comments:

Popular Posts