public class PromotionArgument extends java.lang.Object implements XMLizable, java.lang.Cloneable
XML Snippet for PromotionArgument:
<PromotionArgument impl="com.ibm.commerce.marketing.promotion.runtime.PromotionArgument"> <EngineName>Promotion Engine name</EngineName> <OrderKey><OrderId>1234</OrderId></OrderKey> <CustomerKey><LogonId>wcsadmin</LogonId></CustomerKey> <InvocationTemplate> <Template name="Store 201 Order Level Promotion"> <DefaultDN>Blue mall organization</DefaultDN> <DefaultStore>Store 201</DefaultStore> <PromotionGroups> <Group>OrderLevelPriceDiscounts</Group> <Group>OrderLevelShippingDiscounts</Group> <Group DN="root organization" Store="Default Store">SiteWideFreeGiftPromotionsForNewSignUps</Group> </PromotionGroups> </Template> </InvocationTemplate> <DiscardPreviousResult>false</DiscardPreviousResult> <SaveCurrentResult>true</SaveCurrentResult> <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> </PromotionArgument>
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM Copyright
|
Constructor and Description |
---|
PromotionArgument()
Constructor for PromotionArgument.
|
PromotionArgument(Order aOrder, Customer aCustomer, java.lang.String aTemplate, boolean aDiscard, boolean aSave, java.util.Hashtable aNVP)
Constructor used to create a PromotionArgument
|
Modifier and Type | Method and Description |
---|---|
void | appendPromotionErrorReport(PromotionErrorReport report)
Appends a promotion error report to a list of error reports.
|
void | appendPromotionExecutionRecord(PromotionExecutionRecord record)
Appends a promotion execution record
|
java.lang.Object | clone() |
void | finalizePromotionArgument()
Finalizes promotion argument, marks all applicable PromotionExecutionRecords as applied and logs statistics.
|
void | fromXML(org.w3c.dom.Node anXMLNode)
Transforms the XML node into its corresponding real Object.
|
java.lang.String | getEngineName()
Returns the name of the promotion engine that is invoked.
|
java.lang.String | getInvocationTemplate()
Returns the invocation Template.
|
Order | getOrder()
Returns the order to which promotions will be applied
|
OrderKey | getOrderKey()
Returns the key of an Order
|
Customer | getOwner()
Returns the reference of Customer entity which belongs to the PromotionArgument
|
CustomerKey | getOwnerKey()
Returns the key of the Owner
|
java.lang.Object | getParameter(java.lang.String name)
Returns object value from name and value pair stored in a Hashtable containing any additional parameters to promotion engine and promotions.
|
PromotionErrorReport[] | getPromotionErrorReports()
Returns all the promotion error reports accumulated so far.
|
java.util.Iterator | getPromotionExecutionRecords()
Returns the list of all results from evaluation of promotions
|
OrderRunningTotal | getRunningTotal()
Returns the order running total object.
|
java.util.Hashtable | getRuntimeAttributes()
Returns a Hashtable containing the name-value pairs representing additional parameters to promotion engine and promotions.
|
boolean | hasApplicablePromotions()
This method determines if promotion argument contains any applicable promotions.
|
boolean | hasUnusedFreeGifts(PromotionExecutionRecord record)
Checks a promotion execution record to determine if this is a free gift promotion where no free gift was selected.
|
boolean | isCurrentResultSaved()
This method determines if the result of current session will be saved in persistent storage or not.
|
boolean | isPreviousResultDiscarded()
This method determines if previous promotion results will be discarded or not.
|
void | setAdditionalParameters(java.util.Hashtable aNVP)
This method is used to specify a Hashtable which contains additional parameters to promotion engine and promotions, using a name-value pair style.
|
void | setCurrentResultSaved(boolean aCurrentResultSaved)
Sets whether the result of current session will be saved in persistent storage or not.
|
void | setEngineName(java.lang.String string)
Sets the name of the promotion engine that is invoked.
|
void | setHasApplicablePromotions(boolean aHasApplicablePromotions)
Set to true if this PromotionArgument contains applicable promotions.
|
void | setInvocationTemplate(java.lang.String aInvocationTemplate)
Sets the invocation template.
|
void | setOrder(Order aOrder)
Sets the order.
|
void | setOwner(Customer aOwner)
Sets the owner.
|
void | setParameter(java.lang.String name, java.lang.Object value)
Sets name/value pair in the hash table used for storing any additional parameters to promotion engine and promotions.
|
void | setPreviousResultDiscarded(boolean aPreviousResultDiscarded)
Sets whether previous promotion results will be discarded or not.
|
protected void | setRunningTotal(OrderRunningTotal controller)
Sets running total controller object.
|
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 PromotionArgument()
public PromotionArgument(Order aOrder, Customer aCustomer, java.lang.String aTemplate, boolean aDiscard, boolean aSave, java.util.Hashtable aNVP)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
public Order getOrder()
public Customer getOwner()
public java.util.Iterator getPromotionExecutionRecords()
public void appendPromotionExecutionRecord(PromotionExecutionRecord record)
public java.lang.Object getParameter(java.lang.String name)
public void setParameter(java.lang.String name, java.lang.Object value)
public java.lang.String toXML() throws XMLizationException
public void fromXML(org.w3c.dom.Node anXMLNode) throws DeXMLizationException
public void setOrder(Order aOrder)
public void setOwner(Customer aOwner)
public java.lang.String getInvocationTemplate()
public void setInvocationTemplate(java.lang.String aInvocationTemplate)
public void setAdditionalParameters(java.util.Hashtable aNVP)
public boolean isCurrentResultSaved()
public boolean isPreviousResultDiscarded()
public boolean hasApplicablePromotions()
public void setHasApplicablePromotions(boolean aHasApplicablePromotions)
public void setCurrentResultSaved(boolean aCurrentResultSaved)
public void setPreviousResultDiscarded(boolean aPreviousResultDiscarded)
public OrderKey getOrderKey()
public CustomerKey getOwnerKey()
public boolean hasUnusedFreeGifts(PromotionExecutionRecord record)
public void finalizePromotionArgument() throws PromotionRuntimeException
public OrderRunningTotal getRunningTotal()
protected void setRunningTotal(OrderRunningTotal controller)
public java.lang.String toString()
public java.util.Hashtable getRuntimeAttributes()
public java.lang.String getEngineName()
public void setEngineName(java.lang.String string)
public void appendPromotionErrorReport(PromotionErrorReport report)
public PromotionErrorReport[] getPromotionErrorReports()