com.ibm.commerce.fulfillment.commands

Class AllocateExistingInventoryCmdImpl

    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AllocateExistingInventoryCmdImpl

        public AllocateExistingInventoryCmdImpl()
    • Method Detail

      • getFulfillmentCenters

        public java.util.Vector getFulfillmentCenters()
        Deprecated. This method will be changed to protected.
        Gets a prioritized list of fulfillment centers from which the inventory should be allocated.
        Returns:
        a prioritized list of fulfillment center identifiers (Vector of Integer).
      • getNextStrategy

        public java.lang.Integer getNextStrategy()
        Gets the next allocation strategy set by the command. A changed strategy indicates to the caller that if the allocation performed by this task command is unacceptable to the caller. The caller can call this task command again (after reversing the unacceptable allocation) to achieve a more acceptable allocation.
        Specified by:
        getNextStrategy in interface AllocateExistingInventoryCmd
        Returns:
        the next strategy.
      • getOrderItem

        public OrderItemAccessBean getOrderItem()
        Deprecated. This method will be changed to protected.
        Gets the order item for which existing inventory is to be allocated.
        Returns:
        the order item.
      • getStrategy

        public java.lang.Integer getStrategy()
        Deprecated. This method will be changed to protected. External callers should use getNextStrategy().
        Gets the allocation strategy set by the caller.
        Returns:
        the allocation strategy.
      • performExecute

        public void performExecute()
                            throws ECException
        Performs the actual business logic of the command.

        Behaviour
        1. Set next strategy to input strategy.
        2. If the order item is suitable for allocation (that is, its inventory status attribute specifies unallocated or backordered). And there is sufficient existing inventory at one of the specified fulfillment centers to completely allocate the quantity needed by the order item. The fulfillment centers can be searched in order from first to last in the input fulfillment centers. Then allocate it. Now, 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. This is to partially or fully allocate the quantity needed by the order item. And the fulfillment centers are searched in order from first to last in the list of input fulfillment centers. Then allocate that amount. Now, update the order item to reflect the allocation. When the amount cannot be allocated fully, the amount allocated is rounded down to the nearest multiple of a floating point number. This is obtained by converting the CatEntShip.QuantityMultiple for the CatEntry of the order item to the unit of measure. This is specified by BaseItem and divided by BaseItem.QuantityMultiple. This multiple is then 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. That is, 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.

        This default implementation of the AllocateExistingInventory task command calls the getitems database stored procedure.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException
      • reset

        public void reset()
        This method should be called after a command has been executed to reset its instance variables.
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand
      • 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
        Parameters:
        newFulfillmentCenters - a prioritized list of fulfillment center identifiers (Vector of Integer).
      • setNextStrategy

        public void setNextStrategy(java.lang.Integer newNextStrategy)
        Deprecated. This method will be changed to protected.
        Sets the next allocation strategy.
        Parameters:
        newNextStrategy - the next allocation strategy.
      • setStrategy

        public void setStrategy(java.lang.Integer newStrategy)
        Sets the allocation strategy to be used. Zero must be an acceptable value. The caller can specify zero, or a value returned by the getStrategy method after a previous execution of this task command.
        Specified by:
        setStrategy in interface AllocateExistingInventoryCmd
        Parameters:
        newStrategy - the strategy to be used.