Orders minions
Commerce Order minions 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 PendingOrderMinionBoss
: PendingOrders.1
and PendingOrders.2
. Each pending order child minion watches its own list of pending orders passed on by the parent minion (PendingOrdersMinionBoss
).
The PendingOrderMinion
runs 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.
The ReleasedOrdersMinion
runs every 5 minutes.
Settle Sales Activities Minion
The SettleSalesActivitiesMinion
watches the SettleSalesActivities
list. It calls a pipeline that settles the orders payments.
The SettleSalesActivitiesMinion
runs every 5 minutes. It calls the ISettleSalesActivityPipeline
.
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.