This is an example of how to create a minion in Sitecore Commerce Engine.
It touches on a number of key concepts in Sitecore Commerce.
What is a minion? Like real minions they are used to perform tasks. They run asynchronous and can be scheduled or can be started manually. Unlike real minions, they don't require user interaction.
Sitecore Commerce Engine comes with a number of default Minions:
- Pending orders minion
- Released orders minion
- Waiting for availability minion
- Settle Sales activity minion
- Refund RMAs minion
As you can see, all these minions work on orders and lists. Lists are used in Sitecore Commerce Engine to organize entities, either depending on states or on a task that needs to be performed on them.
The pending orders minion takes orders in the PendingOrders list, does some checking and moves them to the ReleasedOrders lists. The released orders minion takes the orders from the ReleasedOrders list and moves them to the CompletedOrders list.
Most minions have a pipeline associated with them. For instance, the PendingOrdersMinion
runs the PendingOrdersMinionPipeline
. Instead of creating your own minion, you can also extend an existing minion by creating a new Block
and add it to an existing pipeline.
For this sample we are creating a completely new minion that will export the orders that are in the CompletedOrders list to a json file on disk. You can imagine more complex scenario's of course where the order is exported to an ERP (Ian has an excellent post on this subject).
We'll do the following:
- Create a new `ExportOrderMinion;