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.InventoryFulfiller
                      extended by atg.commerce.fulfillment.HardgoodFulfiller
All Implemented Interfaces:
MessageSink, MessageSource, atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class HardgoodFulfiller
extends atg.commerce.fulfillment.InventoryFulfiller

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
 
Fields inherited from class atg.commerce.fulfillment.InventoryFulfiller
DEFAULT_CATALOG_REF_DISPLAY_NAME, DEFAULT_COMMERCE_ITEM_CATALOG_REF_ID_PROPERTY_NAME, DEFAULT_MODIFY_ORDER_NOTIFICATION_PORT, DEFAULT_SHIP_ITEM_REL_ORDER_PROPERTY_NAME, DEFAULT_SHIP_ITEM_REL_SHIPPING_GROUP_PROPERTY_NAME, DEFAULT_SHIP_ITEM_REL_VIEW_NAME, DEFAULT_SHIPPING_GROUP_SUBMITTED_DATE_PROPERTY_NAME, DEFUALT_SHIP_ITEM_REL_COMMERCE_ITEM_PROPERTY_NAME, 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
 HardgoodShipper getHardgoodShipper()
          The hardgood shipper is a schedulable service that simulates the periodic shipment of shipping groups.
protected  void processShippingGroup(Order pOrder, ShippingGroup pShippingGroup, java.util.List pModificationList)
          Deprecated. Replaced by the pipeline processor
 void setHardgoodShipper(HardgoodShipper pHardgoodShipper)
           
protected  boolean shipAsItemsAreAvailable(ShippingGroup sg)
          Deprecated. Replaced by the pipeline processor
protected  void verifyShippingGroupFulfillment(ShippingGroup pShippingGroup)
          Deprecated. Replaced by the pipeline processor
 
Methods inherited from class atg.commerce.fulfillment.InventoryFulfiller
getCatalogRefDisplayNamePropertyName, getChainToRunMap, getCommerceItemCatalogRefIdPropertyName, getFulfillerName, getInventoryManager, getKeyForMessage, getModificationHandler, getOrderIdFromMessage, getPartialShipPropertyName, getShipItemRelCommerceItemPropertyName, getShipItemRelOrderPropertyName, getShipItemRelShippingGroupPropertyName, getShipItemRelStatePropertyName, getShipItemRelViewName, getShippingGroupSubmittedDatePropertyName, handleFulfillOrderFragment, handleMessage, handleUpdateInventory, isAllowPartialShipment, isAllowPartialShipmentDefault, isOutOfStockIsError, loadOrder, processMultipleShippingGroups, retrieveWaitingShipMap, setAllowPartialShipmentDefault, setCatalogRefDisplayNamePropertyName, setChainToRunMap, setCommerceItemCatalogRefIdPropertyName, setFulfillerName, setInventoryManager, setModificationHandler, setOutOfStockIsError, setPartialShipPropertyName, setShipItemRelCommerceItemPropertyName, setShipItemRelOrderPropertyName, setShipItemRelShippingGroupPropertyName, setShipItemRelStatePropertyName, setShipItemRelViewName, setShippedDate, setShippingGroupSubmittedDatePropertyName, shippingGroupHasShipped, shippingGroupHasShipped, splitShippingGroupWithAvailableItems, updateOrder
 
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, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, 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, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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
Constructor Detail

HardgoodFulfiller

public HardgoodFulfiller()
Method Detail

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

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:
sg - The shipping group we are interested in
Returns:
true if groups should be split, false otherwise

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), shipAsItemsAreAvailable(atg.commerce.order.ShippingGroup), InventoryFulfiller.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
pShipItemRelationship - 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