public class EachItemCanParticipateInPromotionOncePolicy extends java.lang.Object implements PromotionPolicy
XML Snippet of EachItemCanParticipateInPromotionOncePolicy:
<PromotionPolicy impl="com.ibm.commerce.marketing.promotion.policy.EachItemCanParticipateInPromotionOncePolicy"> <PromotionPolicyKey> <PolicyName>Shipping: Any order item can only participate in one promotion</PolicyName> <StoreKey> <DN>ou=bluemall b2b organization,o=seller organization,o=root organization</DN> <Identifier>BlueStore 202</Identifier> </StoreKey> </PromotionPolicyKey> <!-- Exemptions are optional and can be listed like the following: <Exemption>Targeted</Exemption> OR <Exemption>Affected</Exemption> --> <Status>Active</Status> </PromotionPolicy>
Constructor and Description |
---|
EachItemCanParticipateInPromotionOncePolicy()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean | apply(PromotionContext context, PromotionExecutionRecord record)
This method is used to mark line items in the PromotionContext, to not be targeted or to not be affected, by promotions, at current group level, depending upon the Exemption configuration value.
|
void | fromXML(org.w3c.dom.Node anXMLNode)
Transforms the XML node into its corresponding real Object.
|
java.lang.String | getDescription(java.util.Locale locale, int type)
Returns the description of the promotion policy based on its type and locale.
|
PromotionPolicyKey | getKey()
Returns the key of this promotion policy
|
int | getStatus()
Returns the status of this promotion policy
|
boolean | isExemptedFromAffectRule()
Returns the flag that controls whether to enforce the each item can be affected by a single promotion rule or not
|
boolean | isExemptedFromTargetRule()
Returns the flag that controls whether to enforce the each item can be targeted by a single promotion rule or not
|
void | setExemptedFromAffectRule(boolean b)
Sets the flag that controls whether to enforce the each item can be affected by a single promotion rule or not
|
void | setExemptedFromTargetRule(boolean b)
Sets the flag that controls whether to enforce the each item can be targeted by a single promotion rule or not
|
void | setKey(PromotionPolicyKey akey)
Sets the key of this promotion policy
|
void | setStatus(int newStatus)
Sets the status of a promotion policy.
|
java.lang.String | toXML()
Converts the object into its corresponding XML format representation.
|
public EachItemCanParticipateInPromotionOncePolicy()
public PromotionPolicyKey getKey()
public java.lang.String getDescription(java.util.Locale locale, int type)
public boolean apply(PromotionContext context, PromotionExecutionRecord record) throws PromotionPolicyApplicationException
public int getStatus()
public void setStatus(int newStatus)
public void setKey(PromotionPolicyKey akey)
public java.lang.String toXML() throws XMLizationException
public void fromXML(org.w3c.dom.Node anXMLNode) throws DeXMLizationException
public boolean isExemptedFromAffectRule()
public boolean isExemptedFromTargetRule()
public void setExemptedFromAffectRule(boolean b)
public void setExemptedFromTargetRule(boolean b)