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.CalculationRuleCalculateCmdImpl
The default implementation of
CalculationRuleCalculateCmd
.
Its behaviour is as follows:
CalculationScaleLookupCmd
) to determine the following:
CalculationRangeCmd
) to calculate the resulting value.Commands used:
Access beans used:OrderItemAccessBean
CalculationMethodAccessBean
CalculationCodeAccessBean
CalculationRuleAccessBean
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. CalculationRuleCalculateCmd |
defaultCommandClassName,
NAME |
Fields inherited from interface com.ibm.commerce.command. ECCommand |
defaultCommandClassName |
Constructor Summary | |
---|---|
CalculationRuleCalculateCmdImpl() Constructor for CalculationRuleCalculateCmdImpl. |
Method Summary | |
---|---|
protected
void |
applyOrderItemLevelParameters(java.math.BigDecimal[] adValues,
DirectAttachmentHelper aDirectAttachmentHelper) Applies the parametrized orderitem level direct attachments (see ORDICALCD) associated with the calculation rule to a list of values. |
protected
void |
applyOrderLevelParameters(java.math.BigDecimal[] adValues,
java.math.BigDecimal[] adWeights,
DirectAttachmentHelper aDirectAttachmentHelper,
java.lang.Long anOrderId) Applies the parametrized order level direct attachments (see ORDCALCD) associated with the calculation rule to a list of values. |
protected
void |
applyParameters(java.math.BigDecimal[] adValues,
java.math.BigDecimal[] adWeights) Applies the parametrized direct attachments associated with the calculation rule to a list of values. |
protected
java.math.BigDecimal |
callRange(CalculationRangeAccessBean aabRange,
CalculationRangeLookupResultAccessBean aabLookupResult,
java.math.BigDecimal adApplicableLookupNumber,
java.math.BigDecimal adApplicableBaseMonetaryValue) Invokes the calculation method of type "CalculationRange" referenced by the calculation range (see CALRANGE.CALMETHOD_ID, CalculationRangeCmd ) to calculate the resulting
value. |
protected
CalculationScaleLookupCmd |
callScaleLookup(CalculationScaleAccessBean aabScale) Invokes the calculation method of type "CalculationScaleLookup" referenced by the calculation scale (see CALSCALE.CALMETHOD_ID, CalculationScaleLookupCmd ) to determine a lookup number, a
base monetary value, a result multiplier and a list of mathematical
weights. |
protected
void |
compareValues() Merges the resulting lists of values of the calculation scales by currency and selects the merged list with the lowest total value. |
protected
Item[] |
getItems() Returns the items. |
protected
CalculationRuleAccessBean |
getRule() Returns the calculation rule. |
protected
java.util.Set |
getScaleCurrencies(CalculationScaleAccessBean[] aabScales) Retrieves the set of currencies referenced by a list of calculation scales. |
java.math.BigDecimal[] |
getValues() Returns the values corresponding to the items. |
protected
java.math.BigDecimal[] |
getValues(java.lang.String astrCurrency) Returns the merged list of values of a currency. |
void |
performExecute() The business logic for this command. |
protected
java.math.BigDecimal[] |
scaleCalculate(CalculationScaleAccessBean aabScale) Calculates the resulting list of values of a calculation scale. |
void |
setItems(
Item[] aItems) Sets the items. |
void |
setRule(CalculationRuleAccessBean aabRule) Sets the calculation rule. |
protected
void |
setValues(java.math.BigDecimal[] adValues) Sets the values. |
protected
void |
setValues(java.lang.String astrCurrency,
java.math.BigDecimal[] adValues) Sets the merged list of values of a currency. |
Methods inherited from class com.ibm.commerce.order.calculation. CalculationCmdImpl |
createCommand,
getCurrency,
getCustomProperties,
getCustomProperty,
getTimestamp,
getUsageId,
reset,
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. 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 CalculationRuleCalculateCmdImpl()
Method Detail |
---|
protected void applyOrderItemLevelParameters(java.math.BigDecimal[] adValues, DirectAttachmentHelper aDirectAttachmentHelper) throws ECException
applyParameters(BigDecimal[], BigDecimal[])
.
adValues
- the values to apply to.aDirectAttachmentHelper
- a DirectAttachmentHelper
instance.ECException
protected void applyOrderLevelParameters(java.math.BigDecimal[] adValues, java.math.BigDecimal[] adWeights, DirectAttachmentHelper aDirectAttachmentHelper, java.lang.Long anOrderId) throws ECException
applyParameters(BigDecimal[], BigDecimal[])
.
adValues
- the values to apply to.adWeights
- the mathematical weights to use when distributing
values.aDirectAttachmentHelper
- a DirectAttachmentHelper
instance.anOrderId
- the order ID.ECException
protected void applyParameters(java.math.BigDecimal[] adValues, java.math.BigDecimal[] adWeights) throws ECException
scaleCalculate(CalculationScaleAccessBean)
.
adValues
- the values to apply to.adWeights
- the mathematical weights to use when distributing
values.ECException
protected java.math.BigDecimal callRange(CalculationRangeAccessBean aabRange, CalculationRangeLookupResultAccessBean aabLookupResult, java.math.BigDecimal adApplicableLookupNumber, java.math.BigDecimal adApplicableBaseMonetaryValue) throws ECException
CalculationRangeCmd
) to calculate the resulting value. This
method is called by
scaleCalculate(CalculationScaleAccessBean)
.
aabRange
- the calculation range.aabLookupResult
- the calculation range lookup result.adApplicableLookupNumber
- the applicable lookup number.adApplicableBaseMonetaryValue
- the applicable base monetary
value.ECException
protected CalculationScaleLookupCmd callScaleLookup(CalculationScaleAccessBean aabScale) throws ECException
CalculationScaleLookupCmd
) to determine a lookup number, a
base monetary value, a result multiplier and a list of mathematical weights.
This method is called by
scaleCalculate(CalculationScaleAccessBean)
.
aabScale
- the calculation scale.ECException
protected void compareValues() throws ECException
performExecute()
.
ECException
protected Item[] getItems()
protected CalculationRuleAccessBean getRule()
protected java.util.Set getScaleCurrencies(CalculationScaleAccessBean[] aabScales) throws ECException
performExecute()
.
aabScales
- the calculation scales.ECException
public java.math.BigDecimal[] getValues()
getValues
in interface
CalculationRuleCalculateCmd
protected java.math.BigDecimal[] getValues(java.lang.String astrCurrency)
astrCurrency
- the currency.public void performExecute() throws ECException
AbstractECTargetableCommand
performExecute
in interface
ECCommand
performExecute
in class
AbstractECTargetableCommand
ECException
ECCommand.performExecute()
protected java.math.BigDecimal[] scaleCalculate(CalculationScaleAccessBean aabScale) throws ECException
performExecute()
.
aabScale
- the calculation scale.ECException
public void setItems(Item[] aItems)
setItems
in interface
CalculationRuleCalculateCmd
aItems
- the items.public void setRule(CalculationRuleAccessBean aabRule)
setRule
in interface
CalculationRuleCalculateCmd
aabRule
- the calculation rule.protected void setValues(java.math.BigDecimal[] adValues)
adValues
- the values.protected void setValues(java.lang.String astrCurrency, java.math.BigDecimal[] adValues)
astrCurrency
- the currency.adValues
- the merged list of values.