com.ibm.commerce.fulfillment.commands

Class GetEligibleFulfillmentCentersCmdImpl

    • Field Detail

      • COPYRIGHT

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

      • GetEligibleFulfillmentCentersCmdImpl

        public GetEligibleFulfillmentCentersCmdImpl()
    • Method Detail

      • getAllOrderItems

        public java.util.Vector getAllOrderItems()
        Deprecated. This method will be changed to protected.
        Gets all order items to be considered when determining fulfillment centers.
        Returns:
        a Vector of Item.
      • getFulfillmentCenters

        public java.util.Vector getFulfillmentCenters()
        Returns a list of fulfillment centers that could ship an item specified by the setOrderItem method.

        This method is used to obtain a list of fulfillment centers for an order item if only one order item has been passed as input. If more than one order item data has been passed as input then getOrderItemFulfillmentCentersMaps should be called instead.
        Specified by:
        getFulfillmentCenters in interface GetEligibleFulfillmentCentersCmd
        Returns:
        a Vector of FulfillmentCenter identifiers (Vector of Integer).
      • getOrderItemFulfillmentCentersMaps

        public java.util.Hashtable getOrderItemFulfillmentCentersMaps()
        Gets lists of fulfillment centers which can ship items specified by the setOrderItems method.

        Specified by:
        getOrderItemFulfillmentCentersMaps in interface GetEligibleFulfillmentCentersCmd
        Returns:
        HashTable:
        • key - (Long) The OrderItem identifier, if known. Otherwise, it is a negative number.
        • value - (Object[2]) Object[0] is the com.ibm.commerce.order.calculation.Item. Object[1] is a Vector of Integer fulfillment center identifiers.
      • getOrderItems

        public java.util.Vector getOrderItems()
        Deprecated. This method will be changed to protected.
        Gets the order items for which eligible fulfillment centers are to be determined.
        Returns:
        a Vector of com.ibm.commerce.order.calculation.Item.
      • getPreferredFulfillmentCenterId

        public java.lang.Integer getPreferredFulfillmentCenterId()
        Deprecated. This method will be changed to protected.
        Gets the preferred fulfillment center.
        Returns:
        Integer the identifier of the preferred fulfillment center.
      • performExecute

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

        Behaviour:

        The default implementation behaves as follows:

        For each distinct store, shipping address and shipping mode combination in those input order items. The fulfillment centers of the order items are not overridden in their PREPAREFLAGS attributes:
        • Determine a list of applicable shipping arrangements, sorted in descending sequence by their precedence attribute. (A shipping arrangement is applicable if its FLAGS attribute indicates it is not restricted. Or, when FLAGS attribute indicates that it is restricted, if the shipping address matches one of the shipping arrangement's associated shipping jurisdiction groups.) In that sequence, build a list of fulfillment centers if it is not already in the list. This is done by adding the fulfillment center indicated by each applicable shipping arrangement .

        The result is a list of eligible fulfillment centers for each distinct shipping address and shipping mode combination.

        For each order item:
        1. If the fulfillment center has been overridden in the PREPAREFLAGS attribute of the order item. Return only that fulfillment center, regardless of the order item's trading agreement.
        2. Otherwise, if the order status of the order item is "B" and the order item already has a fulfillment center, then:
          1. If STORE.FFMCSELECTIONFLAGS specifies preferCurrent. Then if the order item's current fulfillment center is in the list of eligible fulfillment centers for its shipping address and shipping mode combination. Return a copy of the list. But with that fulfillment center moved to the first position, removing any fulfillment centers not allowed by the order item's trading agreement.
          2. If STORE.FFMCSELECTIONFLAGS specifies noChange. Return only that fulfillment center, or an empty list if that fulfillment center is not allowed by the order item's trading agreement.
        3. If the above steps did not determine the result. Return the list of eligible fulfillment centers for the order item's shipping address and shipping mode combination. Then remove any fulfillment centers not allowed by the order item's trading agreement.

        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
      • setAllOrderItems

        public void setAllOrderItems(java.util.Vector newAllOrderItems)
        Sets all order items to be considered when determining fulfillment centers. Normally this is all the order items in an order. If setAllOrderItems is not called, this command behaves as if it was called with the same OrderItems specified by setOrderItem or setOrderItems.
        Specified by:
        setAllOrderItems in interface GetEligibleFulfillmentCentersCmd
        Parameters:
        newAllOrderItems - a Vector of com.ibm.commerce.order.calculation.Item.
      • setOrderItem

        public void setOrderItem(Item anOrderItemData)
        Sets the item (with specified catalog entry id) for which eligible fulfillment centers are to be determined. If both setOrderItem and SetOrderItems are called, only the last call has effect.
        Specified by:
        setOrderItem in interface GetEligibleFulfillmentCentersCmd
        Parameters:
        anOrderItemData - the order item.
      • setOrderItemFulfillmentCentersMaps

        public void setOrderItemFulfillmentCentersMaps(java.util.Hashtable newOrderItemFulfillmentCentersMaps)
        Sets the lists of fulfillment centers which can ship items specified by the setOrderItems method.
        Parameters:
        newOrderItemFulfillmentCentersMaps - Hashtable:
        • key - (Long) The OrderItem identifier, if known. Otherwise, it is a negative number.
        • value - (Object[2]) Object[0] is the com.ibm.commerce.order.calculation.Item. Object[1] is a Vector of Integer fulfillment center identifiers.
      • setOrderItems

        public void setOrderItems(java.util.Vector newOrderItems)
        Sets the item (with specified catalog entry id) for which eligible fulfillment centers are to be determined. If both setOrderItem and SetOrderItems are called, only the last call has effect.
        Specified by:
        setOrderItems in interface GetEligibleFulfillmentCentersCmd
        Parameters:
        newOrderItems - a Vector of Item.
      • setPreferredFulfillmentCenterId

        public void setPreferredFulfillmentCenterId(java.lang.Integer newPreferredFulfillmentCenterId)
        Sets the preferred fulfillment center.
        Specified by:
        setPreferredFulfillmentCenterId in interface GetEligibleFulfillmentCentersCmd
        Parameters:
        newPreferredFulfillmentCenterId - the identifier of the preferred fulfillment center.