atg.commerce.fulfillment
Class OrderFulfillerModificationHandler

java.lang.Object
  extended by atg.commerce.fulfillment.OrderFulfillerModificationHandler
All Implemented Interfaces:
ModificationHandler

public class OrderFulfillerModificationHandler
extends java.lang.Object
implements ModificationHandler

The OrderFulfillerModificationHandler deals with the ModifyOrder and ModifyOrderNotifications messages received by the OrderFulfiller. The OrderFulfiller contains a ModificationHandler property, which is set by default to the OrderFulfillerModificationHandler. This class is similar to the HardgoodFulfillerModificationHandler.

To change the handling behavior of ModifyOrder and ModifyOrderNotification messages, extend the OrderFulfillerModificationHandler class and change the ModificationHandler property OrderFulfiller to point to the new class.

The default implementation deals with the following ModifyOrder modification: Remove an order: Remove an order by sending a ModifyOrder message containing a Modification of type REMOVE. The OrderFulfiller receives this message. If the order and its shipping group are not in a NO_PENDING_ACTION state, then ModifyOrder messages are sent to the various fulfillers handling the shipping groups. Every fulfiller who can cancel the shipping group responds by setting the state of the shipping group to PENDING_REMOVE. If all of the shipping group states are change to PENDING_REMOVE, then the order state changes to REMOVED and all of the shipping group states can be changed to REMOVED. An order cannot be canceled if any of its shipping groups have been shipped. If a GenericRemove modification is attempted on an order that cannot be removed (e.g. one of the shipping groups in the order has shipped) then the order is set to PENDING_MERCHANT_ACTION. Ship a shipping group: Notify the fulfillment system that a shipping group has shipped by sending a ModifyOrder message with a GenericUpdate (link to GenericUpdate section, it has this example) that changes the state of the shipping group from PENDING_SHIPMENT to NO_PENDING_ACTION. The OrderFulfiller will receive this message and forward it to the responsible fulfiller

It also handles the following ModifyOrderNotification modification: Shipping group state change: Shipping group's state changes to NO_PENDING_ACTION, PENDING_MERCHANT_ACTION, PENDING_REMOVE, or failure to change to PENDING_REMOVE. ShippingGroupUpdate: When a customer updates a shipping group, the OrderFulfiller sends a ModifyOrderNotification message to the fulfiller responsible for this shipping group. This forces a reprocessing of the shipping group. Created: Mon Jan 24 15:21:02 2000


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
OrderFulfillerModificationHandler()
           
 
Method Summary
protected  boolean areAllGroupsPendingRemove(Order pOrder)
          Deprecated. Replaced by the pipeline processor
protected  boolean areAllGroupsRemoved(Order pOrder)
          Deprecated. Replaced by the pipeline processor
protected  void cancelRemoveOrder(Order pOrder, java.util.List pModificationList)
          Deprecated. Replaced by the pipeline processor
protected  boolean cancelRemoveShippingGroup(ShippingGroup pShippingGroup, java.util.List pModificationList)
          Deprecated. Replaced by the pipeline processor
protected  boolean creditOrder(Order pOrder, java.util.List pModificationList)
          Deprecated. Replaced by the pipeline processor
protected  void finishRemovingOrder(Order pOrder, java.util.List pModificationList)
          Deprecated. Replaced by the pipeline processor
protected  void finishRemovingShippingGroup(ShippingGroup pShippingGroup, java.util.List pModificationList)
          Deprecated. Replaced by the pipeline processor
 java.util.Properties getChainToRunMap()
           
 OrderFulfiller getOrderFulfiller()
           
protected  void handleIdTargetModification(ModifyOrderNotification pMessage, Order pOrder, IdTargetModification pModification, java.util.List pModificationList)
          Deprecated. Replaced by the pipeline processor
protected  void handleItemModification(ModifyOrderNotification pMessage, Order pOrder, Modification pModification, java.util.List pPerformedModifications)
          Deprecated. Replaced by the pipeline processor
 void handleModifyOrder(java.lang.String pPortName, javax.jms.ObjectMessage pMessage)
           This method is called to handle all messages of type ModifyOrder.
 void handleModifyOrderNotification(java.lang.String pPortName, javax.jms.ObjectMessage pMessage)
           This method is called to handle all messages of type ModifyOrderNotification.
protected  void handleOrderModification(ModifyOrderNotification pMessage, Order pOrder, Modification pModification, java.util.List pPerformedModifications)
          Deprecated. Replaced by the pipeline processor
protected  void handlePaymentGroupUpdateModification(ModifyOrderNotification pMessage, Order pOrder, PaymentGroupUpdate pModification, java.util.List pPerformedModifications)
          Deprecated. Replaced by the pipeline processor
protected  void handleRelationshipModification(ModifyOrderNotification pMessage, Order pOrder, Modification pModification, java.util.List pPerformedModifications)
          Deprecated. Replaced by the pipeline processor
protected  void handleShippingGroupModification(ModifyOrderNotification pMessage, Order pOrder, Modification pModification, java.util.List pPerformedModifications)
          Deprecated. Replaced by the pipeline processor
protected  void handleShippingGroupUpdateModification(ModifyOrderNotification pMessage, Order pOrder, ShippingGroupUpdate pModification, java.util.List pPerformedModifications)
          Deprecated. Replaced by the pipeline processor
protected  void performIdTargetModification(ModifyOrder pMessage, Order pOrder, IdTargetModification pModification, java.util.List pModificationList)
          Deprecated. Replaced by the pipeline processor
protected  void performItemModification(ModifyOrder pMessage, Order pOrder, Modification pModification, java.util.List pPerformedModifications)
          Deprecated. Replaced by the pipeline processor
protected  void performOrderModification(ModifyOrder pMessage, Order pOrder, Modification pModification, java.util.List pPerformedModifications)
          Deprecated. Replaced by the pipeline processor
protected  void performRelationshipModification(ModifyOrder pMessage, Order pOrder, Modification pModification, java.util.List pPerformedModifications)
          Deprecated. Replaced by the pipeline processor
protected  void performShippingGroupModification(ModifyOrder pMessage, Order pOrder, Modification pModification, java.util.List pPerformedModifications)
          Deprecated. Replaced by the pipeline processor
protected  boolean removeOrder(Order pOrder, Modification pUpdate, java.util.List pPerformedModifications)
          Deprecated. Replaced by the pipeline processor
 void setChainToRunMap(java.util.Properties pChainToRunMap)
           
 void setOrderFulfiller(OrderFulfiller pOrderFulfiller)
           
protected  void shipItemRelWasRemoved(Order pOrder, ShippingGroupCommerceItemRelationship pShipItemRel)
          Deprecated. Replaced by the pipeline processor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

OrderFulfillerModificationHandler

public OrderFulfillerModificationHandler()
Method Detail

setOrderFulfiller

public void setOrderFulfiller(OrderFulfiller pOrderFulfiller)

getOrderFulfiller

public OrderFulfiller getOrderFulfiller()

getChainToRunMap

public java.util.Properties getChainToRunMap()

setChainToRunMap

public void setChainToRunMap(java.util.Properties pChainToRunMap)

handleModifyOrder

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

This method is called to handle all messages of type ModifyOrder. Should developers wish to change the behavior of the OrderFulfiller class on handling a ModifyOrder message this method should be overridden. This method calls to the pipeline chain to process the message.

Specified by:
handleModifyOrder in interface ModificationHandler
Parameters:
pPortName - The port from which this message was received.
pMessage - The message that was received.
Throws:
javax.jms.JMSException
See Also:
ModifyOrder, performIdTargetModification(atg.commerce.fulfillment.ModifyOrder, atg.commerce.order.Order, atg.commerce.fulfillment.IdTargetModification, java.util.List), IdTargetModification

handleModifyOrderNotification

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

This method is called to handle all messages of type ModifyOrderNotification. Should developers wish to change the behavior of the OrderFulfiller class on handling a ModifyOrderNotification message this method should be overridden. This method calls to the pipeline chain to process the message.

Specified by:
handleModifyOrderNotification in interface ModificationHandler
Parameters:
pPortName - The port from which this message was received.
pMessage - The message that was received.
Throws:
javax.jms.JMSException
See Also:
ModifyOrderNotification, handleShippingGroupUpdateModification(atg.commerce.fulfillment.ModifyOrderNotification, atg.commerce.order.Order, atg.commerce.fulfillment.ShippingGroupUpdate, java.util.List), ShippingGroupUpdate, handleIdTargetModification(atg.commerce.fulfillment.ModifyOrderNotification, atg.commerce.order.Order, atg.commerce.fulfillment.IdTargetModification, java.util.List), IdTargetModification

performIdTargetModification

protected void performIdTargetModification(ModifyOrder pMessage,
                                           Order pOrder,
                                           IdTargetModification pModification,
                                           java.util.List pModificationList)
Deprecated. Replaced by the pipeline processor

This method performs all @see IdTargetModification's that are included in a @see ModifyOrder message. It calls the following methods:

See Also:
IdTargetModification, ModifyOrder, performOrderModification(atg.commerce.fulfillment.ModifyOrder, atg.commerce.order.Order, atg.commerce.fulfillment.Modification, java.util.List), performShippingGroupModification(atg.commerce.fulfillment.ModifyOrder, atg.commerce.order.Order, atg.commerce.fulfillment.Modification, java.util.List), performItemModification(atg.commerce.fulfillment.ModifyOrder, atg.commerce.order.Order, atg.commerce.fulfillment.Modification, java.util.List), performRelationshipModification(atg.commerce.fulfillment.ModifyOrder, atg.commerce.order.Order, atg.commerce.fulfillment.Modification, java.util.List), Modification

performOrderModification

protected void performOrderModification(ModifyOrder pMessage,
                                        Order pOrder,
                                        Modification pModification,
                                        java.util.List pPerformedModifications)
Deprecated. Replaced by the pipeline processor

Perform the requested Modifications. The only modification request that this method currently implements is a GenericRemove (ie. cancel this order). If such a modification request is received, removeOrder is called.

Parameters:
pMessage - The original message that contained the modifications
pOrder - The order that was modified.
pModification - The modification that was performed
pPerformedModifications - All new modifications are stored here.
See Also:
GenericRemove, removeOrder(atg.commerce.order.Order, atg.commerce.fulfillment.Modification, java.util.List)

performShippingGroupModification

protected void performShippingGroupModification(ModifyOrder pMessage,
                                                Order pOrder,
                                                Modification pModification,
                                                java.util.List pPerformedModifications)
Deprecated. Replaced by the pipeline processor

In this version of the order fulfillment system, no ModifyOrder messages targeting ShippingGroups are supported

Parameters:
pMessage - The original message that contained the modifications
pOrder - The order that was modified.
pModification - The modification that was performed
pPerformedModifications - Place to store notifications of changes

performItemModification

protected void performItemModification(ModifyOrder pMessage,
                                       Order pOrder,
                                       Modification pModification,
                                       java.util.List pPerformedModifications)
Deprecated. Replaced by the pipeline processor

In this version of the order fulfillment system, no ModifyOrder messages targeting Items are supported

Parameters:
pMessage - The original message that contained the modifications
pOrder - The order that was modified.
pModification - The modification that was performed
pPerformedModifications - All new modifications are stored here.

performRelationshipModification

protected void performRelationshipModification(ModifyOrder pMessage,
                                               Order pOrder,
                                               Modification pModification,
                                               java.util.List pPerformedModifications)
Deprecated. Replaced by the pipeline processor

In this version of the order fulfillment system, no ModifyOrder messages targeting Relationships are supported

Parameters:
pMessage - The original message that contained the modifications
pOrder - The order that was modified.
pModification - The modification that was performed
pPerformedModifications - All new modifications are stored here.

handleIdTargetModification

protected void handleIdTargetModification(ModifyOrderNotification pMessage,
                                          Order pOrder,
                                          IdTargetModification pModification,
                                          java.util.List pModificationList)
                                   throws javax.jms.JMSException
Deprecated. Replaced by the pipeline processor

This method handles all @see IdTargetModification's that are included in a @see ModifyOrderNotification message. It calls the following methods:

Throws:
javax.jms.JMSException
See Also:
IdTargetModification, ModifyOrderNotification, handleOrderModification(atg.commerce.fulfillment.ModifyOrderNotification, atg.commerce.order.Order, atg.commerce.fulfillment.Modification, java.util.List), handleShippingGroupModification(atg.commerce.fulfillment.ModifyOrderNotification, atg.commerce.order.Order, atg.commerce.fulfillment.Modification, java.util.List), handleItemModification(atg.commerce.fulfillment.ModifyOrderNotification, atg.commerce.order.Order, atg.commerce.fulfillment.Modification, java.util.List), handleRelationshipModification(atg.commerce.fulfillment.ModifyOrderNotification, atg.commerce.order.Order, atg.commerce.fulfillment.Modification, java.util.List), Modification

handleOrderModification

protected void handleOrderModification(ModifyOrderNotification pMessage,
                                       Order pOrder,
                                       Modification pModification,
                                       java.util.List pPerformedModifications)
Deprecated. Replaced by the pipeline processor

In this version of the order fulfillment system, ModifyOrderNotification messages targeting Orders are ignored

Parameters:
pMessage - the ModifyOrderNotification received
pOrder - The order that was modified.
pModification - The modification that was performed
pPerformedModifications - All new modifications are stored here.

handleShippingGroupModification

protected void handleShippingGroupModification(ModifyOrderNotification pMessage,
                                               Order pOrder,
                                               Modification pModification,
                                               java.util.List pPerformedModifications)
                                        throws javax.jms.JMSException
Deprecated. Replaced by the pipeline processor

This method initiates any processing that should be done as a result of a change to a ShippingGroup. The following modifications are listened for.

Parameters:
pMessage - the ModifyOrderNotification received
pOrder - The order that was modified.
pModification - The modification that was performed
pPerformedModifications - All new modifications are stored here.
Throws:
javax.jms.JMSException
See Also:
GenericRemove, GenericUpdate, ShippingGroupStates, OrderStates, finishRemovingOrder(atg.commerce.order.Order, java.util.List)

handleItemModification

protected void handleItemModification(ModifyOrderNotification pMessage,
                                      Order pOrder,
                                      Modification pModification,
                                      java.util.List pPerformedModifications)
Deprecated. Replaced by the pipeline processor

In this version of the order fulfillment system, ModifyOrderNotification messages targeting Items are ignored

Parameters:
pMessage - the ModifyOrderNotification received
pOrder - The order that was modified.
pModification - The modification that was performed
pPerformedModifications - All new modifications are stored here.

handleRelationshipModification

protected void handleRelationshipModification(ModifyOrderNotification pMessage,
                                              Order pOrder,
                                              Modification pModification,
                                              java.util.List pPerformedModifications)
Deprecated. Replaced by the pipeline processor

This method initiates any processing that should be done as a result of a change to a Relationship. Only one modification is listened for.

Parameters:
pMessage - the ModifyOrderNotification received
pOrder - The order that was modified.
pModification - The modification that was performed
pPerformedModifications - All new modifications are stored here.
See Also:
GenericUpdate, ShipItemRelationshipStates, shipItemRelWasRemoved(atg.commerce.order.Order, atg.commerce.order.ShippingGroupCommerceItemRelationship)

handleShippingGroupUpdateModification

protected void handleShippingGroupUpdateModification(ModifyOrderNotification pMessage,
                                                     Order pOrder,
                                                     ShippingGroupUpdate pModification,
                                                     java.util.List pPerformedModifications)
                                              throws javax.jms.JMSException
Deprecated. Replaced by the pipeline processor

This method will reprocess each of the shipping groups in the ShippingGroupUpdate modification. Sends a ModifyOrderNotification to each fulfiller that owns a each of the updated shipping groups.

Parameters:
pMessage - The ModifyOrderNotification received
pOrder - The order that was modified
pModification - The modification containing the shipping group ids that were updated
pPerformedModifications - All new modifications are stored here.
Throws:
javax.jms.JMSException

handlePaymentGroupUpdateModification

protected void handlePaymentGroupUpdateModification(ModifyOrderNotification pMessage,
                                                    Order pOrder,
                                                    PaymentGroupUpdate pModification,
                                                    java.util.List pPerformedModifications)
                                             throws javax.jms.JMSException
Deprecated. Replaced by the pipeline processor

This method does not do anything. If processing is needed when a payment group is changed, extend this class and overwrite this method.

Parameters:
pMessage - The ModifyOrderNotification received
pOrder - The order that was modified
pModification - The modification containing the payment group ids that were updated
pPerformedModifications - All new modifications are stored here.
Throws:
javax.jms.JMSException

removeOrder

protected boolean removeOrder(Order pOrder,
                              Modification pUpdate,
                              java.util.List pPerformedModifications)
Deprecated. Replaced by the pipeline processor

This is called as a result of a ModifyOrder message with a GenericRemove of an order. It requests that each shipping group is removed by the appropriate fulfillers, by sending a ModifyOrder message to that fulfiller. It also sets each CommerceItem to PENDING_REMOVE

Parameters:
pOrder - The order being removed.
pUpdate - The modification originally requesting that this order be removed
pPerformedModifications - A place to store all new modifications.

areAllGroupsPendingRemove

protected boolean areAllGroupsPendingRemove(Order pOrder)
Deprecated. Replaced by the pipeline processor

Check if all the groups in this object are PENDING_REMOVE

Parameters:
pOrder - The order we are checking
Returns:
true if all groups are removed, false otherwise

areAllGroupsRemoved

protected boolean areAllGroupsRemoved(Order pOrder)
Deprecated. Replaced by the pipeline processor

Check if all the groups in this object are REMOVED

Parameters:
pOrder - The order we are checking
Returns:
true if all groups are removed, false otherwise

finishRemovingOrder

protected void finishRemovingOrder(Order pOrder,
                                   java.util.List pModificationList)
Deprecated. Replaced by the pipeline processor

Set the order to REMOVED and sets each CommerceItem to REMOVED, and sets each PaymentGroup to REMOVED. Assumes the order is currently in a PENDING_REMOVE state. Also credits any PaymentGroups that have been debited. Assumes that the person calling this method has verified that all the shippinggroups are in a state that allows them to be removed.

Parameters:
pOrder - the order we are changing
pModificationList - A place to store our modifications

finishRemovingShippingGroup

protected void finishRemovingShippingGroup(ShippingGroup pShippingGroup,
                                           java.util.List pModificationList)
Deprecated. Replaced by the pipeline processor

Set the shipping group to REMOVED, and set each item relattion ship to REMOVED Assumes the shipping group is currently in a PENDING_REMOVE state. Assumes that the item relationship state was checked before this is called.

Parameters:
pShippingGroup - the shipping group we are changing
pModificationList - A place to store our modifications

shipItemRelWasRemoved

protected void shipItemRelWasRemoved(Order pOrder,
                                     ShippingGroupCommerceItemRelationship pShipItemRel)
Deprecated. Replaced by the pipeline processor

This removes the quantity of the removed shipItemRel from the quantity of its CommerceItem

Parameters:
pOrder - The order containing both the ShipItemRel
pShipItemRel - The ShippingGroupCommerceItemRelationship that was removed

cancelRemoveOrder

protected void cancelRemoveOrder(Order pOrder,
                                 java.util.List pModificationList)
Deprecated. Replaced by the pipeline processor

This method is called if a request to remove an order failed because one of the shipping groups could not be removed. Usually because that group had shipped. It sets the Order to PENDING_MERCHANT_ACTION.

Parameters:
pOrder - The order that should not be removed.
pModificationList - A place to store all modifications.

cancelRemoveShippingGroup

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

This method is called if a PENDING_REMOVE order needs to be set back to normal (ie it is not being removed anymore). If the shipping group is in a PENDING_REMOVE state, it sets the group to PROCESSING, resets all the items in the shipping group to INITIAL, and sends a ShippingGroupUpdate modification notification to its fulfiller. If the shipping group is not in a PENDING_REMOVE state, nothing happens. If the shipping group was changed, return true. If nothing happened, return false.

Parameters:
pShippingGroup - the shipping group we are changing
pModificationList - A place to store our modifications
Returns:
true if the shipping group state was changed.

creditOrder

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

Use the payment manager to credit each payment group in the order. Typically called if an order is removed.

Parameters:
pOrder - The order being credited
pModificationList - A place to store all new modifications.
Returns:
true if the order was successfully credited, false otherwise