The Qualifier class contains two protected methods, evaluateQualifier and evaluateTarget, which are responsible for evaluating different elements of a PMDL rule.

The evaluateQualifier method determines if the input environment (the pricing context) satisfies the constraints of the qualifier rule. The input environment is represented by the parameters passed into the method. If the constraints are satisfied, evaluateQualifier determines which objects acted as qualifiers in satisfying the rule. For more information, see the Evaluating Qualifiers Example section

For example, in the rule “Buy 1 shirt, get 1 hat free,” the “one shirt” element of the rule is evaluated through evaluateQualifier. If the promotion is a “For next” promotion, the method returns the shirt item that satisfies the constraint; if a “When” promotion, a Boolean value of true is returned.

For example, consider the PMDL rule “When there is at least 1 blue item, discount 1 green item.” If a blue item is included in the input environment, the qualifier returns a java.lang.Boolean indicating that the environment matched the rule. If the rule had been written “For the next blue item, discount one green item,” the blue item is returned.

The evaluateTarget method is invoked in every promotion situation, in order to retrieve the discount structure from the offer.

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