The following examples demonstrate the behavior of the HardgoodFulfiller in different situations.
Example 1: An order is received with one item that is IN_STOCK:
FulfillOrderFragmentreceived with one shipping group.The one item in the shipping group successfully allocates. The
ShippingGroupCommerceItemRelationship'sstate is set to PENDING_DELIVERY.The state of the
ShippingGroupis set to PENDING_SHIPMENT.The group ships. When the
HardgoodFulfilleris notified, the shipping group is set to NO_PENDING_ACTION and the item is set to DELIVERED.
Example 2:HardgoodFulfiller.outOfStockIsError=false and an order is received with one item that is OUT_OF_STOCK:
FulfillOrderFragmentreceived with one shipping group.The 1 item in the shipping group fails to allocate but is successfully backordered. The state of
ShippingGroupCommerceItemRelationshipis set to OUT_OF_STOCK. (This example also applies to BACK_ORDERED and PRE_ORDERED items.)Some time later, an
UpdateInventorymessage is received notifying theHardgoodFulfillerthat the item has new inventory available. The item is reallocated.The state of the
ShippingGroupis set to PENDING_SHIPMENT.The group ships. When the
HardgoodFulfilleris notified, the shipping group is set to NO_PENDING_ACTION and the item is set to DELIVERED.
Example 3:HardgoodFulfiller.outOfStockIsError=true and an order is received with one item that is OUT_OF_STOCK:
FulfillOrderFragmentreceived with one shipping group.The one item in the shipping group fails to allocate but is successfully backordered. The state of
ShippingGroupCommerceItemRelationshipis set to OUT_OF_STOCK.Since
outOfStockIsErroris true, the shipping group’s state gets set to PENDING_MERCHANT_ACTION.At this point, it is the responsibility of the Customer Service Representative to correct the problem.
Example 4:HardgoodFulfiller.allowPartialShipmentDefault=true and HardgoodFulfiller.outOfStockIsError=false and an order is received with one item that is out of stock and one item that is available.
FulfillOrderFragmentreceived with one shipping group containing two items.The first item in the shipping group fails is out of stock. The state of
ShippingGroupCommerceItemRelationshipis set to OUT_OF_STOCK.The second item in the shipping group successfully allocates. Its state is set to PENDING_DELIVERY.
Since
allowPartialShipmentis true, the shipping group is split into two shipping groups. The first contains the PENDING_DELIVERY item and its state is set to PENDING_SHIPMENT. The second shipping group contains the out of stock item and its state remains PROCESSING.The first shipping group continues similarly to the fourth step in example 1. The second shipping group continues similarly to the third step in example 2.
Example 5: An order is received with one item that has no information in the inventory system.
FulfillOrderFragmentreceived with one shipping group.The one item in the shipping group is not found. The state of
ShippingGroupCommerceItemRelationshipis set to ITEM_NOT_FOUND.The state of
ShippingGroupis set to PENDING_MERCHANT_ACTION.
Example 6: An order contains a shipping group in a state of PENDING_MERCHANT_ACTION. HardgoodFulfiller.shippingGroupHasShipped is called with this shipping group.
An error is logged stating that a shipping group that was not in a PENDING_SHIPMENT state cannot be shipped.
shippingGroupHasShippedreturns false.
Example 7: An order contains a shipping group in a state of PENDING_SHIPMENT. A ModifyOrder message with a GenericRemove Modification on the order is received by the OrderFulfiller.
The
OrderFulfillersets the order to PENDING_REMOVE.The
OrderFulfillersends aModifyOrdermessage with aGenericRemovemodification for each shipping group in the order to the fulfiller.The fulfiller receives the
ModifyOrder.The state of the
ShippingGroupis set to PENDING_REMOVE.Each of the items in the shipping group has its state set to PENDING_REMOVE.
If the item was PENDING_DELIVERY, the stock level in the inventory is increased.
If the item was BACK_ORDERED, the backorder level in the inventory is increased.
If the item was PRE_ORDERED, the preorder level in the inventory is increased.
A
ModifyOrderNotificationis sent with each of the updates.This message is received by the
HardgoodFulfiller. TheHardgoodFulfillersets the state of each object to REMOVED.HardgoodFulfillersends aModifyOrderNotificationwith these updates.OrderFulfillerreceives theModifyOrderNotification, when all shipping groups are REMOVED,OrderFulfillersets the order and eachCommerceItemto REMOVED.
Example 8: An order contains a shipping group in a state of NO_PENDING_ACTION. A ModifyOrder message with a GenericRemove Modification on the order is received by the OrderFulfiller.
The
OrderFulfillersets the order to PENDING_REMOVE.The
OrderFulfillersends aModifyOrdermessage with aGenericRemovemodification for each shipping group in the order to the fulfiller.The fulfiller receives the
ModifyOrder.The shipping group cannot be removed since it has already shipped.
A
ModifyOrderNotificationis sent with the originalGenericRemovemessage set to a status of STATUS_FAILED.This message is received by the
OrderFulfiller. TheOrderFulfillersets the state of the order to PENDING_MERCHANT_ACTION.

