java.lang.ObjectCacheableCommandImpl
com.ibm.commerce.command.AbstractECTargetableCommand
com.ibm.commerce.command.TaskCommandImpl
com.ibm.commerce.command.BusinessPolicyCommandImpl
com.ibm.commerce.order.calculation.CalculationCmdImpl
com.ibm.commerce.couponredemption.commands.CalculateDiscountAmtCmdImpl
The purpose of the task command is to computes the discount amount for each eCoupon that satisfy the purchase order conditions of the of the eCoupon.
First the orderItems for a order are found out and for each cpwalletId, corresponding promoId is found out from the CouponWalletAccessBean. The corresponding calcodeId are found out from PromoDiscAccessBean by using the obtained promoId. A mapping is computed between OrderItemAccessBean (corresponding to the items qualified for this cpwalletId) and the Categorized MonetaryAmount(Set to zero). The task command CalculationCodeCalculate command with usage type as eCoupons and the mapping created above are called and the discount amounts are stored in TempCouponItemMapAccessBean. These above steps are performed for each cpwalletId.
Field Summary | |
protected java.util.Vector[] | appItems The nth element of this array contains the IDs of applicable items for the nth coupon. |
protected java.lang.Long[] | bcIds The IDs of the coupons to be applied to this order |
protected java.lang.Long | orderId ID of the order |
protected CommandContext | processingContext The command context holder |
protected TypedProperty | reqProp The request properties |
protected java.util.Hashtable | returnTable This tables stores the discount amounts computed by this command. |
protected TypedProperty | rspProp The response properties |
Fields inherited from class com.ibm.commerce.command.BusinessPolicyCommandImpl |
policyId, requestProperties |
Fields inherited from class com.ibm.commerce.command.AbstractECTargetableCommand |
commandContext |
Fields inherited from interface com.ibm.commerce.couponredemption.commands.CalculateDiscountAmtCmd |
defaultCommandClassName, Name |
Fields inherited from interface com.ibm.commerce.order.calculation.CalculationCmd |
NAME |
Fields inherited from interface com.ibm.commerce.command.ECCommand |
defaultCommandClassName |
Constructor Summary | |
CalculateDiscountAmtCmdImpl() CouponDSSCmdImpl constructor, call super. |
Method Summary | |
boolean | checkParentCatEntryIds(java.lang.Long oiCatEntryId, java.lang.Long walletCatEntryId) Checks the parent catalog entry. |
java.util.Vector[] | getAppItems() Gets the applicable items. |
static java.lang.String | getIClassName() Gets the class name. |
java.lang.Long | getOrderId() Gets the orderId. |
CommandContext | getProcessingContext() Gets the processing context. |
TypedProperty | getReqProp() Gets request properties. |
TypedProperty | getResponseProperties() Gets the response properties. |
java.util.Hashtable | getReturnTable() Gets the return table. |
TypedProperty | getRspProp() Gets the response properties. |
boolean | isReadyToCallExecute() It always returns true. |
void | performExecute() First the orderItems for a order are found out and for each cpwalletId, corresponding promoId is found out from the CouponWalletAccessBean. |
void | reset() Resets the command properties. |
void | setAppItems(java.util.Vector[] newAppItems) Sets the applied items. |
void | setBcIds(java.lang.Long[] paramBcIds) Sets the eCouponIds. |
void | setOrderId(java.lang.Long newOrderId) Sets the order IDs. |
void | setProcessingContext(CommandContext newProcessingContext) Sets the processing context. |
void | setReqProp(TypedProperty newReqProp) Sets the request properties. |
void | setRequestProperties(TypedProperty paramReqProp) Sets the request properties. |
void | setReturnTable(java.util.Hashtable newReturnTable) Sets the return table. |
void | setRspProp(TypedProperty newRspProp) Sets the responce properties. |
Methods inherited from class com.ibm.commerce.order.calculation.CalculationCmdImpl |
createCommand, getCurrency, getCustomProperties, getCustomProperty, getTimestamp, getUsageId, recycleCommand, setCurrency, setCustomProperties, setCustomProperty, setTimestamp, setUsageId |
Methods inherited from class com.ibm.commerce.command.BusinessPolicyCommandImpl |
getPolicyId, getRequestProperties, setPolicyId |
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand |
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.ibm.commerce.command.BusinessPolicyCommand |
getPolicyId, getRequestProperties, setPolicyId |
Field Detail |
protected java.lang.Long[] bcIds
protected java.lang.Long orderId
protected CommandContext processingContext
protected TypedProperty reqProp
protected TypedProperty rspProp
protected java.util.Vector[] appItems
protected java.util.Hashtable returnTable
Constructor Detail |
public CalculateDiscountAmtCmdImpl()
Method Detail |
public void reset()
public boolean checkParentCatEntryIds(java.lang.Long oiCatEntryId, java.lang.Long walletCatEntryId) throws ECSystemException
public java.util.Vector[] getAppItems()
public static final java.lang.String getIClassName()
public java.lang.Long getOrderId()
public CommandContext getProcessingContext()
public TypedProperty getReqProp()
public TypedProperty getResponseProperties()
public java.util.Hashtable getReturnTable()
public TypedProperty getRspProp()
public boolean isReadyToCallExecute()
public void performExecute() throws ECException
First the orderItems for a order are found out and for each cpwalletId, corresponding promoId is found out from the CouponWalletAccessBean. The corresponding calcodeId are found out from PromoDiscAccessBean by using the obtained promoId. A mapping is computed between OrderItemAccessBean (corresponding to the items qualified for this cpwalletId) and the Categorized MonetaryAmount(Set to zero). The task command CalculationCodeCalculate command with usage type as eCoupons and the mapping created above are called and the discount amounts are stored in TempCouponItemMapAccessBean. These above steps are performed for each cpwalletId.
public void setAppItems(java.util.Vector[] newAppItems)
public void setBcIds(java.lang.Long[] paramBcIds)
public void setOrderId(java.lang.Long newOrderId)
public void setProcessingContext(CommandContext newProcessingContext)
public void setReqProp(TypedProperty newReqProp)
public void setRequestProperties(TypedProperty paramReqProp)
public void setReturnTable(java.util.Hashtable newReturnTable)
public void setRspProp(TypedProperty newRspProp)
(C) Copyright IBM Corporation 1996, 2005. All Rights Reserved.