atg.commerce.fulfillment
Class HardgoodFulfiller

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.messaging.SourceSinkTemplate
              extended by atg.commerce.fulfillment.FulfillerSystem
                  extended by atg.commerce.fulfillment.HardgoodFulfiller
All Implemented Interfaces:
MessageSink, MessageSource, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class HardgoodFulfiller
extends FulfillerSystem

This class is responsible for fulfilling order fragments. It receives FulfillOrderFragment messages and allocates all the items within each shipping group contained in the message using the InventoryManager. It sends ModifyOrderNotification messages reflecting all the changes that are made during this process. This class may be extended to customize the fulfillment process.

For each item in each shipping group, the HardgoodFulfiller will use the InventoryManager and either purchase the item, backorder it, preordered it, or mark it as out of stock. When the item's stock is increased and an UpdateInventory message is sent, the HardgoodFulfiller will try again to successfully purchase the item.

It receives the messages FulfillOrderFragment, ModifyOrder, ModifyOrderNotification, and UpdateInventory

It sends ModifyOrderNotification messages.

See Also:
FulfillOrderFragment, ModifyOrder, ModifyOrderNotification, UpdateInventory, InventoryManager

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String DEFAULT_CATALOG_REF_DISPLAY_NAME
           
static java.lang.String DEFAULT_COMMERCE_ITEM_CATALOG_REF_ID_PROPERTY_NAME
           
static java.lang.String DEFAULT_MODIFY_ORDER_NOTIFICATION_PORT
           
static java.lang.String DEFAULT_SHIP_ITEM_REL_ORDER_PROPERTY_NAME
           
static java.lang.String DEFAULT_SHIP_ITEM_REL_SHIPPING_GROUP_PROPERTY_NAME
           
static java.lang.String DEFAULT_SHIP_ITEM_REL_VIEW_NAME
           
static java.lang.String DEFAULT_SHIPPING_GROUP_SUBMITTED_DATE_PROPERTY_NAME
           
static java.lang.String DEFUALT_SHIP_ITEM_REL_COMMERCE_ITEM_PROPERTY_NAME
           
static java.lang.String DEFUALT_SHIP_ITEM_REL_STATE_PROPERTY_NAME
           
 
Fields inherited from class atg.commerce.fulfillment.FulfillerSystem
mModifyOrderPort, NUCLEUS_NAME
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
HardgoodFulfiller()
           
 
Method Summary
protected  boolean allocateItemQuantityFromInventory(Order pOrder, ShippingGroupCommerceItemRelationship pShippingGroupItemRelationship, long pQuantity, java.util.List pModificationList)
          Deprecated. Replaced by the pipeline processor
protected  boolean allocateShippingGroup(Order pOrder, ShippingGroup pShippingGroup, java.util.List pModificationList)
          Deprecated. Replaced by the pipeline processor
protected  boolean allocateShippingGroupItem(Order pOrder, ShippingGroupCommerceItemRelationship pShipItemRelationship, java.util.List pModificationList)
          Deprecated. Replaced by the pipeline processor
 java.lang.String getCatalogRefDisplayNamePropertyName()
          The name of the property of the catalog ref (sku) to get the items display name
 java.util.Properties getChainToRunMap()
           
 java.lang.String getCommerceItemCatalogRefIdPropertyName()
          The name of the catalog ref id property in a CommerceItem
 java.lang.String getFulfillerName()
          This is the name of this fulfiller.
 HardgoodShipper getHardgoodShipper()
          The hardgood shipper is a schedulable service that simulates the periodic shipment of shipping groups.
 InventoryManager getInventoryManager()
          The InventoryManager is used to allocate items for shipment.
 java.io.Serializable getKeyForMessage(javax.jms.ObjectMessage oMessage)
          This method will return the key to be used for locking out other messages with the same key while a thread is handling this message.
 ModificationHandler getModificationHandler()
          The ModificationHandler handles all processing associated with ModifyOrderNotification and ModifyOrder messages that are received by HardgoodFulfiller.
protected  java.io.Serializable getOrderIdFromMessage(FulfillOrderFragment cMessage)
          This is called only for the FulfillOrderFragment messages
 java.lang.String getPartialShipPropertyName()
          The profile's attribute name which represents a Boolean object containing the information on whether the profile allows for partial shipments or not.
 java.lang.String getShipItemRelCommerceItemPropertyName()
          The name of the commerce item property name in a ShippingGroupCommerceItemRelationship
 java.lang.String getShipItemRelOrderPropertyName()
          The name of the order property in a ShippingGroupCommerceItemRelationship
 java.lang.String getShipItemRelShippingGroupPropertyName()
          The name of the shipping group property in a ShippingGroupCommerceItemRelationship
 java.lang.String getShipItemRelStatePropertyName()
          The name of the state property in a ShippingGroupCommerceItemRelationship
 java.lang.String getShipItemRelViewName()
          The name of the view in the order repository for ShipItemRels.
 java.lang.String getShippingGroupSubmittedDatePropertyName()
          The name of the submitted date property in the shipping group
 void handleFulfillOrderFragment(java.lang.String pPortName, javax.jms.ObjectMessage pMessage)
           This method is called to handle all messages of type FulfillOrderFragment.
protected  boolean handleMessage(java.lang.String pPortName, javax.jms.ObjectMessage pMessage)
           This is called to handle a newly received message.
 void handleUpdateInventory(java.lang.String pPortName, javax.jms.ObjectMessage pMessage)
           This method is called to handle all messages of type UpdateInventory.
 boolean isAllowPartialShipmentDefault()
          This property is consulted when the shipping group's special instructions doesn't have a field indicating whether a shipping group should be split on partial shipment.
 boolean isOutOfStockIsError()
          If this is true, an OUT_OF_STOCK item is considered an error resulting in the ShippingGroup being set to PENDING_MERCHANT_ACTION.
 Order loadOrder(java.lang.String pId)
          This method will return the Order from the order repository with the given id.
 boolean processMultipleShippingGroups(Order pOrder, java.lang.String[] pShippingGroupIds, java.util.List pPerformedModifications)
          This method will process each shipping group in the given array.
protected  void processShippingGroup(Order pOrder, ShippingGroup pShippingGroup, java.util.List pModificationList)
          Deprecated. Replaced by the pipeline processor
 java.util.HashMap retrieveWaitingShipMap(java.lang.String[] pCatalogRefIds)
          Returns a HashMap where the keys are the order ids and the values are a Set of shipping group ids of the shipping groups who have items that were on preorder and are contained in the pCatalogRefIds that are passed in.
 void setAllowPartialShipmentDefault(boolean pAllowPartialShipmentDefault)
           
 void setCatalogRefDisplayNamePropertyName(java.lang.String pCatalogRefDisplayNamePropertyName)
           
 void setChainToRunMap(java.util.Properties pChainToRunMap)
           
 void setCommerceItemCatalogRefIdPropertyName(java.lang.String pCommerceItemCatalogRefIdPropertyName)
           
 void setFulfillerName(java.lang.String pFulfillerName)
           
 void setHardgoodShipper(HardgoodShipper pHardgoodShipper)
           
 void setInventoryManager(InventoryManager pInventoryManager)
           
 void setModificationHandler(ModificationHandler pModificationHandler)
           
 void setOutOfStockIsError(boolean pOutOfStockIsError)
           
 void setPartialShipPropertyName(java.lang.String pPartialShipPropertyName)
           
 void setShipItemRelCommerceItemPropertyName(java.lang.String pShipItemRelCommerceItemPropertyName)
           
 void setShipItemRelOrderPropertyName(java.lang.String pShipItemRelOrderPropertyName)
           
 void setShipItemRelShippingGroupPropertyName(java.lang.String pShipItemRelShippingGroupPropertyName)
           
 void setShipItemRelStatePropertyName(java.lang.String pShipItemRelStatePropertyName)
           
 void setShipItemRelViewName(java.lang.String pShipItemRelViewName)
           
 void setShippedDate(ShippingGroup pShippingGroup, java.util.Date pShipDate, java.util.List pModificationList)
          This method sets the date when the shipping group shipped to the given time.
 void setShippingGroupSubmittedDatePropertyName(java.lang.String pShippingGroupSubmittedDatePropertyName)
           
protected  boolean shipAsItemsAreAvailable(ShippingGroup sg)
          Deprecated. Replaced by the pipeline processor
 boolean shippingGroupHasShipped(Order pOrder, java.lang.String pShippingGroupId, Modification pModification, java.util.List pPerformedModifications)
          This method updates the states of all the items and the shipping group itself to reflect that the shipping group has shipped.
 boolean shippingGroupHasShipped(java.lang.String pOrderId, java.lang.String pShippingGroupId)
          This method can be called in three ways.
 void updateOrder(Order pOrder)
          This method will save the order passed in to the repository that is being used.
protected  void verifyShippingGroupFulfillment(ShippingGroup pShippingGroup)
          Deprecated. Replaced by the pipeline processor
 
Methods inherited from class atg.commerce.fulfillment.FulfillerSystem
doStartService, getClientLockManager, getCommerceItemStates, getFulfillmentPipelineManager, getLookUpOrderIdFromMessage, getLookUpOrderIdFromOrder, getModifyOrderNotificationPort, getModifyOrderPort, getOrderFulfillmentTools, getOrderManager, getOrderStates, getPaymentGroupStates, getPaymentManager, getShipItemRelationshipStates, getShippingGroupStates, handleNewMessageType, receiveMessage, setClientLockManager, setCommerceItemStates, setFulfillmentPipelineManager, setLookUpOrderIdFromMessage, setLookUpOrderIdFromOrder, setModifyOrderNotificationPort, setModifyOrderPort, setOrderFulfillmentTools, setOrderManager, setOrderStates, setPaymentGroupStates, setPaymentManager, setShipItemRelationshipStates, setShippingGroupStates
 
Methods inherited from class atg.commerce.messaging.SourceSinkTemplate
getDelayOnSendRetry, getMessageSourceContext, getMessageSourceName, getTransactionManager, isAllowMessageSending, sendCommerceMessage, sendObjectMessage, setAllowMessageSending, setDelayOnSendRetry, setMessageSourceContext, setMessageSourceName, setTransactionManager, startMessageSource, stopMessageSource
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

DEFAULT_MODIFY_ORDER_NOTIFICATION_PORT

public static final java.lang.String DEFAULT_MODIFY_ORDER_NOTIFICATION_PORT
See Also:
Constant Field Values

DEFAULT_SHIP_ITEM_REL_ORDER_PROPERTY_NAME

public static final java.lang.String DEFAULT_SHIP_ITEM_REL_ORDER_PROPERTY_NAME
See Also:
Constant Field Values

DEFAULT_SHIP_ITEM_REL_SHIPPING_GROUP_PROPERTY_NAME

public static final java.lang.String DEFAULT_SHIP_ITEM_REL_SHIPPING_GROUP_PROPERTY_NAME
See Also:
Constant Field Values

DEFUALT_SHIP_ITEM_REL_COMMERCE_ITEM_PROPERTY_NAME

public static final java.lang.String DEFUALT_SHIP_ITEM_REL_COMMERCE_ITEM_PROPERTY_NAME
See Also:
Constant Field Values

DEFUALT_SHIP_ITEM_REL_STATE_PROPERTY_NAME

public static final java.lang.String DEFUALT_SHIP_ITEM_REL_STATE_PROPERTY_NAME
See Also:
Constant Field Values

DEFAULT_SHIPPING_GROUP_SUBMITTED_DATE_PROPERTY_NAME

public static final java.lang.String DEFAULT_SHIPPING_GROUP_SUBMITTED_DATE_PROPERTY_NAME
See Also:
Constant Field Values

DEFAULT_COMMERCE_ITEM_CATALOG_REF_ID_PROPERTY_NAME

public static final java.lang.String DEFAULT_COMMERCE_ITEM_CATALOG_REF_ID_PROPERTY_NAME
See Also:
Constant Field Values

DEFAULT_CATALOG_REF_DISPLAY_NAME

public static final java.lang.String DEFAULT_CATALOG_REF_DISPLAY_NAME
See Also:
Constant Field Values

DEFAULT_SHIP_ITEM_REL_VIEW_NAME

public static final java.lang.String DEFAULT_SHIP_ITEM_REL_VIEW_NAME
See Also:
Constant Field Values
Constructor Detail

HardgoodFulfiller

public HardgoodFulfiller()
Method Detail

setOutOfStockIsError

public void setOutOfStockIsError(boolean pOutOfStockIsError)

isOutOfStockIsError

public boolean isOutOfStockIsError()
If this is true, an OUT_OF_STOCK item is considered an error resulting in the ShippingGroup being set to PENDING_MERCHANT_ACTION. If this is false, OUT_OF_STOCK is treated similarly to BACK_ORDERED or PRE_ORDERED. By default, this property is false.


setAllowPartialShipmentDefault

public void setAllowPartialShipmentDefault(boolean pAllowPartialShipmentDefault)

isAllowPartialShipmentDefault

public boolean isAllowPartialShipmentDefault()
This property is consulted when the shipping group's special instructions doesn't have a field indicating whether a shipping group should be split on partial shipment.


setPartialShipPropertyName

public void setPartialShipPropertyName(java.lang.String pPartialShipPropertyName)

getPartialShipPropertyName

public java.lang.String getPartialShipPropertyName()
The profile's attribute name which represents a Boolean object containing the information on whether the profile allows for partial shipments or not.


setModificationHandler

public void setModificationHandler(ModificationHandler pModificationHandler)

getModificationHandler

public ModificationHandler getModificationHandler()
The ModificationHandler handles all processing associated with ModifyOrderNotification and ModifyOrder messages that are received by HardgoodFulfiller.

See Also:
HardgoodFulfillerModificationHandler, ModifyOrderNotificiation, ModifyOrder

setInventoryManager

public void setInventoryManager(InventoryManager pInventoryManager)

getInventoryManager

public InventoryManager getInventoryManager()
The InventoryManager is used to allocate items for shipment. It is the interface that tells the fulfillment system if an item is available or not.

See Also:
InventoryManager

setHardgoodShipper

public void setHardgoodShipper(HardgoodShipper pHardgoodShipper)

getHardgoodShipper

public HardgoodShipper getHardgoodShipper()
The hardgood shipper is a schedulable service that simulates the periodic shipment of shipping groups.

See Also:
HardgoodShipper

setFulfillerName

public void setFulfillerName(java.lang.String pFulfillerName)

getFulfillerName

public java.lang.String getFulfillerName()
This is the name of this fulfiller. It should match the name used when defining the fulfiller to fulfiller port mapping.


setShipItemRelOrderPropertyName

public void setShipItemRelOrderPropertyName(java.lang.String pShipItemRelOrderPropertyName)

getShipItemRelOrderPropertyName

public java.lang.String getShipItemRelOrderPropertyName()
The name of the order property in a ShippingGroupCommerceItemRelationship


setShipItemRelShippingGroupPropertyName

public void setShipItemRelShippingGroupPropertyName(java.lang.String pShipItemRelShippingGroupPropertyName)

getShipItemRelShippingGroupPropertyName

public java.lang.String getShipItemRelShippingGroupPropertyName()
The name of the shipping group property in a ShippingGroupCommerceItemRelationship


setShipItemRelCommerceItemPropertyName

public void setShipItemRelCommerceItemPropertyName(java.lang.String pShipItemRelCommerceItemPropertyName)

getShipItemRelCommerceItemPropertyName

public java.lang.String getShipItemRelCommerceItemPropertyName()
The name of the commerce item property name in a ShippingGroupCommerceItemRelationship


setShipItemRelStatePropertyName

public void setShipItemRelStatePropertyName(java.lang.String pShipItemRelStatePropertyName)

getShipItemRelStatePropertyName

public java.lang.String getShipItemRelStatePropertyName()
The name of the state property in a ShippingGroupCommerceItemRelationship


setShippingGroupSubmittedDatePropertyName

public void setShippingGroupSubmittedDatePropertyName(java.lang.String pShippingGroupSubmittedDatePropertyName)

getShippingGroupSubmittedDatePropertyName

public java.lang.String getShippingGroupSubmittedDatePropertyName()
The name of the submitted date property in the shipping group


setCommerceItemCatalogRefIdPropertyName

public void setCommerceItemCatalogRefIdPropertyName(java.lang.String pCommerceItemCatalogRefIdPropertyName)

getCommerceItemCatalogRefIdPropertyName

public java.lang.String getCommerceItemCatalogRefIdPropertyName()
The name of the catalog ref id property in a CommerceItem


setCatalogRefDisplayNamePropertyName

public void setCatalogRefDisplayNamePropertyName(java.lang.String pCatalogRefDisplayNamePropertyName)

getCatalogRefDisplayNamePropertyName

public java.lang.String getCatalogRefDisplayNamePropertyName()
The name of the property of the catalog ref (sku) to get the items display name


setShipItemRelViewName

public void setShipItemRelViewName(java.lang.String pShipItemRelViewName)

getShipItemRelViewName

public java.lang.String getShipItemRelViewName()
The name of the view in the order repository for ShipItemRels.


getChainToRunMap

public java.util.Properties getChainToRunMap()

setChainToRunMap

public void setChainToRunMap(java.util.Properties pChainToRunMap)

handleMessage

protected boolean handleMessage(java.lang.String pPortName,
                                javax.jms.ObjectMessage pMessage)
                         throws javax.jms.JMSException

This is called to handle a newly received message. Before this method is called, the message is subjected to basic validity checks, a transaction is established, and an exclusive lock is acquired for the message's key.

HardgoodFulfiller handles the following types of messages:

HardgoodFulfiller can be extended to handle extra types of messages by overriding the handleNewMessageType method.

Overrides:
handleMessage in class FulfillerSystem
Parameters:
pPortName - - the port on which this message was received
pMessage - - the message that was sent on the port
Throws:
javax.jms.JMSException
See Also:
FulfillOrderFragment, handleFulfillOrderFragment(java.lang.String, javax.jms.ObjectMessage), ModifyOrder, HardgoodFulfillerModificationHandler.handleModifyOrder(java.lang.String, javax.jms.ObjectMessage), ModifyOrderNotification, HardgoodFulfillerModificationHandler.handleModifyOrderNotification(java.lang.String, javax.jms.ObjectMessage), UpdateInventory, handleUpdateInventory(java.lang.String, javax.jms.ObjectMessage), FulfillerSystem#receive, FulfillerSystem.handleNewMessageType(java.lang.String, javax.jms.ObjectMessage)

getKeyForMessage

public java.io.Serializable getKeyForMessage(javax.jms.ObjectMessage oMessage)
                                      throws javax.jms.JMSException
This method will return the key to be used for locking out other messages with the same key while a thread is handling this message.

Overrides:
getKeyForMessage in class FulfillerSystem
Parameters:
pMessage - the ObjectMessage containing the CommerceMessage.
Returns:
an Object which serves as the key for the message
Throws:
javax.jms.JMSException

getOrderIdFromMessage

protected java.io.Serializable getOrderIdFromMessage(FulfillOrderFragment cMessage)
This is called only for the FulfillOrderFragment messages

Returns:
an Object which serves as the key for the message

handleFulfillOrderFragment

public void handleFulfillOrderFragment(java.lang.String pPortName,
                                       javax.jms.ObjectMessage pMessage)
                                throws javax.jms.JMSException

This method is called to handle all messages of type FulfillOrderFragment. Should developers wish to change the behavior of the HardgoodFulfiller class in handling a FulfillOrderFragment message this method should be overriden. It will call to the pipeline chain to process the message. The chain first loads the order with loadOrder, then calls processMultipleShippingGroups for each order and its shipping groups in the message. When processing has finished, it calls updateOrder and sends all the changes that were made using OrderFulfillmentTools.sendModifyOrderNotification()

Parameters:
pPortName - The port from which the FulfillOrderFragment was received.
pMessage - The message that was received.
Throws:
javax.jms.JMSException
See Also:
FulfillOrderFragment, updateOrder(atg.commerce.order.Order), processMultipleShippingGroups(atg.commerce.order.Order, java.lang.String[], java.util.List), OrderFulfillmentTools.sendModifyOrderNotification(java.lang.String, java.util.List, atg.commerce.fulfillment.ModifyOrder, atg.commerce.messaging.SourceSinkTemplate, java.lang.String, atg.commerce.fulfillment.ModifyOrderNotification)

handleUpdateInventory

public void handleUpdateInventory(java.lang.String pPortName,
                                  javax.jms.ObjectMessage pMessage)
                           throws javax.jms.JMSException

This method is called to handle all messages of type UpdateInventory. Should developers wish to change the behavior of the HardgoodFulfiller class in handling an UpdateInventory message the method should be overridden. This message gets all the orders waiting on the items contained in the message using retrieveBackorderedShipMap and retrievePreorderedShipMap then loads each order (loadOrder) and calls processShippingGroup for each shipping group "owned" by this fulfiller. Once finished it saves the changes (updateOrder) and send its modifications with OrderFulfillmentTools.sendModifyOrderNotification

Parameters:
pPortName - The port from which this message was received.
pMessage - The message that was received.
Throws:
javax.jms.JMSException
See Also:
UpdateInventory, retrieveWaitingShipMap(java.lang.String[]), loadOrder(java.lang.String), processShippingGroup(atg.commerce.order.Order, atg.commerce.order.ShippingGroup, java.util.List), OrderFulfillmentTools.#sendModifyOrderNotification

processShippingGroup

protected void processShippingGroup(Order pOrder,
                                    ShippingGroup pShippingGroup,
                                    java.util.List pModificationList)
                             throws CommerceException
Deprecated. Replaced by the pipeline processor

This method processes the shipping group by first verifying that it may be changed. (verifyShippingGroupFulfillment) then allocating all of its items (allocateShippingGroup). If everything is successfully allocated then it prepares the group for shipping (queueForShipping). If only some of the items are available it checks if it should shipAsItemsAreAvailable and if so, splits the group into shippable and unshippable items (splitShippingGroupWithAvailableItems) and ships the shippable group.

Parameters:
pOrder - The order containing the shipping group we are processing
pShippingGroup - The shipping group we will try to allocate and ship
pModificationList - List holding any modifications we might make
Throws:
CommerceException
See Also:
verifyShippingGroupFulfillment(atg.commerce.order.ShippingGroup), allocateShippingGroup(atg.commerce.order.Order, atg.commerce.order.ShippingGroup, java.util.List), #queueForShipping, shipAsItemsAreAvailable(atg.commerce.order.ShippingGroup), splitShippingGroupWithAvailableItems(atg.commerce.order.Order, atg.commerce.order.ShippingGroup, java.util.List)

verifyShippingGroupFulfillment

protected void verifyShippingGroupFulfillment(ShippingGroup pShippingGroup)
                                       throws IllegalShippingGroupStateException
Deprecated. Replaced by the pipeline processor

This method verifies that the shipping group to be fulfilled is in a state which allows it to be fulfilled. If the shipping group is in an illegal state we will throw an exception. Illegal states include:

Parameters:
pShippingGroup - The shipping group we are verifying
Throws:
IllegalShippingGroupStateException
See Also:
atg.commerce.states.ShippingGroupStates#REMOVED,, atg.commerce.states.ShippingGroupStates#FAILED,, atg.commerce.states.ShippingGroupStates#NO_PENDING_ACTION,, ShippingGroupStates.PENDING_MERCHANT_ACTION

allocateShippingGroup

protected boolean allocateShippingGroup(Order pOrder,
                                        ShippingGroup pShippingGroup,
                                        java.util.List pModificationList)
Deprecated. Replaced by the pipeline processor

Check all the items in the given ShippingGroup. If all items are PENDING_DELIVERY, then ship the group. Add the modifications to the modification list and return true. If some of the items are not PENDING_DELIVERY, attempt to allocate those items, update the state of the item, add the modification to the list, and return false.

Parameters:
pOrder - The affect Order owning this ShippingGroup
pShippingGroup - The ShippingGroup we are checking
pModificationList - Place to store our changes.
Returns:
True if shippable, false if not.

allocateShippingGroupItem

protected boolean allocateShippingGroupItem(Order pOrder,
                                            ShippingGroupCommerceItemRelationship pShipItemRelationship,
                                            java.util.List pModificationList)
Deprecated. Replaced by the pipeline processor

This method calculates the quantity to allocate from inventory and calls allocateItemQuantityFromInventory

Parameters:
pOrder - the order in which this shipping group is
pShipGroup - the shipping group whose item states we are changing
pModificationList - the list of the modifications made to the items
Returns:
true if the item has been successfully allocated
See Also:
allocateItemQuantityFromInventory(atg.commerce.order.Order, atg.commerce.order.ShippingGroupCommerceItemRelationship, long, java.util.List)

allocateItemQuantityFromInventory

protected boolean allocateItemQuantityFromInventory(Order pOrder,
                                                    ShippingGroupCommerceItemRelationship pShippingGroupItemRelationship,
                                                    long pQuantity,
                                                    java.util.List pModificationList)
                                             throws CommerceException
Deprecated. Replaced by the pipeline processor

Allocates the given item for the given quantity from the InventoryManager. Updates the state of the item accordingly. If the item cannot be purchased, backordered or preordered, the state of the item is FAILED, ITEM_NOT_FOUND, OUT_OF_STOCK, or DISCONTINUED.

Parameters:
pOrder - The order containing this item.
pShippingGroupItemRelationship - The item to allocate
pQuantity - The quantity of the item to allocate. Does not verify that this quantity and the quantity in the item match.
pModificationList - Place to store any modifications that are made.
Returns:
true if the item is allocated, false otherwise
Throws:
CommerceException
See Also:
InventoryManager

shipAsItemsAreAvailable

protected boolean shipAsItemsAreAvailable(ShippingGroup sg)
Deprecated. Replaced by the pipeline processor

Check with the special instructions of the shipping group to see what the behavior should be if only part of the group has been allocated.

Parameters:
pOrder - The order we are interested in
Returns:
true if groups should be split, false otherwise

shippingGroupHasShipped

public boolean shippingGroupHasShipped(java.lang.String pOrderId,
                                       java.lang.String pShippingGroupId)
This method can be called in three ways. This version of the method will grab a lock on the order using the ClientLockManager.

Parameters:
pOrder - The order containing the shipping group
pShippingGroup - The shipping group to ship
Returns:
true if the group was successfully set to NO_PENDING_ACTION, false otherwise
See Also:
HardgoodShipper, ShippingDroplet, ModifyOrder, GenericUpdate

shippingGroupHasShipped

public boolean shippingGroupHasShipped(Order pOrder,
                                       java.lang.String pShippingGroupId,
                                       Modification pModification,
                                       java.util.List pPerformedModifications)
This method updates the states of all the items and the shipping group itself to reflect that the shipping group has shipped. Each ShippingGroupCommerceItemRelationship gets set to DELIVERED, and the shipping group gets set to NO_PENDING_ACTION. It also calls setShippedDate with the given shipping group. If for some reason, the group could not be shipped, this method will return false.

Parameters:
pOrder - The order containing the shipping group
pShippingGroupId - The id of the shipping group to ship
pModification - The modification request this action is in response to
pPerformedModifications - The list to store our performed modifications in
Returns:
true if the group was successfully set to NO_PENDING_ACTION, false otherwise
See Also:
setShippedDate(atg.commerce.order.ShippingGroup, java.util.Date, java.util.List)

processMultipleShippingGroups

public boolean processMultipleShippingGroups(Order pOrder,
                                             java.lang.String[] pShippingGroupIds,
                                             java.util.List pPerformedModifications)
                                      throws CommerceException
This method will process each shipping group in the given array.

Parameters:
pOrder - The order containing the shipping groups.
pShippingGroupIds - The array of shipping group ids to process.
pPerformedModifications - A place to store all new modifications.
Returns:
true if everything processed fine, false otherwise.
Throws:
CommerceException

setShippedDate

public void setShippedDate(ShippingGroup pShippingGroup,
                           java.util.Date pShipDate,
                           java.util.List pModificationList)
This method sets the date when the shipping group shipped to the given time. The property that gets set is actualShipDate

Parameters:
pShippingGroup - The shipping group that shipped.
pShipDate - When the shipping group shipped.
pModificationList - Place to store new modifications.

retrieveWaitingShipMap

public java.util.HashMap retrieveWaitingShipMap(java.lang.String[] pCatalogRefIds)
Returns a HashMap where the keys are the order ids and the values are a Set of shipping group ids of the shipping groups who have items that were on preorder and are contained in the pCatalogRefIds that are passed in.

Parameters:
pCatalogRefIds - - the array of sku ids that have been moved off preorder
Returns:
a hashmap where the keys are the order ids and the values are a Set of shipping group ids.

loadOrder

public Order loadOrder(java.lang.String pId)
                throws CommerceException
This method will return the Order from the order repository with the given id. In the standard implementation this will call the OrderManager and load the order.

Parameters:
pId - the id of the order to be retrieved
Returns:
the order corresponding to the id passed in
Throws:
CommerceException

updateOrder

public void updateOrder(Order pOrder)
                 throws CommerceException
This method will save the order passed in to the repository that is being used.

Parameters:
pOrder - - the order to be saved
Throws:
CommerceException