public class CalculateContractPricesCmdImpl extends com.ibm.commerce.command.TaskCommandImpl implements CalculateContractPricesCmd
CalculateContractPricesCmd Task Command Implementation
retrieves all the qualified contract prices and calculates the price adjustment
specified by the contract for one or more catalog entries.
If the command is successful in retrieving offers, it will return a list of qualified offers. It provides the offer prices which have been adjusted according the corresponding Ts&Cs defined in the trading agreements.
If unsuccessful, it will return an empty list.
Behaviour
Obtain all the qualified offers for each catalog entries. Each offer to be retrieved, to find the price of a catalog entry must satisfy certain criteria.
If no valid offer can be found, the parent product offers will be searched, for providing the catalog entry. And the parent product is not excluded from the trading agreements.
Select the best adjustments for each of the offers. The price adjustments are retrieved from those Ts&Cs which references the price list containing the offer.
Calculate the price adjustments for each of the offers.
This command calls the following TaskCommands:
StoreAccessBeanCatalogEntryShippingAccessBeanTradingAgreementAccessBeanOfferAccessBeanOfferPriceAccessBeanProductSetCeRelAccessBean CatalogEntryAccessBean TermConditionAccessBean PriceTCMasterCatalogWithOptionalAdjustmentAccessBean PriceTCMasterCatalogWithFilteringAccessBean PriceTCPriceListWithOptionalAdjustmentAccessBean PriceTCPriceListWithSelectiveAdjustmentAccessBean | Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
defaultCommandClassName, NAME| Constructor and Description |
|---|
CalculateContractPricesCmdImpl()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
ItemPriceInfo[] |
getItemPriceInfo()
Returns the internal item info structure.
|
void |
performExecute()
Executes main business logic of the command.
|
void |
setCurrency(java.lang.String astrCurrency)
Sets the currency to be used for finding the price (Optional).
|
void |
setErrorMode(boolean aErrorMode)
Sets the flag to indicate if exception will be thrown when the price cannot be found
for the input catentry (Optional).
|
void |
setItemPriceInfo(ItemPriceInfo[] aItemPriceInfo)
Sets the item info structure for internal use on calculating the prices.
|
void |
setMasterCatalogPriceListIds(java.lang.Long[] aMasterpriceListIds)
Sets the ids the price list associated with the Master Catalog (Optional).
|
void |
setPriceListIds(java.lang.Long[] aPriceListIds)
Sets the ids of the input price lists to be used for retrieving the offers.
|
void |
setStoreId(java.lang.Integer aStoreId)
Sets the id of the input store to be used for calculating the price (Optional).
|
void |
setTradingABs(com.ibm.commerce.contract.objects.TradingAgreementAccessBean[] aTradingABs)
Sets the input trading agreement access beans for determining the contract prices.
|
void |
setUseGlobalPriceList(boolean aUseGlobalPriceList)
Sets the flag, to indicate if the list of input price lists can be used
globally, for retrieving the offers for all of the input catentries (Optional).
|
void |
validateParameters()
Checks mandatory parameters.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaccessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultPropertiescheckIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultPropertiespublic static final java.lang.String COPYRIGHT
public CalculateContractPricesCmdImpl()
public ItemPriceInfo[] getItemPriceInfo()
getItemPriceInfo in interface CalculateContractPricesCmdpublic void performExecute()
throws com.ibm.commerce.exception.ECException
performExecute in interface com.ibm.commerce.command.ECCommandperformExecute in class com.ibm.commerce.command.AbstractECTargetableCommandcom.ibm.commerce.exception.ECExceptionpublic void setCurrency(java.lang.String astrCurrency)
setCurrency in interface CalculateContractPricesCmdastrCurrency - a currencypublic void setErrorMode(boolean aErrorMode)
setErrorMode in interface CalculateContractPricesCmdaErrorMode - the exception will be thrown if set true.public void setItemPriceInfo(ItemPriceInfo[] aItemPriceInfo)
setItemPriceInfo in interface CalculateContractPricesCmdaItemPriceInfo - an ItemPriceInfo structure for internal usepublic void setMasterCatalogPriceListIds(java.lang.Long[] aMasterpriceListIds)
setMasterCatalogPriceListIds in interface CalculateContractPricesCmdaMasterpriceListIds - an array of master pricelistspublic void setPriceListIds(java.lang.Long[] aPriceListIds)
setPriceListIds in interface CalculateContractPricesCmdaPriceListIds - an array of pricelist Idspublic void setStoreId(java.lang.Integer aStoreId)
setStoreId in interface CalculateContractPricesCmdaStoreId - the ID of the input storepublic void setTradingABs(com.ibm.commerce.contract.objects.TradingAgreementAccessBean[] aTradingABs)
setTradingABs in interface CalculateContractPricesCmdaTradingABs - a set of Trading agreement access beanspublic void setUseGlobalPriceList(boolean aUseGlobalPriceList)
setUseGlobalPriceList in interface CalculateContractPricesCmdaUseGlobalPriceLIst - a flag used to decide which price lists can be usedpublic void validateParameters()
throws com.ibm.commerce.exception.ECException
validateParameters in interface com.ibm.commerce.command.ECCommandvalidateParameters in class com.ibm.commerce.command.AbstractECTargetableCommandcom.ibm.commerce.exception.ECException