com.ibm.commerce.returns.commands
Class ReturnPrepareCmdImpl
- java.lang.Object
-
- com.ibm.websphere.command.TargetableCommandImpl
-
- com.ibm.websphere.command.CacheableCommandImpl
-
- com.ibm.commerce.command.MeasuredCacheableCommandImpl
-
- com.ibm.commerce.command.AbstractECTargetableCommand
-
- com.ibm.commerce.command.ControllerCommandImpl
-
- com.ibm.commerce.returns.commands.ReturnBaseCmdImpl
-
- com.ibm.commerce.returns.commands.ReturnPrepareCmdImpl
-
- All Implemented Interfaces:
- AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, ReturnPrepareCmd, Protectable, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable
public class ReturnPrepareCmdImpl extends ReturnBaseCmdImpl implements ReturnPrepareCmd
Adds terms and conditions to a return merchandise authorization (RMA) prior to agreement. Terms include taxes, warehouse to which customer must return required merchandise, and payment vehicle to be used for any agreed upon credit.
Parameters
RMAId
(mandatory)- The Id of the RMA for which to create final terms.
- RMAComment (optional)
- The textual additions to the RMA.
- URL (mandatory)
- The URL to which to redirect.
Behaviour
- Checks to see if the RMA exists. If not, ECApplicationException is thrown with the message _ERR_RMA_IN_INVALID_STATE_FOR_COMMAND.
- Checks to see if a trading id is specified in the RMA. If not, ECApplicationException is thrown with message _ERR_BAD_MISSING_CMD_PARAMETER.
- Calls the RefreshExpiredRMAItemsCmd task command to determine if the
RMAGOODFOR
time frame has expired for each RMA item. The credit calculation and automatic approval are called again for those items that have exceeded the 'good for' time. - Calls CalculateReturnAdjustmentPolicyCmd task command to calculate RMA level charges or credits specified by policy.
- Calls the CalculateReturnTaxCmd task command to calculate taxes.
- Calculates all totals; that is, the total credit in the RMA and the total credit in the return.
- If the total credit for the RMA is greater than zero, then calls the DetermineReturnCreditVehicleCmd task command to determine how to credit the customer. And sets the value in the Return. If the task command does not resolve a credit method, then ECSystemException is thrown with message _ERR_CANNOT_DETERMINE_CREDIT_VEHICLE.
- If any RMA item components are marked to be received, calls the ResolveReturnFulfillmentCenterCmd task command to determine a return fulfillment center for the Return. And sets the value in the Return. Otherwise, sets RMA.Ffmctr_id to null. If the task command does not resolve a return fulfillment center, ECSystemException is thrown with message _ERR_CANNOT_DETERMINE_RETURN_FFMCENTER.
- Marks the RMA as prepared (RMA.prepared='Y').
- Calls the ExtendReturnPrepareCmd task command.
- On successful completion, call the specified URL.
Utilizes these access beans
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.ibm.commerce.returns.commands.ReturnPrepareCmd
defaultCommandClassName, NAME
-
-
Constructor Summary
Constructors Constructor and Description ReturnPrepareCmdImpl()
ReturnPrepareCmdImpl constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description AccessVector
getResources()
Gets the vector of resources accessed by this command.MonetaryAmount
getRMATotalCredit()
getRMATotalCreditvoid
performExecute()
Execute the command.void
reset()
Reset the command.void
validateParameters()
Check mandatory parameters.-
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setRequestProperties, setResponseProperties, setRetriable, setViewInputProperties
-
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
-
Methods inherited from class com.ibm.websphere.command.CacheableCommandImpl
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
-
Methods inherited from class com.ibm.websphere.command.TargetableCommandImpl
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ibm.commerce.command.ControllerCommand
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRequestProperties, setRetriable, setViewInputProperties
-
Methods inherited from interface com.ibm.websphere.command.CacheableCommand
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
-
Methods inherited from interface com.ibm.websphere.command.TargetableCommand
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
-
Methods inherited from interface com.ibm.commerce.command.AccCommand
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
-
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
-
Methods inherited from interface com.ibm.commerce.security.Protectable
fulfills, getOwner
-
-
-
-
Constructor Detail
-
ReturnPrepareCmdImpl
public ReturnPrepareCmdImpl()
ReturnPrepareCmdImpl constructor.
-
-
Method Detail
-
getResources
public AccessVector getResources() throws ECException
Gets the vector of resources accessed by this command.- Specified by:
getResources
in interfaceECCommand
- Overrides:
getResources
in classAbstractECTargetableCommand
- Returns:
- AccessVector - a vector of resource action pairs
- Throws:
ECException
-
performExecute
public void performExecute() throws ECException
Execute the command.- Specified by:
performExecute
in interfaceECCommand
- Specified by:
performExecute
in interfacecom.ibm.websphere.command.TargetableCommand
- Overrides:
performExecute
in classAbstractECTargetableCommand
- Throws:
ECException
-
reset
public void reset()
Reset the command.- Specified by:
reset
in interfacecom.ibm.websphere.command.Command
- Overrides:
reset
in classAbstractECTargetableCommand
-
validateParameters
public void validateParameters() throws ECException
Check mandatory parameters. Checks the following parameters:Parameters
- RMA.status
- the status of the RMA must be in process or in edit state
- URL
- URL to redirect on completion of the command
- TradingId
- the trading id for the RMA
- Specified by:
validateParameters
in interfaceECCommand
- Overrides:
validateParameters
in classAbstractECTargetableCommand
- Throws:
ECApplicationException
- If the RMA.status is not in the right state, throws com.ibm.commerce.exception.ECApplicationException with ECMessage.ECMessage._ERR_RMA_IN_INVALID_STATE_FOR_COMMANDECApplicationException
- If there is no TradingId or if the comment is greater than 254 characters or if no URL has been specified, throws com.ibm.commerce.exception.ECApplicationException with ECMessage._ERR_BAD_MISSING_CMD_PARAMETERECException
- RMA.status
-
getRMATotalCredit
public MonetaryAmount getRMATotalCredit()
getRMATotalCredit- Specified by:
getRMATotalCredit
in interfaceReturnPrepareCmd
- Returns:
- MonetaryAmount RMATotalCredit
-
-