Class ReturnItemAddCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, ReturnItemAddCmd, ReturnItemUpdateCmd, Protectable,,,,,,

    public class ReturnItemAddCmdImpl
    extends ReturnItemBaseCmdImpl
    implements ReturnItemAddCmd
    This is the default implementation of the controller command ReturnItemAddCmd interface.

    Input parameters:

    Name Description
    forUser The logon ID of the user on whose behalf the command will be run. Only a person with the authority to process orders can specify this parameter.
    creditAdjustment_i The amount by which to adjust the product credit amount.
    orderItemId_i The OrderItem ID, if available.
    catEntryId_i The catalog entry being returned.
    attrName_i Any distinct attribute defined for the product.
    attrValue_i The value of the product attribute.
    RMAId The identifier of an existing RMA that the return items are to be added to.
    quantity_i The quantity being returned.
    UOM_i The unit of measure for quantity_i.
    comment_i A comment about the item being returned.
    reason_i The reason for the return, as provided by the purchaser.
    URL The URL to be called when the command completes successfully.


    This class adds an item to a return merchandise authorization (RMA). It can be called with a list of order items and catentries. Each will be processed in the following way:
    • If the order item is to be added to RMA then
      • Call the CheckReturnItemInCorrectStateCmd task command to verify that the order item is in a returnable state.
      • Check that currency of the OrderItem is the same as the currency of the RMA.
      • Check that the trading Id of the order item is the same as the trading Id of the RMA.
      • Check that there are returns terms and conditions for this order item.
      • Check that the terms and conditions associated with the trading Id and member Id of the order item. Those are compatible with the terms and conditions associated with the RMA (the same terms and conditions).
      • If catEntryId is specified (a partial kit return) then calls the task command ResolveSkuCmd to resolve the catalog entry ID and item spec ID.
      • If this is a partial kit return then calls task command CalculateReturnItemCreditForCatEntryCmd, otherwise call task command CalculateReturnItemCreditCmd.
      • Adds an item to the RMA and explodes the RMA item into the RMA item components.
    • else if the catEntry is to be added to RMA, then
      • Resolve catEntryId to itemSpecId and add itemSpecId to RMA.
      • The currency of the returned item is set to the currency of the RMA.
      • Call task command CalculateReturnItemCreditForCatEntryCmd to calculate the credit amounts.
    • Call task command AutoApproveReturnItemCmd to see if item is automatically approved. Mark rmaItem as either "system-approved" or "approval pending" depending on result from task command.

    Task commands called:

    See Also:
    ReturnItemBaseCmdImpl, Serialized Form
    • Field Detail


        public static final java.lang.String CLASSNAME
        The name of this class.
    • Constructor Detail

      • ReturnItemAddCmdImpl

        public ReturnItemAddCmdImpl()
        This is the ReturnItemAddCmdImpl constructor.
    • Method Detail

      • getResources

        public AccessVector getResources()
                                  throws ECException
        This method gets the vector of resources accessed by this command.
        Specified by:
        getResources in interface ECCommand
        getResources in class AbstractECTargetableCommand
        The vector of resource action pairs - If a new RMA is being created then return the store access bean; otherwise return the RMA access bean. Also return all order access beans that are used.
      • validateParameters

        public void validateParameters()
                                throws ECException
        This method first calls super.validateParameters. Then it checks whether adding the return item might cause the size of the RMA, as well as the requested quantity, to exceed the defined business threshold. If the check fails, it throws an ECApplicationException.
        Specified by:
        validateParameters in interface ECCommand
        validateParameters in class ReturnItemBaseCmdImpl
        ECException - if a parameter was invalid, or there was an error retrieving data to do the validation.