com.ibm.commerce.fulfillment.commands
Class GetEligibleFulfillmentCentersCmdImpl

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

public class GetEligibleFulfillmentCentersCmdImpl
extends TaskCommandImpl
implements GetEligibleFulfillmentCentersCmd

For each input item, returns a list of fulfillment centers (ordered in sequence of descending preference from first to last) that could ship that item if there was sufficient inventory.

Behaviour

The default implementation behaves as follows:

For each distinct store, shipping address and shipping mode combination in those input order items in whose fulfillment centers are not overridden in their PREPAREFLAGS attributes:

  1. 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 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 by adding the fulfillment center indicated by each applicable shipping arrangement if it is not already in the list.

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 then 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, removing any fulfillment centers not allowed by the order item's trading agreement.


Field Summary
static java.lang.String COPYRIGHT
           
protected static java.lang.String istrCheckParametersFunc
           
protected static java.lang.String istrPerformFunc
           
protected static java.lang.String istrPrintFulfillmentCentersFunc
           
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.GetEligibleFulfillmentCentersCmd
defaultCommandClassName, NAME
 
Constructor Summary
GetEligibleFulfillmentCentersCmdImpl()
           
 
Method Summary
 java.util.Vector getAllOrderItems()
          Gets all order items to be considered when determining fulfillment centers.
 java.util.Vector getFulfillmentCenters()
          Returns a list of fulfillment centers that could ship an item specified by the setOrderItem method.
 java.util.Hashtable getOrderItemFulfillmentCentersMaps()
          Gets lists of fulfillment centers which can ship items specified by the setOrderItems method.
 java.util.Vector getOrderItems()
          Gets the order items for which eligible fulfillment centers are to be determined.
 java.lang.Integer getPreferredFulfillmentCenterId()
          Gets the fulfillment center preference to ship order items with pending status from.
 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 setAllOrderItems(java.util.Vector newAllOrderItems)
          Sets all order items to be considered when determining fulfillment centers.
 void setOrderItem(Item anOrderItemData)
          Sets the item (with specified catalog entry id) for which eligible fulfillment centers are to be determined.
 void setOrderItemFulfillmentCentersMaps(java.util.Hashtable newOrderItemFulfillmentCentersMaps)
          Sets the lists of fulfillment centers which can ship items specified by the setOrderItems method.
 void setOrderItems(java.util.Vector newOrderItems)
          Sets the item (with specified catalog entry id) for which eligible fulfillment centers are to be determined.
 void setPreferredFulfillmentCenterId(java.lang.Integer newPreferredFulfillmentCenterId)
          Sets the fulfillment center preference to ship order items with pending status from.
 
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

istrCheckParametersFunc

protected static java.lang.String istrCheckParametersFunc

istrPerformFunc

protected static java.lang.String istrPerformFunc

istrPrintFulfillmentCentersFunc

protected static java.lang.String istrPrintFulfillmentCentersFunc

istrThisClass

protected static java.lang.String istrThisClass
Constructor Detail

GetEligibleFulfillmentCentersCmdImpl

public GetEligibleFulfillmentCentersCmdImpl()
Method Detail

getAllOrderItems

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

getFulfillmentCenters

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

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

getOrderItems

public java.util.Vector getOrderItems()
Gets the order items for which eligible fulfillment centers are to be determined.

getPreferredFulfillmentCenterId

public java.lang.Integer getPreferredFulfillmentCenterId()
Gets the fulfillment center preference to ship order items with pending status from.

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

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.
Specified by:
setAllOrderItems in interface GetEligibleFulfillmentCentersCmd

setOrderItem

public void setOrderItem(Item anOrderItemData)
Sets the item (with specified catalog entry id) for which eligible fulfillment centers are to be determined.
Specified by:
setOrderItem in interface GetEligibleFulfillmentCentersCmd

setOrderItemFulfillmentCentersMaps

public void setOrderItemFulfillmentCentersMaps(java.util.Hashtable newOrderItemFulfillmentCentersMaps)
Sets the lists of fulfillment centers which can ship items specified by the setOrderItems method.

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.
Specified by:
setOrderItems in interface GetEligibleFulfillmentCentersCmd

setPreferredFulfillmentCenterId

public void setPreferredFulfillmentCenterId(java.lang.Integer newPreferredFulfillmentCenterId)
Sets the fulfillment center preference to ship order items with pending status from.
Specified by:
setPreferredFulfillmentCenterId in interface GetEligibleFulfillmentCentersCmd