com.ibm.commerce.order.calculation
Interface CalculationRuleCombineCmd

All Superinterfaces:
BusinessPolicyCommand, CalculationCmd, TaskCommand
All Known Implementing Classes:
CalculationRuleCombineCmdImpl

public interface CalculationRuleCombineCmd
extends CalculationCmd

Given a calculation code and a list of items, this command will determine the calculation rules that are applicable to the items and calculate the values of these calculation rules.

For sales/shipping tax only, the caller has to specify the tax categories that should be active during execution. Normally that would be all sales/shipping tax categories defined in the current store. This command will ignore calculation rules that don't belong to these tax categories.

For more information, refer to the default implementation of this command, CalculationRuleCombineCmdImpl.

This is also the base interface that commands registered as calculation methods of type "CalculationRuleCombine" must extend.

This command is registered as the following bootstrap calculation methods:

Calculation Method ID Calculation Usage ID Name
-5 -1 CalculationRuleCombine (discount)
-25 -2 CalculationRuleCombine (shipping)
-45 -3 CalculationRuleCombine (sales tax)
-65 -4 CalculationRuleCombine (shipping tax)
-5005 -5 CalculationRuleCombine (coupon)

Field Summary
static java.lang.String COPYRIGHT
          The IBM copyright notice field.
static java.lang.String defaultCommandClassName
          The default implementation of this command.
static java.lang.String NAME
          The name of this command.
 
Method Summary
 CalculationRuleAccessBean[] getRules()
          Returns the applicable calculation rules.
 java.math.BigDecimal[] getValues(java.lang.Integer anRuleId)
          Returns the values of a calculation rules corresponding to the items.
 void setCode(CalculationCodeAccessBean aabCode)
          Sets the calculation code.
 void setItems( Item[] aItems)
          Sets the items.
 void setTaxCategoryIds(java.lang.Integer[] anTaxCategoryIds)
          Sets the tax categories that should be active during execution.
 
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
The IBM copyright notice field.
See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
The name of this command.
See Also:
Constant Field Values

defaultCommandClassName

public static final java.lang.String defaultCommandClassName
The default implementation of this command.
See Also:
Constant Field Values
Method Detail

getRules

public CalculationRuleAccessBean[] getRules()
Returns the applicable calculation rules.
Returns:
the applicable calculation rules.

getValues

public java.math.BigDecimal[] getValues(java.lang.Integer anRuleId)
Returns the values of a calculation rules corresponding to the items.
Parameters:
anRuleId - the calculation rule ID.
Returns:
the values of the calculation rules corresponding to the items.

setCode

public void setCode(CalculationCodeAccessBean aabCode)
Sets the calculation code.
Parameters:
aabCode - the calculation code.

setItems

public void setItems(Item[] aItems)
Sets the items.
Parameters:
aItems - the items.

setTaxCategoryIds

public void setTaxCategoryIds(java.lang.Integer[] anTaxCategoryIds)
Sets the tax categories that should be active during execution. Normally that would be all sales/shipping tax categories defined in the current store. For sales/shipping tax only.
Parameters:
anTaxCategoryIds - the tax category IDs.