The /atg/commerce/order/abandoned/AbandonedOrderService not only defines what constitutes an abandoned or lost order, but also queries the order repository for these types of orders according to the schedule that you specify in its schedule property. The default schedule is “every day at 3:00 AM.”
When an AbandonedOrderService job is run, the service queries the order repository for both abandoned and lost orders. The following table lists the criteria orders must meet to be identified as abandoned or lost:
Criteria for Identification as “Abandoned” | Criteria for Identification as “Lost” |
|---|---|
The order’s state matches one in the | Same |
The abandonment state is REANIMATED. | The abandonment state is not LOST. |
The order has been idle for the number of days specified in the | The order has been idle for the number of days specified in the |
The order’s subtotal is greater than or equal to the amount specified in the | Same |
See Configuring AbandonedOrderTools and Configuring AbandonedOrderService for information on setting the properties referenced in the table above.
For each abandoned order found, the AbandonedOrderService does the following:
Adds the order to the list of abandoned orders in the user’s
abandonedOrdersprofile property.If necessary, creates an
abandonmentInfoitem for the order; then updates the item with the relevant information:The
stateproperty is set to ABANDONED.The
abandonmentDateproperty is set to the current date and time.If the
abandonmentInfoitem is new, theabandonmentCountproperty is set to 1. Otherwise, it is incremented.
Fires an
OrderAbandonedmessage if theAbandonedOrderTools.sendOrderAbandonedMessageproperty is set totrue.
For each lost order found, the AbandonedOrderService does the following:
Removes the order from the list of abandoned orders in the user’s
abandonedOrdersprofile property.If the
AbandonedOrderTools.deleteLostOrdersproperty is set totrue, the lost order is deleted from the order repository.If the
AbandonedOrderTools.leaveAbandonmentInfoForDeletedOrdersproperty is set totrue, theabandonmentInfoitem for the order is updated with the relevant information:The
stateproperty is set to LOST.The
lostDateproperty is set to the current date and time.
Fires an
OrderLostmessage if theAbandonedOrderTools.sendOrderLostMessageproperty is set totrue.
As previously mentioned, the AbandonedOrderService is a configured instance of class atg.commerce.order.abandoned.AbandonedOrderService. This class extends atg.service.scheduler.SingletonSchedulableService, which uses locking to enable multiple servers to run the same scheduled service while ensuring that only one instance performs the scheduled task at a given time.

