public class PromotionExecutionRecord extends java.lang.Object implements XMLizable, java.lang.Cloneable
XML Snippet for PromotionExecutionRecord:
<PromotionExecutionRecord impl="com.ibm.commerce.marketing.promotion.runtime.PromotionExecutionRecord"> <EngineName>Promotion engine name</EngineName> <Code>abcd</Code> <OrderKey><OrderId>1234</OrderId></OrderKey> <PromotionKey> <PromotionName>DollarsOffPromotionOne</PromotionName> <StoreKey> <DN>o=Root Organization</DN> <Identifier>BlueStore 201</Identifier> </StoreKey> <Version>0</Version> <Revision>0</Revision> </PromotionKey> <State>ELIMINATED</State> <PromotionPolicyKey> <PolicyName>A policy</PolicyName> <StoreKey> <DN>o=root organization</DN> <Identifier>BlueStore 202</Identifier> </StoreKey> </PromotionPolicyKey> <TargetedItems> <LineItemSet> <AssociatedOrderItem impl="com.ibm.commerce.marketing.promotion.runtime.AssociatedOrderItem" > <OrderItemKey> <OrderItemId>1234</OrderItemId> </OrderItemKey> <StartIndex>2</StartIndex> <Quantity>4</Quantity> </AssociatedOrderItem> <AssociatedOrderItem impl="com.ibm.commerce.marketing.promotion.runtime.AssociatedOrderItem" > <OrderItemKey> <OrderItemId>3456</OrderItemId> </OrderItemKey> <StartIndex>1</StartIndex> <Quantity>9</Quantity> </AssociatedOrderItem> </LineItemSet> </TargetedItems> <TargetedAmount>500</TargetedAmount> <!-- The types of monetary value targeted by the this promotion, see the 4 constants of MonetaryAdjustment PRICE, SHIPPING, SHIPPING_TAX, and TAX --> <TargetedAmountTypes>1</TargetedAmountTypes> <AppliedAdjustments> <Adjustment impl="com.ibm.commerce.marketing.promotion.reward.FixedAmountOffAdjustment"> <AmountOff>15</AmountOff> <Currency>CAD</Currency> <!-- wholeOrder or AllAffectedItems or IndividualAffectedItems --> <AdjustmentType>wholeOrder</AdjustmentType> </Adjustment> <AffectedItems> <LineItemSet> <AssociatedOrderItem impl="com.ibm.commerce.marketing.promotion.runtime.AssociatedOrderItem" > <OrderItemKey> <OrderItemId>1234</OrderItemId> </OrderItemKey> <StartIndex>2</StartIndex> <Quantity>4</Quantity> </AssociatedOrderItem> <AssociatedOrderItem impl="com.ibm.commerce.marketing.promotion.runtime.AssociatedOrderItem" > <OrderItemKey> <OrderItemId>3456</OrderItemId> </OrderItemKey> <StartIndex>1</StartIndex> <Quantity>9</Quantity> </AssociatedOrderItem> </LineItemSet> </AffectedItems> </AppliedAdjustments> </PromotionExecutionRecord>
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM Copyright
|
static int | STATE_APPLIED
Actual changes are made to the order and the order should be fulfilled.
|
static int | STATE_ASSESSED
A promotion is applicable to the current order.
|
static int | STATE_ELIMINATED
A promotion is applicable to the current order, but due to policy violations it should not be applied
|
static int | STATE_EXPIRED
Reward has expired, either due to the order to which it is applicable to has changed or a session has started
|
static int | STATE_INIT
A PromotionExecutionRecord has just been created, initial state
|
static int | STATE_QUALIFIED
A promotion is applicable to the current order.
|
static int | STATE_REJECTED
User declined this reward.
|
static int | STATE_WAIT_FOR_USER_CHOICE
A promotion is applicable but there are more than one choices available.
|
Constructor and Description |
---|
PromotionExecutionRecord(PromotionEngine aEngine)
Constructor for the PromotionExecutionRecord.
|
PromotionExecutionRecord(PromotionExecutionRecord aPreviousInChain)
Constructor for the PromotionExecutionRecord.
|
Modifier and Type | Method and Description |
---|---|
void | addCustomeValue(java.lang.String name, XMLizable value)
Sets a custom value on PromotionExecutionRecord
|
void | applied()
Sets the state of this record to STATE_APPLIED, raises a PromotionAppliedEvent.
|
void | assessed()
Sets the state of this record to STATE_ASSESSED and raise a PromotionAssessedEvent
|
java.lang.Object | clone() |
void | eliminated()
Sets the state of this record to STATE_ELIMINATED, raises a PromotionEliminatedEvent.
|
void | fromXML(org.w3c.dom.Node node)
Transforms the XML node into its corresponding real Object.
|
Adjustment[] | getAdjustments()
Returns the adjustments associated with the PromotionExecutionRecord.
|
LineItemSet[] | getAffectedItems()
Returns the list of order items to which the adjustment will be applied.
|
java.lang.Long[] | getAffectedOrderItemIDs(int type)
Deprecated.
not for general public use. For order subsystem only in the V5.6 release, no future support for this is planned.
|
AssociatedOrderItem[] | getAffectedOrderItems(Adjustment adjustment)
Returns all the order items (or portions of order items) affected by a particular adjustment
|
java.lang.String | getCode()
Returns the promotion code.
|
com.ibm.commerce.marketing.promotion.coupon.Coupon | getCoupon()
Returns the coupon redeemed in this promotion
|
com.ibm.commerce.marketing.promotion.coupon.CouponKey | getCouponKey()
Returns the coupon key of the promotion
|
java.util.Date | getCouponValTime()
Gets time to validate coupon
|
XMLizable | getCustomValue(java.lang.String name)
Getter for a custom value saved in the PromotionExecutionRecord
|
PromotionEngine | getEngine()
Returns the associated promotion engine.
|
java.lang.String | getEngineName()
Returns the name of the PromotionEngine which created this promotion execution record
|
java.math.BigDecimal | getMonetaryAdjustmentForOrder(int type)
Returns all the monetary adjustment on "type" (that is price, shipping charge, tax, shipping tax).
|
java.math.BigDecimal | getMonetaryAdjustmentTotalForOrderItem(java.lang.Long orderItemID, int type)
Deprecated.
not for general public use. For order subsystem only in the V5.6 release, no future support for this is planned.
|
PromotionExecutionRecord | getNextChoice()
In the case of a choice of rewards, it returns the next option.
|
Order | getOrder()
Returns the order to which the reward applies.
|
OrderKey | getOrderKey()
Returns the order key of the promotion
|
Promotion | getPromotion()
Returns the promotion of the PromotionExecutionRecord.
|
PromotionKey | getPromotionKey()
Returns the unique promotion key for the promotion
|
java.util.List | getRewardOptions()
Gets a list of RewardOption objects that are associated with this record.
|
int | getState()
Returns the state of the PromotionExecutionRecord namely one of the values of the constants STATE_INIT, STATE_WAIT_FOR_USER_CHOICE, STATE_ELIMINATED, STATE_ASSESSED, STATE_EXPIRED, STATE_QUALIFIED, STATE_REJECTED or STATE_APPLIED.
|
java.math.BigDecimal | getTargetedAmount()
Returns the targeted monetary amount used to qualify for this promotion, in order currency.
|
int | getTargetedAmountTypes()
Return the targeted monetary value types, if this promotion targets order qualifying total
|
LineItemSet | getTargetedItems()
Returns the targeted items of the promotion in the PromotionExecutionRecord.
|
AssociatedOrderItem[] | getTargetedOrderItems()
Returns all the order items (or portions of order items) targeted by this promotion
|
PromotionPolicy | getViolatedPolicy()
Returns the policy that is violated by this promotion, if it has been violated; else return null.
|
PromotionPolicyKey | getViolatedPolicyKey()
Returns the violated promotion policy key
|
boolean | isCodeEntered()
Checks to see if a promotion code is entered for the PromotionExecutionRecord.
|
void | pendingSelection()
Sets the state of this record to STATE_WAIT_FOR_USER_CHOICE and raise a PromotionAssessedEvent also for each available option This method is intended for customization only, and is not supported by default Promotion engine implementation.
|
void | qualified()
Sets the state of this record to STATE_QUALIFIED, raises a PromotionQualifiedEvent.
|
void | recordMonetaryAdjustmentForOrderItem(java.lang.Long orderItemID, java.math.BigDecimal value, int type)
Records a monetary adjustment on an order item.
|
void | rejected()
Sets the state of this record to STATE_REJECTED, raises a PromotionRejectedEvent.
|
void | setAdjustments(Adjustment[] aAdjustments)
Sets the adjustments associated with the PromotionExecutionRecord.
|
void | setAffectedItems(LineItemSet[] aAffectedItems)
Sets the list of order items to which the adjustment will be applied.
|
void | setCode(java.lang.String aCode)
Sets the promotion code.
|
void | setCodeEntered(boolean aCodeEntered)
Sets a boolean value to indicate if promotion code has been entered for the PromotionExecutionRecord.
|
void | setCoupon(com.ibm.commerce.marketing.promotion.coupon.Coupon aCoupon)
Sets the coupon that is redeemed in this promotion
|
void | setCouponValTime(java.util.Date date)
Sets time to validate coupon
|
void | setEngine(PromotionEngine aEngine)
Sets the promotion engine.
|
void | setEngineName(java.lang.String string)
Sets the name of the promotion engine which created this promotion execution record
|
void | setNextChoice(PromotionExecutionRecord aNextInGroup)
In the case of a choice of rewards, it sets the next option.
|
void | setOrder(Order aOrder)
Sets the order to which this reward applies.
|
void | setPromotion(Promotion aPromotion)
Sets the promotion of the PromotionExecutionRecord.
|
void | setState(int aState)
Sets the state of the PromotionExecutionRecord.
|
void | setTargetedAmount(java.math.BigDecimal amount)
Sets the targeted monetary amount used to qualify for this promotion, in order currency.
|
void | setTargetedAmountTypes(int i)
Set the targeted monetary value types bit pattern.
|
void | setTargetedItems(LineItemSet aTtargetedItems)
Sets the targeted Items for the promotion.
|
void | setViolatedPolicy(PromotionPolicy aViolatedPolicy)
Sets the promotion policy that is violated by this promotion.
|
java.lang.String | toString() |
java.lang.String | toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public static final int STATE_INIT
public static final int STATE_WAIT_FOR_USER_CHOICE
public static final int STATE_ELIMINATED
public static final int STATE_ASSESSED
public static final int STATE_EXPIRED
public static final int STATE_QUALIFIED
public static final int STATE_REJECTED
public static final int STATE_APPLIED
public PromotionExecutionRecord(PromotionEngine aEngine)
public PromotionExecutionRecord(PromotionExecutionRecord aPreviousInChain)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
public int getState()
public LineItemSet getTargetedItems()
public java.math.BigDecimal getTargetedAmount()
public void setState(int aState)
public void setTargetedItems(LineItemSet aTtargetedItems)
public void setTargetedAmount(java.math.BigDecimal amount)
public Order getOrder()
public Promotion getPromotion()
public PromotionPolicy getViolatedPolicy()
public void setOrder(Order aOrder)
public void setPromotion(Promotion aPromotion)
public void setViolatedPolicy(PromotionPolicy aViolatedPolicy)
public PromotionExecutionRecord getNextChoice()
public void setNextChoice(PromotionExecutionRecord aNextInGroup)
public boolean isCodeEntered()
public void setCodeEntered(boolean aCodeEntered)
public java.lang.String getCode()
public void setCode(java.lang.String aCode)
public void fromXML(org.w3c.dom.Node node) throws DeXMLizationException
public java.lang.String toXML() throws XMLizationException
public void assessed()
public void pendingSelection()
public void qualified()
public void eliminated()
public void applied()
public void rejected()
public Adjustment[] getAdjustments()
public LineItemSet[] getAffectedItems()
public PromotionEngine getEngine()
public void setAdjustments(Adjustment[] aAdjustments)
public void setAffectedItems(LineItemSet[] aAffectedItems)
public void setEngine(PromotionEngine aEngine)
public AssociatedOrderItem[] getTargetedOrderItems()
public AssociatedOrderItem[] getAffectedOrderItems(Adjustment adjustment)
public com.ibm.commerce.marketing.promotion.coupon.Coupon getCoupon()
public void setCoupon(com.ibm.commerce.marketing.promotion.coupon.Coupon aCoupon)
public com.ibm.commerce.marketing.promotion.coupon.CouponKey getCouponKey()
public OrderKey getOrderKey()
public PromotionKey getPromotionKey()
public PromotionPolicyKey getViolatedPolicyKey()
public java.lang.String toString()
public java.lang.Long[] getAffectedOrderItemIDs(int type)
public java.math.BigDecimal getMonetaryAdjustmentTotalForOrderItem(java.lang.Long orderItemID, int type)
public void recordMonetaryAdjustmentForOrderItem(java.lang.Long orderItemID, java.math.BigDecimal value, int type)
public java.math.BigDecimal getMonetaryAdjustmentForOrder(int type)
public java.lang.String getEngineName()
public void setEngineName(java.lang.String string)
public void addCustomeValue(java.lang.String name, XMLizable value)
public XMLizable getCustomValue(java.lang.String name)
public int getTargetedAmountTypes()
public void setTargetedAmountTypes(int i)
public java.util.Date getCouponValTime()
public void setCouponValTime(java.util.Date date)
public java.util.List getRewardOptions()