com.ibm.commerce.fulfillment.commands
Class AllocateInventoryCmdImpl

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

public class AllocateInventoryCmdImpl
extends TaskCommandImpl
implements AllocateInventoryCmd

This command can allocate, backorder, and reverse inventory allocations for a list of order items.

Optionally performs some of the following operations for each order item:

  1. Merge, if possible, order items in the same correlation group. (Two order items in the same correlation group were split during a previous call to AllocateInventory command. It is possible to merge two order items if they have the same information except for their quantity and information related to their allocation status, such as estimated shipping date offset.) Before an order item is merged, it is deallocated.
  2. Merge, if possible, specified order items, not necessarily in the same correlation group. Order items can be merged if they have identical values for all columns except for ORDERITEMS_ID, QUANTITY, CORRELATIONGROUP, LASTCREATE, LASTUPDATE, information calculated by PrepareOrder task command (such as SHIPCHARGE, SHIPTAXAMOUNT, TAXAMOUNT, TOTALADJUSTMENT, and TOTALPRODUCT), and information specific to the allocation status, such as estimated availability time.
  3. Check that specified order items can be allocated, either from existing or expected inventory, and obtain a fulfillment center and an estimated availability time and shipping offset.
  4. Allocate specified order items from existing inventory, and obtain a fulfillment center and an estimated shipping offset for each order item. The process of allocating from existing inventory may result in an order item being split into multiple order items. When that happens, the so split order items have the same information (including correlation group) except for their quantity and other information related to their allocation status, such as fulfillment center.
  5. Backorder (allocate from expected inventory) specified order items, and obtain a fulfillment center and an estimated availability time and shipping offset for each order item.
  6. Deallocate specified order items if they are allocated to existing or expected inventory.


    Field Summary
    static java.lang.String COPYRIGHT
               
     
    Fields inherited from class com.ibm.commerce.command.AbstractECCommand
    commandContext
     
    Fields inherited from interface com.ibm.commerce.fulfillment.commands.AllocateInventoryCmd
    defaultCommandClassName, NAME
     
    Constructor Summary
    AllocateInventoryCmdImpl()
               
     
    Method Summary
     java.util.Hashtable getAllocateOrderItems()
              Gets the order items to be allocated from existing inventory.
     java.util.Hashtable getAllOrderItems()
              Gets all order items to be considered when determining fulfillment centers or merging order items.
     java.util.Hashtable getBackorderOrderItems()
              Gets the order items to be backordered (allocated from expected inventory).
     java.util.Hashtable getCheckOrderItems()
              Gets the order items to be checked by the CheckInventoryAvailability task command.
     java.util.Hashtable getMergeOrderItems()
              Gets the order items to be merged, if possible.
     java.util.Hashtable getRemergeOrderItems()
              Gets the order items to be merged, if possible, with other order items with the same correlation group.
     java.util.Hashtable getReverseOrderItems()
              Gets the order items to be deallocated.
     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 setAllocateOrderItems(java.util.Hashtable newAllocateOrderItems)
              Sets the order items to be allocated from existing inventory.
     void setAllOrderItems(java.util.Hashtable newAllOrderItems)
              Sets all order items to be considered when determining fulfillment centers or merging order items.
     void setBackorderOrderItems(java.util.Hashtable newBackorderOrderItems)
              Sets the order items to be backordered (allocated from expected inventory).
     void setCheckOrderItems(java.util.Hashtable newCheckOrderItems)
              Sets the order items to be checked by the CheckInventoryAvailability task command.
     void setMergeOrderItems(java.util.Hashtable newMergeOrderItems)
              Sets the order items to be merged, if possible.
     void setOrderItem(OrderItemAccessBean anOrderItem)
              Set an OrderItem.
     void setOrderItem(OrderItemAccessBean[] orderItems)
              Set a list of OrderItems.
     void setRemergeOrderItems(java.util.Hashtable newRemergeOrderItems)
              Sets the order items to be merged, if possible, with other order items with the same correlation group.
     void setReverseOrderItems(java.util.Hashtable newReverseOrderItems)
              Sets the order items to be deallocated.
     
    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, validateParameters
     
    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, validateParameters
     

    Field Detail

    COPYRIGHT

    public static final java.lang.String COPYRIGHT
    Constructor Detail

    AllocateInventoryCmdImpl

    public AllocateInventoryCmdImpl()
    Method Detail

    getAllocateOrderItems

    public java.util.Hashtable getAllocateOrderItems()
    Gets the order items to be allocated from existing inventory.

    getAllOrderItems

    public java.util.Hashtable getAllOrderItems()
    Gets all order items to be considered when determining fulfillment centers or merging order items.

    getBackorderOrderItems

    public java.util.Hashtable getBackorderOrderItems()
    Gets the order items to be backordered (allocated from expected inventory).

    getCheckOrderItems

    public java.util.Hashtable getCheckOrderItems()
    Gets the order items to be checked by the CheckInventoryAvailability task command.

    getMergeOrderItems

    public java.util.Hashtable getMergeOrderItems()
    Gets the order items to be merged, if possible.

    getRemergeOrderItems

    public java.util.Hashtable getRemergeOrderItems()
    Gets the order items to be merged, if possible, with other order items with the same correlation group.

    getReverseOrderItems

    public java.util.Hashtable getReverseOrderItems()
    Gets the order items to be deallocated.

    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

    setAllocateOrderItems

    public void setAllocateOrderItems(java.util.Hashtable newAllocateOrderItems)
    Sets the order items to be allocated from existing inventory. Fulfillment centers and estimated shipping date offsets will be set for successfully allocated order items.
    Specified by:
    setAllocateOrderItems in interface AllocateInventoryCmd

    setAllOrderItems

    public void setAllOrderItems(java.util.Hashtable newAllOrderItems)
    Sets all order items to be considered when determining fulfillment centers or merging order items. Normally this is all the order items in an order.
    Specified by:
    setAllOrderItems in interface AllocateInventoryCmd

    setBackorderOrderItems

    public void setBackorderOrderItems(java.util.Hashtable newBackorderOrderItems)
    Sets the order items to be backordered (allocated from expected inventory). If an order item appears in both lists of order items set by setAllocateOrderItems and setBackorderOrderItems, then it is backordered only if it cannot be allocated from existing inventory. Fulfillment centers and estimated shipping date offsets will be set for successfully backordered order items.
    Specified by:
    setBackorderOrderItems in interface AllocateInventoryCmd

    setCheckOrderItems

    public void setCheckOrderItems(java.util.Hashtable newCheckOrderItems)
    Sets the order items to be checked by the CheckInventoryAvailability task command. Fulfillment centers and estimated shipping date offsets will be set for those order items that successfully pass the check.
    Specified by:
    setCheckOrderItems in interface AllocateInventoryCmd

    setMergeOrderItems

    public void setMergeOrderItems(java.util.Hashtable newMergeOrderItems)
    Sets the order items to be merged, if possible.
    Specified by:
    setMergeOrderItems in interface AllocateInventoryCmd

    setOrderItem

    public void setOrderItem(OrderItemAccessBean anOrderItem)
    Set an OrderItem.

    setOrderItem

    public void setOrderItem(OrderItemAccessBean[] orderItems)
    Set a list of OrderItems.

    setRemergeOrderItems

    public void setRemergeOrderItems(java.util.Hashtable newRemergeOrderItems)
    Sets the order items to be merged, if possible, with other order items with the same correlation group.
    Specified by:
    setRemergeOrderItems in interface AllocateInventoryCmd

    setReverseOrderItems

    public void setReverseOrderItems(java.util.Hashtable newReverseOrderItems)
    Sets the order items to be deallocated.
    Specified by:
    setReverseOrderItems in interface AllocateInventoryCmd