Orders minions

Version: 10.0

The Orders plugin contributes minions that play a key role in the overall order process flow, moving orders from the pending status to the next status until the order is completed.  

Pending orders minions 

The pending orders process is managed using scaled minions. 

The PendingOrdersMinionBoss is a scaled minion that watches the PendingOrdersList. It runs every 5 minutes and, using a round-robin algorithm, it distributes the items in its list to two childrenPendingOrderMinions for further processing.

There are two instances of the PendingOrdersMinion, defined as children of the PendingOrderMinionBossPendingOrders.1 and PendingOrders.2. Each pending order child minion watches its own list of pending orders passed on by the parent minion (PendingOrdersMinionBoss).

The PendingOrderMinionruns the IPendingOrdersMinionPipeline. This pipeline checks if all the order's lines are available and then performs the following:

  • Generates the corresponding sale activities.

  • Processes payments as required.

  • Moves the order to the ReleasedOrders list.

  • Changes the order’s status to Released.

If one of the order's lines is not available, the IPendingOrdersMinionPipeline moves the pending order to the WaitingForAvailabilityOrders list. The order's status changes from pending to WaitingForAvailability.

If a problem or situation interrupts the normal order process flow, the order status is set to Problem and the order is added to the Problem order list.

WaitingForAvailabilityOrdersMinion

The WaitingForAvailabilityOrdersMinion watches the WaitingForAvailabilityOrders list and runs the IWaitingForAvailabilityOrdersMinionPipeline that performs availability checks on the line items included in the order.  Once items are in stock, the order is moved back to the PendingOrderslist. The order is put in the Pending status.

The WaitingForAvailabilityOrdersMinion runs every 5 minutes.

ReleasedOrdersMinion

The ReleasedOrdersMinion watches the ReleasedOrdersList. It calls the IReleasedOrdersMinionPipeline and checks if the order is ready to be completed.

If the release order is ready, it generates the order’s shipments or entitlements and moves the order to the CompletedOrderList. The order’s status changes to Completed.

In Sitecore XC 9.2, the SettleSalesActivitiesMinion and iSettleSalesActivitiesPipeline are deprecated, and the ReleasedOrdersMinion settles sales activities for federated payments. Sales activities for gift cards payments are still settled by the PendingOrdersMinion.

The ReleasedOrdersMinion attempts to settle the federated payments only once. If the payment provider (for example, Braintree) fails to settle, the sales activity and the order are marked as Problem and are moved to the Problem lists. Otherwise, the sales activity is marked as Settled and moved to the Settled list. The order is then marked as Completed and moved to the Completed list.

The ReleasedOrdersMinion runs every 5 minutes.

RefundRmasMinion

The RefundRmasMinion watches the RefundPendingRmas list.  It calls the IRefundRmasMinionPipeline that processes Refund Authorization Requests and refunds the orders payments for order with returned items.

The RefundRmasMinion runs every 5 minutes.

Do you have some feedback for us?

If you have suggestions for improving this article,