com.ibm.commerce.fulfillment.commands
Class AllocateExistingInventoryCmdImpl

java.lang.Object
  |
  +--com.ibm.commerce.command.AbstractECCommand
        |
        +--com.ibm.commerce.command.TaskCommandImpl
              |
              +--com.ibm.commerce.fulfillment.commands.AllocateExistingInventoryCmdImpl
All Implemented Interfaces:
AllocateExistingInventoryCmd, ECCommand, TaskCommand

public class AllocateExistingInventoryCmdImpl
extends TaskCommandImpl
implements AllocateExistingInventoryCmd

Allocates existing inventory for a particular order item at a particular fulfillment center.

Behaviour

The behaviour of the command is:

  1. Set next strategy to input strategy.
  2. If the order item is suitable for allocation (i.e. its inventory status attribute specifies unallocated or backordered), and there is sufficient existing inventory at one of the specified fulfillment centers (searching in order from first to last in the input fulfillment centers), to completely allocate the quantity needed by the order item, allocate it and update the order item to reflect the allocation.
  3. If the order item is still unallocated or backordered and there is sufficient existing inventory at one of the specified fulfillment centers (searching in order from first to last in the list of input fulfillment centers), to partially or fully allocate the quantity needed by the order item, allocate that amount, rounded down as explained in the next sentence, and update the order item to reflect the allocation. When the amount to allocate cannot be allocated fully, the amount actually allocated is rounded down to the nearest multiple of a floating point number obtained by converting the CatEntShip.QuantityMultiple for the CatEntry of the order item to the unit of measure specified by BaseItem, and divided by BaseItem.QuantityMultiple, and then that multiple is rounded to the nearest integer. When there is no CatEntShip for the order item's CatEntry, CatEntShip.QuantityMultiple is assumed to be 1, and CatEntShip.QuantityMeasure is assumed to be 'C62'. However, when the order item has no CatEntry, the amount to allocate is not rounded down at all (i.e. it is rounded down to the nearest multiple of 1).
  4. If none of the needed quantity can be allocated, the order item is not changed.


    Field Summary
    static java.lang.String COPYRIGHT
               
    protected static java.lang.String istrCheckParametersFunc
               
    protected static java.lang.String istrPerformFunc
               
    protected static java.lang.String istrThisClass
               
     
    Fields inherited from class com.ibm.commerce.command.AbstractECCommand
    commandContext
     
    Fields inherited from interface com.ibm.commerce.fulfillment.commands.AllocateExistingInventoryCmd
    defaultCommandClassName, NAME
     
    Constructor Summary
    AllocateExistingInventoryCmdImpl()
               
     
    Method Summary
     java.util.Vector getFulfillmentCenters()
              Gets a prioritized list of fulfillment centers from which the inventory should be allocated.
     java.lang.Integer getNextStrategy()
              Gets the next allocation strategy set by the command.
     OrderItemAccessBean getOrderItem()
              Gets the order item for which existing inventory is to be allocated.
     java.lang.Integer getStrategy()
              Gets the next allocation strategy set by the command.
     void performExecute()
              Contains the actual business logic of the command.
     void reset()
              This method should be called after a command has been executed to reset its states variables.
     void setFulfillmentCenters(java.util.Vector newFulfillmentCenters)
              Sets a prioritized list of fulfillment centers from which the inventory should be allocated.
     void setNextStrategy(java.lang.Integer newNextStrategy)
              Sets the next allocation strategy.
     void setOrderItem(OrderItemAccessBean newOrderItem)
              Sets the order item for which existing inventory is to be allocated.
     void setStrategy(java.lang.Integer newStrategy)
              Sets allocation strategy to be used.
     void validateParameters()
              Performs server side parameter checking.
     
    Methods inherited from class com.ibm.commerce.command.AbstractECCommand
    accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
     
    Methods inherited from class java.lang.Object
    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface com.ibm.commerce.command.ECCommand
    checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
     

    Field Detail

    COPYRIGHT

    public static final java.lang.String COPYRIGHT

    istrCheckParametersFunc

    protected static java.lang.String istrCheckParametersFunc

    istrPerformFunc

    protected static java.lang.String istrPerformFunc

    istrThisClass

    protected static java.lang.String istrThisClass
    Constructor Detail

    AllocateExistingInventoryCmdImpl

    public AllocateExistingInventoryCmdImpl()
    Method Detail

    getFulfillmentCenters

    public java.util.Vector getFulfillmentCenters()
    Gets a prioritized list of fulfillment centers from which the inventory should be allocated.

    getNextStrategy

    public java.lang.Integer getNextStrategy()
    Gets the next allocation strategy set by the command.
    Specified by:
    getNextStrategy in interface AllocateExistingInventoryCmd

    getOrderItem

    public OrderItemAccessBean getOrderItem()
    Gets the order item for which existing inventory is to be allocated.

    getStrategy

    public java.lang.Integer getStrategy()
    Gets the next allocation strategy set by the command.

    performExecute

    public void performExecute()
                        throws ECException
    Contains the actual business logic of the command.
    Specified by:
    performExecute in interface ECCommand
    Overrides:
    performExecute in class AbstractECCommand
    Following copied from interface: com.ibm.commerce.command.ECCommand
    Throws:
    com.ibm.commerce.command.CommandException - The superclass for all ECExceptions.

    reset

    public void reset()
    This method should be called after a command has been executed to reset its states variables.
    Overrides:
    reset in class AbstractECCommand

    setFulfillmentCenters

    public void setFulfillmentCenters(java.util.Vector newFulfillmentCenters)
    Sets a prioritized list of fulfillment centers from which the inventory should be allocated.
    Specified by:
    setFulfillmentCenters in interface AllocateExistingInventoryCmd

    setNextStrategy

    public void setNextStrategy(java.lang.Integer newNextStrategy)
    Sets the next allocation strategy.

    setOrderItem

    public void setOrderItem(OrderItemAccessBean newOrderItem)
    Sets the order item for which existing inventory is to be allocated.
    Specified by:
    setOrderItem in interface AllocateExistingInventoryCmd

    setStrategy

    public void setStrategy(java.lang.Integer newStrategy)
    Sets allocation strategy to be used. Zero must be an acceptable value.
    Specified by:
    setStrategy in interface AllocateExistingInventoryCmd

    validateParameters

    public void validateParameters()
                            throws ECException
    Performs server side parameter checking.
    Specified by:
    validateParameters in interface ECCommand
    Overrides:
    validateParameters in class AbstractECCommand
    Following copied from interface: com.ibm.commerce.command.ECCommand
    Throws:
    ECException. -