public class OrderQualifyingTotalEnforcementPolicy extends PromotionPolicyBase
OrderQualifyingTotalBasedPurchaseCondition
only.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM Copyright
|
POLICY_STATUS_ACTIVE, POLICY_STATUS_DELETED, POLICY_STATUS_INACTIVE
Constructor and Description |
---|
OrderQualifyingTotalEnforcementPolicy()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
apply(PromotionContext context,
PromotionExecutionRecord record)
This method enforces the promotion policy.
|
fromXML, getDescription, getKey, getStatus, setKey, setStatus, toXML
public static final java.lang.String COPYRIGHT
public OrderQualifyingTotalEnforcementPolicy()
public boolean apply(PromotionContext context, PromotionExecutionRecord record) throws PromotionPolicyApplicationException
PromotionContext.reduceOrderQualifyingTotal(BigDecimal amount, int
types)
method using the PromotionExecutionRecord
record
object to
obtain the amount and types parameters. If the order total price is found
to be less than or equal to zero, then it marks all the promotions
govered by this policy as not applicable in the PromotionContext
context
.apply
in interface PromotionPolicy
apply
in class PromotionPolicyBase
context
- PromotionContext, created and passed to this policy by the enginerecord
- the PromotionExecutionRecord
for which violation is tested.true
if by applying this promotion (as indicated by the record parameter), no violation with this policy is found.
false
a violation is found, this promotion can not be applied.PromotionPolicyApplicationException
- when the evaluation runs into any unexpected errorPromotionPolicy.apply(com.ibm.commerce.marketing.promotion.runtime.PromotionContext,
com.ibm.commerce.marketing.promotion.runtime.PromotionExecutionRecord)