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.
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 children
PendingOrderMinions for further processing.
There are two instances of the
PendingOrdersMinion, defined as children of the
PendingOrders.2. Each pending order child minion watches its own list of pending orders passed on by the parent minion (
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
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 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.
WaitingForAvailabilityOrdersMinion runs every 5 minutes.
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.
ReleasedOrdersMinion runs every 5 minutes.
Settle Sales Activities Minion
SettleSalesActivitiesMinion watches the
SettleSalesActivities list. It calls a pipeline that settles the orders payments.
SettleSalesActivitiesMinion runs every 5 minutes. It calls 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.
RefundRmasMinion runs every 5 minutes.