java.lang.Object | +--CacheableCommandImpl | +--com.ibm.commerce.command.AbstractECTargetableCommand | +--com.ibm.commerce.command.TaskCommandImpl | +--com.ibm.commerce.command.BusinessPolicyCommandImpl | +--com.ibm.commerce.order.calculation.CalculationCmdImpl | +--com.ibm.commerce.order.calculation.CalculationCodeCombineCmdImpl | +--com.ibm.commerce.order.calculation.DiscountCalculationCodeCombineCmdImpl
The default implementation of
CalculationCodeCombineCmd
.
If rule based discount is enabled, its behaviour is as follows:
InvokePersonalizationRuleServiceCommand
to invoke the
discount rule service.Discount
,
DiscountContext
):
Group
)
that contains the following:
MonetaryDiscount
), adds its monetary values to the group by calling
addMonetaryDiscount(Group, MonetaryDiscount)
.
FixedPriceItem
), adds its monetary values to the group by calling
addFixedPriceItem(Group, FixedPriceItem)
.
FreebieItem
), adds its monetary values to the group by calling
addFreebieItem(Group, FreebieItem)
.
ServiceDiscount
), adds the service discount to the custom property
"vecServiceDiscounts" by calling
addServiceDiscount(ServiceDiscount)
.If rule based discount is not enabled, its behaviour is the same as that of
CalculationCodeCombineCmdImpl
.
Commands used:
InvokePersonalizationRuleServiceCommand
CalculationCodeQualifyCmd
OrderItemAccessBean
StoreEntityCalculationUsageAccessBean
CalculationMethodAccessBean
CalculationCodeAccessBean
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT The IBM copyright notice field. |
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.order.calculation. DiscountCalculationCodeCombineCmd |
defaultCommandClassName,
NAME |
Fields inherited from interface com.ibm.commerce.command. ECCommand |
defaultCommandClassName |
Constructor Summary | |
---|---|
DiscountCalculationCodeCombineCmdImpl() Constructor for DiscountCalculationCodeCombineCmdImpl. |
Method Summary | |
---|---|
protected
void |
addFixedPriceItem(
Group aGroup,
FixedPriceItem aFixedPriceItem) Processes the specified
FixedPriceItem and adds the corresponding discount values to the
specified
Group . |
protected
void |
addFreebieItem(
Group aGroup,
FreebieItem aFreebieItem) Processes the specified
FreebieItem and adds the corresponding discount values to the
specified
Group . |
protected
void |
addMonetaryDiscount(
Group aGroup,
MonetaryDiscount aMonetaryDiscount) Processes the specified
MonetaryDiscount and adds the corresponding discount values to the
specified
Group . |
protected
void |
addServiceDiscount(
ServiceDiscount aServiceDiscount) Adds the specified
ServiceDiscount to the custom property
"vecServiceDiscounts" - a Vector of
ServiceDiscounts. |
protected
DiscountContext |
createDiscountContext() Creates the DiscountContext. |
protected
CalculationCodeAccessBean[] |
getCodes(
Item aItem) Returns the calculation codes attached to an item. |
protected
CalculationCodeAccessBean |
getRuleBasedDiscountCode(
Discount aDiscount) Returns the CalculationCodeAccessBean corresponding to
the specified
Discount . |
protected
java.math.BigDecimal[] |
getRunningNetPrices() Returns the running net prices of Items
returned by
CalculationCodeCombineCmdImpl.getItems() . |
protected
void |
invokeRuleService(
DiscountContext aDiscountContext) Invokes the rule service "Discount Service". |
void |
performExecute() The business logic for this command. |
protected
void |
setRunningNetPrices(java.math.BigDecimal[] adRunningNetPrices) Sets the running net prices of Items
returned by
CalculationCodeCombineCmdImpl.getItems() . |
Methods inherited from class com.ibm.commerce.order.calculation. CalculationCodeCombineCmdImpl |
addItem,
callCodeQualify,
createGroupKey,
createGroups,
getDefaultCode,
getDirectlyAttachedCodes,
getGroups,
getIndirectlyAttachedCodes,
getItems,
getTaxCategoryIds,
isDirectAttachmentsOverride,
isRestricted,
processItem,
reset,
setGroups,
setItems,
setTaxCategoryIds,
toString |
Methods inherited from class com.ibm.commerce.order.calculation. CalculationCmdImpl |
createCommand,
getCurrency,
getCustomProperties,
getCustomProperty,
getTimestamp,
getUsageId,
setCurrency,
setCustomProperties,
setCustomProperty,
setTimestamp,
setUsageId |
Methods inherited from class com.ibm.commerce.command. BusinessPolicyCommandImpl |
getPolicyId,
getRequestProperties,
setPolicyId,
setRequestProperties |
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,
isReadyToCallExecute,
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.order.calculation. CalculationCodeCombineCmd |
getGroups,
setItems,
setTaxCategoryIds |
Methods inherited from interface com.ibm.commerce.order.calculation. CalculationCmd |
getCurrency,
getCustomProperties,
getCustomProperty,
getTimestamp,
getUsageId,
setCurrency,
setCustomProperties,
setCustomProperty,
setTimestamp,
setUsageId |
Methods inherited from interface com.ibm.commerce.command. BusinessPolicyCommand |
getPolicyId,
getRequestProperties,
setPolicyId,
setRequestProperties |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
Constructor Detail |
---|
public DiscountCalculationCodeCombineCmdImpl()
Method Detail |
---|
protected java.math.BigDecimal[] getRunningNetPrices()
Items
returned by
CalculationCodeCombineCmdImpl.getItems()
.
protected void setRunningNetPrices(java.math.BigDecimal[] adRunningNetPrices)
Items
returned by
CalculationCodeCombineCmdImpl.getItems()
.
adRunningNetPrices
- the running net
prices.protected void addFixedPriceItem(Group aGroup, FixedPriceItem aFixedPriceItem) throws ECException
FixedPriceItem
and adds the corresponding discount values to the
specified
Group
.
aGroup
- the Group.aFixedPriceItem
- the FixedPriceItem.ECException
protected void addFreebieItem(Group aGroup, FreebieItem aFreebieItem) throws ECException
FreebieItem
and adds the corresponding discount values to the
specified
Group
.
aGroup
- the Group.aFreebieItem
- the FreebieItem.ECException
protected void addMonetaryDiscount(Group aGroup, MonetaryDiscount aMonetaryDiscount) throws ECException
MonetaryDiscount
and adds the corresponding discount values to the
specified
Group
.
aGroup
- the Group.aMonetaryDiscount
- the MonetaryDiscount.ECException
protected void addServiceDiscount(ServiceDiscount aServiceDiscount) throws ECException
ServiceDiscount
to the custom property
"vecServiceDiscounts" - a Vector
of ServiceDiscounts.
aServiceDiscount
- the ServiceDiscount.ECException
CalculationCmd#getCustomProperty()
,
CalculationCmd.setCustomProperty(String,
Object)
protected DiscountContext createDiscountContext()
protected CalculationCodeAccessBean getRuleBasedDiscountCode(Discount aDiscount) throws ECException
CalculationCodeAccessBean
corresponding to the
specified
Discount
.
aDiscount
- the Discount.ECException
protected void invokeRuleService(DiscountContext aDiscountContext) throws ECException
aDiscountContext
- the DiscountContext.ECException
protected CalculationCodeAccessBean[] getCodes(Item aItem) throws ECException
CalculationCodeCombineCmdImpl.processItem(Item)
.
getCodes
in class
CalculationCodeCombineCmdImpl
aItem
- the item.ECException
public void performExecute() throws ECException
AbstractECTargetableCommand
performExecute
in interface
ECCommand
performExecute
in class
CalculationCodeCombineCmdImpl
ECException
ECCommand.performExecute()