How to implement a Sitecore Commerce Minion
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I am new to Sitecore commerce Minions.
I wanted to create a Minion which runs for every 30 minutes to update the Product values.
I am getting the Products properties from external source.
What changes do I need to make ?
sitecore-commerce
add a comment |Â
up vote
2
down vote
favorite
I am new to Sitecore commerce Minions.
I wanted to create a Minion which runs for every 30 minutes to update the Product values.
I am getting the Products properties from external source.
What changes do I need to make ?
sitecore-commerce
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I am new to Sitecore commerce Minions.
I wanted to create a Minion which runs for every 30 minutes to update the Product values.
I am getting the Products properties from external source.
What changes do I need to make ?
sitecore-commerce
I am new to Sitecore commerce Minions.
I wanted to create a Minion which runs for every 30 minutes to update the Product values.
I am getting the Products properties from external source.
What changes do I need to make ?
sitecore-commerce
edited Aug 9 at 17:32


Pratik Wasnik
15511
15511
asked Aug 6 at 8:46


Hussain
524
524
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
First of all you need to declare your minion on the environment definition for your minions environment.
In the Sitecore.Commerce.Engine project is the JSON file PlugIn.Habitat.CommerceMinions-1.0.0.json which is the definition for the habitat minions environment. This is the active environment on the commerce minions web site (one of 4 in IIS installed as part of commerce).
First of all you need to declare your minion in a json :
"$type": "Sitecore.Commerce.Core.MinionPolicy, Sitecore.Commerce.Core",
"WakeupInterval": "00:05:00",
"ListToWatch": "",
"FullyQualifiedName": "Plugin.MyProject.Import.ImportMinion, Plugin.MyProject.Import",
"ItemsPerBatch": 10,
"SleepBetweenBatches": 500
You need to declare your class which inherits from Minion class
namespace Plugin.MyProject.Import
public class ImportMinion : Minion
protected IImportMinionMinionPipeline MinionPipeline get; set;
public override void Initialize(IServiceProvider serviceProvider, ILogger logger, MinionPolicy policy, CommerceEnvironment environment, CommerceContext globalContext)
base.Initialize(serviceProvider, logger, policy, environment, globalContext);
MinionPipeline = serviceProvider.GetService<IImportMinionMinionPipeline>();
public override async Task<MinionRunResultsModel> Run()
this.Logger.LogInformation("ImportMinion running");
var commerceContext = new CommerceContext(this.Logger, this.MinionContext.TelemetryClient, null);
commerceContext.Environment = this.Environment;
CommercePipelineExecutionContextOptions executionContextOptions = new CommercePipelineExecutionContextOptions(commerceContext, null, null, null, null, null);
MinionRunResultsModel res = await this.MinionPipeline.Run(new MinionRunResultsModel(), executionContextOptions);
return new MinionRunResultsModel();
Because of the changes in the json files you need to bootrastrap your commerce engine.
Please have a look for more informations on next links :
https://blog.ryanbailey.co.nz/2018/03/sitecore-experience-commerce-creating.html
https://blog.ryanbailey.co.nz/2018/05/sitecore-experience-commerce-minion-to.html
https://github.com/commerceengineplugins/sampleminion
I tried to hit the Minion from Postman and i got the below error. "MessageDate":"2018-08-08T08:32:41.4097457Z","Code":"Error","Text":"Minion Sitecore.Commerce.Plugin.SAP.Minion.SAPProductSyncMinion, Sitecore.Commerce.Plugin.SAP was not found.","CommerceTermKey":"MinionNotFound"
– Hussain
Aug 8 at 8:40
did you bootstrap your commerce engine?
– Vlad Iobagiu
Aug 8 at 9:21
HI Vlad, Yes I did. I am getting the below error in "CommerceMinions" IIS website log file.[MinionStartup] Environment='HabitatMinions', 'Sitecore.Commerce.Plugin.SAP.Minion, Sitecore.Commerce.Plugin.SAP' 11 05:17:38 ERROR Pipeline completed with error System.Exception: Error processing block: Core.block.StartEnvironmentMinions ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null
– Hussain
Aug 8 at 9:32
The problem with wrong assembly name added in Minion config file. Now this is working as expected.
– Hussain
Aug 9 at 6:29
Great, glad I could help you
– Vlad Iobagiu
Aug 9 at 6:32
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
First of all you need to declare your minion on the environment definition for your minions environment.
In the Sitecore.Commerce.Engine project is the JSON file PlugIn.Habitat.CommerceMinions-1.0.0.json which is the definition for the habitat minions environment. This is the active environment on the commerce minions web site (one of 4 in IIS installed as part of commerce).
First of all you need to declare your minion in a json :
"$type": "Sitecore.Commerce.Core.MinionPolicy, Sitecore.Commerce.Core",
"WakeupInterval": "00:05:00",
"ListToWatch": "",
"FullyQualifiedName": "Plugin.MyProject.Import.ImportMinion, Plugin.MyProject.Import",
"ItemsPerBatch": 10,
"SleepBetweenBatches": 500
You need to declare your class which inherits from Minion class
namespace Plugin.MyProject.Import
public class ImportMinion : Minion
protected IImportMinionMinionPipeline MinionPipeline get; set;
public override void Initialize(IServiceProvider serviceProvider, ILogger logger, MinionPolicy policy, CommerceEnvironment environment, CommerceContext globalContext)
base.Initialize(serviceProvider, logger, policy, environment, globalContext);
MinionPipeline = serviceProvider.GetService<IImportMinionMinionPipeline>();
public override async Task<MinionRunResultsModel> Run()
this.Logger.LogInformation("ImportMinion running");
var commerceContext = new CommerceContext(this.Logger, this.MinionContext.TelemetryClient, null);
commerceContext.Environment = this.Environment;
CommercePipelineExecutionContextOptions executionContextOptions = new CommercePipelineExecutionContextOptions(commerceContext, null, null, null, null, null);
MinionRunResultsModel res = await this.MinionPipeline.Run(new MinionRunResultsModel(), executionContextOptions);
return new MinionRunResultsModel();
Because of the changes in the json files you need to bootrastrap your commerce engine.
Please have a look for more informations on next links :
https://blog.ryanbailey.co.nz/2018/03/sitecore-experience-commerce-creating.html
https://blog.ryanbailey.co.nz/2018/05/sitecore-experience-commerce-minion-to.html
https://github.com/commerceengineplugins/sampleminion
I tried to hit the Minion from Postman and i got the below error. "MessageDate":"2018-08-08T08:32:41.4097457Z","Code":"Error","Text":"Minion Sitecore.Commerce.Plugin.SAP.Minion.SAPProductSyncMinion, Sitecore.Commerce.Plugin.SAP was not found.","CommerceTermKey":"MinionNotFound"
– Hussain
Aug 8 at 8:40
did you bootstrap your commerce engine?
– Vlad Iobagiu
Aug 8 at 9:21
HI Vlad, Yes I did. I am getting the below error in "CommerceMinions" IIS website log file.[MinionStartup] Environment='HabitatMinions', 'Sitecore.Commerce.Plugin.SAP.Minion, Sitecore.Commerce.Plugin.SAP' 11 05:17:38 ERROR Pipeline completed with error System.Exception: Error processing block: Core.block.StartEnvironmentMinions ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null
– Hussain
Aug 8 at 9:32
The problem with wrong assembly name added in Minion config file. Now this is working as expected.
– Hussain
Aug 9 at 6:29
Great, glad I could help you
– Vlad Iobagiu
Aug 9 at 6:32
add a comment |Â
up vote
2
down vote
accepted
First of all you need to declare your minion on the environment definition for your minions environment.
In the Sitecore.Commerce.Engine project is the JSON file PlugIn.Habitat.CommerceMinions-1.0.0.json which is the definition for the habitat minions environment. This is the active environment on the commerce minions web site (one of 4 in IIS installed as part of commerce).
First of all you need to declare your minion in a json :
"$type": "Sitecore.Commerce.Core.MinionPolicy, Sitecore.Commerce.Core",
"WakeupInterval": "00:05:00",
"ListToWatch": "",
"FullyQualifiedName": "Plugin.MyProject.Import.ImportMinion, Plugin.MyProject.Import",
"ItemsPerBatch": 10,
"SleepBetweenBatches": 500
You need to declare your class which inherits from Minion class
namespace Plugin.MyProject.Import
public class ImportMinion : Minion
protected IImportMinionMinionPipeline MinionPipeline get; set;
public override void Initialize(IServiceProvider serviceProvider, ILogger logger, MinionPolicy policy, CommerceEnvironment environment, CommerceContext globalContext)
base.Initialize(serviceProvider, logger, policy, environment, globalContext);
MinionPipeline = serviceProvider.GetService<IImportMinionMinionPipeline>();
public override async Task<MinionRunResultsModel> Run()
this.Logger.LogInformation("ImportMinion running");
var commerceContext = new CommerceContext(this.Logger, this.MinionContext.TelemetryClient, null);
commerceContext.Environment = this.Environment;
CommercePipelineExecutionContextOptions executionContextOptions = new CommercePipelineExecutionContextOptions(commerceContext, null, null, null, null, null);
MinionRunResultsModel res = await this.MinionPipeline.Run(new MinionRunResultsModel(), executionContextOptions);
return new MinionRunResultsModel();
Because of the changes in the json files you need to bootrastrap your commerce engine.
Please have a look for more informations on next links :
https://blog.ryanbailey.co.nz/2018/03/sitecore-experience-commerce-creating.html
https://blog.ryanbailey.co.nz/2018/05/sitecore-experience-commerce-minion-to.html
https://github.com/commerceengineplugins/sampleminion
I tried to hit the Minion from Postman and i got the below error. "MessageDate":"2018-08-08T08:32:41.4097457Z","Code":"Error","Text":"Minion Sitecore.Commerce.Plugin.SAP.Minion.SAPProductSyncMinion, Sitecore.Commerce.Plugin.SAP was not found.","CommerceTermKey":"MinionNotFound"
– Hussain
Aug 8 at 8:40
did you bootstrap your commerce engine?
– Vlad Iobagiu
Aug 8 at 9:21
HI Vlad, Yes I did. I am getting the below error in "CommerceMinions" IIS website log file.[MinionStartup] Environment='HabitatMinions', 'Sitecore.Commerce.Plugin.SAP.Minion, Sitecore.Commerce.Plugin.SAP' 11 05:17:38 ERROR Pipeline completed with error System.Exception: Error processing block: Core.block.StartEnvironmentMinions ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null
– Hussain
Aug 8 at 9:32
The problem with wrong assembly name added in Minion config file. Now this is working as expected.
– Hussain
Aug 9 at 6:29
Great, glad I could help you
– Vlad Iobagiu
Aug 9 at 6:32
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
First of all you need to declare your minion on the environment definition for your minions environment.
In the Sitecore.Commerce.Engine project is the JSON file PlugIn.Habitat.CommerceMinions-1.0.0.json which is the definition for the habitat minions environment. This is the active environment on the commerce minions web site (one of 4 in IIS installed as part of commerce).
First of all you need to declare your minion in a json :
"$type": "Sitecore.Commerce.Core.MinionPolicy, Sitecore.Commerce.Core",
"WakeupInterval": "00:05:00",
"ListToWatch": "",
"FullyQualifiedName": "Plugin.MyProject.Import.ImportMinion, Plugin.MyProject.Import",
"ItemsPerBatch": 10,
"SleepBetweenBatches": 500
You need to declare your class which inherits from Minion class
namespace Plugin.MyProject.Import
public class ImportMinion : Minion
protected IImportMinionMinionPipeline MinionPipeline get; set;
public override void Initialize(IServiceProvider serviceProvider, ILogger logger, MinionPolicy policy, CommerceEnvironment environment, CommerceContext globalContext)
base.Initialize(serviceProvider, logger, policy, environment, globalContext);
MinionPipeline = serviceProvider.GetService<IImportMinionMinionPipeline>();
public override async Task<MinionRunResultsModel> Run()
this.Logger.LogInformation("ImportMinion running");
var commerceContext = new CommerceContext(this.Logger, this.MinionContext.TelemetryClient, null);
commerceContext.Environment = this.Environment;
CommercePipelineExecutionContextOptions executionContextOptions = new CommercePipelineExecutionContextOptions(commerceContext, null, null, null, null, null);
MinionRunResultsModel res = await this.MinionPipeline.Run(new MinionRunResultsModel(), executionContextOptions);
return new MinionRunResultsModel();
Because of the changes in the json files you need to bootrastrap your commerce engine.
Please have a look for more informations on next links :
https://blog.ryanbailey.co.nz/2018/03/sitecore-experience-commerce-creating.html
https://blog.ryanbailey.co.nz/2018/05/sitecore-experience-commerce-minion-to.html
https://github.com/commerceengineplugins/sampleminion
First of all you need to declare your minion on the environment definition for your minions environment.
In the Sitecore.Commerce.Engine project is the JSON file PlugIn.Habitat.CommerceMinions-1.0.0.json which is the definition for the habitat minions environment. This is the active environment on the commerce minions web site (one of 4 in IIS installed as part of commerce).
First of all you need to declare your minion in a json :
"$type": "Sitecore.Commerce.Core.MinionPolicy, Sitecore.Commerce.Core",
"WakeupInterval": "00:05:00",
"ListToWatch": "",
"FullyQualifiedName": "Plugin.MyProject.Import.ImportMinion, Plugin.MyProject.Import",
"ItemsPerBatch": 10,
"SleepBetweenBatches": 500
You need to declare your class which inherits from Minion class
namespace Plugin.MyProject.Import
public class ImportMinion : Minion
protected IImportMinionMinionPipeline MinionPipeline get; set;
public override void Initialize(IServiceProvider serviceProvider, ILogger logger, MinionPolicy policy, CommerceEnvironment environment, CommerceContext globalContext)
base.Initialize(serviceProvider, logger, policy, environment, globalContext);
MinionPipeline = serviceProvider.GetService<IImportMinionMinionPipeline>();
public override async Task<MinionRunResultsModel> Run()
this.Logger.LogInformation("ImportMinion running");
var commerceContext = new CommerceContext(this.Logger, this.MinionContext.TelemetryClient, null);
commerceContext.Environment = this.Environment;
CommercePipelineExecutionContextOptions executionContextOptions = new CommercePipelineExecutionContextOptions(commerceContext, null, null, null, null, null);
MinionRunResultsModel res = await this.MinionPipeline.Run(new MinionRunResultsModel(), executionContextOptions);
return new MinionRunResultsModel();
Because of the changes in the json files you need to bootrastrap your commerce engine.
Please have a look for more informations on next links :
https://blog.ryanbailey.co.nz/2018/03/sitecore-experience-commerce-creating.html
https://blog.ryanbailey.co.nz/2018/05/sitecore-experience-commerce-minion-to.html
https://github.com/commerceengineplugins/sampleminion
answered Aug 6 at 8:56


Vlad Iobagiu
10.9k2628
10.9k2628
I tried to hit the Minion from Postman and i got the below error. "MessageDate":"2018-08-08T08:32:41.4097457Z","Code":"Error","Text":"Minion Sitecore.Commerce.Plugin.SAP.Minion.SAPProductSyncMinion, Sitecore.Commerce.Plugin.SAP was not found.","CommerceTermKey":"MinionNotFound"
– Hussain
Aug 8 at 8:40
did you bootstrap your commerce engine?
– Vlad Iobagiu
Aug 8 at 9:21
HI Vlad, Yes I did. I am getting the below error in "CommerceMinions" IIS website log file.[MinionStartup] Environment='HabitatMinions', 'Sitecore.Commerce.Plugin.SAP.Minion, Sitecore.Commerce.Plugin.SAP' 11 05:17:38 ERROR Pipeline completed with error System.Exception: Error processing block: Core.block.StartEnvironmentMinions ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null
– Hussain
Aug 8 at 9:32
The problem with wrong assembly name added in Minion config file. Now this is working as expected.
– Hussain
Aug 9 at 6:29
Great, glad I could help you
– Vlad Iobagiu
Aug 9 at 6:32
add a comment |Â
I tried to hit the Minion from Postman and i got the below error. "MessageDate":"2018-08-08T08:32:41.4097457Z","Code":"Error","Text":"Minion Sitecore.Commerce.Plugin.SAP.Minion.SAPProductSyncMinion, Sitecore.Commerce.Plugin.SAP was not found.","CommerceTermKey":"MinionNotFound"
– Hussain
Aug 8 at 8:40
did you bootstrap your commerce engine?
– Vlad Iobagiu
Aug 8 at 9:21
HI Vlad, Yes I did. I am getting the below error in "CommerceMinions" IIS website log file.[MinionStartup] Environment='HabitatMinions', 'Sitecore.Commerce.Plugin.SAP.Minion, Sitecore.Commerce.Plugin.SAP' 11 05:17:38 ERROR Pipeline completed with error System.Exception: Error processing block: Core.block.StartEnvironmentMinions ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null
– Hussain
Aug 8 at 9:32
The problem with wrong assembly name added in Minion config file. Now this is working as expected.
– Hussain
Aug 9 at 6:29
Great, glad I could help you
– Vlad Iobagiu
Aug 9 at 6:32
I tried to hit the Minion from Postman and i got the below error. "MessageDate":"2018-08-08T08:32:41.4097457Z","Code":"Error","Text":"Minion Sitecore.Commerce.Plugin.SAP.Minion.SAPProductSyncMinion, Sitecore.Commerce.Plugin.SAP was not found.","CommerceTermKey":"MinionNotFound"
– Hussain
Aug 8 at 8:40
I tried to hit the Minion from Postman and i got the below error. "MessageDate":"2018-08-08T08:32:41.4097457Z","Code":"Error","Text":"Minion Sitecore.Commerce.Plugin.SAP.Minion.SAPProductSyncMinion, Sitecore.Commerce.Plugin.SAP was not found.","CommerceTermKey":"MinionNotFound"
– Hussain
Aug 8 at 8:40
did you bootstrap your commerce engine?
– Vlad Iobagiu
Aug 8 at 9:21
did you bootstrap your commerce engine?
– Vlad Iobagiu
Aug 8 at 9:21
HI Vlad, Yes I did. I am getting the below error in "CommerceMinions" IIS website log file.[MinionStartup] Environment='HabitatMinions', 'Sitecore.Commerce.Plugin.SAP.Minion, Sitecore.Commerce.Plugin.SAP' 11 05:17:38 ERROR Pipeline completed with error System.Exception: Error processing block: Core.block.StartEnvironmentMinions ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null
– Hussain
Aug 8 at 9:32
HI Vlad, Yes I did. I am getting the below error in "CommerceMinions" IIS website log file.[MinionStartup] Environment='HabitatMinions', 'Sitecore.Commerce.Plugin.SAP.Minion, Sitecore.Commerce.Plugin.SAP' 11 05:17:38 ERROR Pipeline completed with error System.Exception: Error processing block: Core.block.StartEnvironmentMinions ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null
– Hussain
Aug 8 at 9:32
The problem with wrong assembly name added in Minion config file. Now this is working as expected.
– Hussain
Aug 9 at 6:29
The problem with wrong assembly name added in Minion config file. Now this is working as expected.
– Hussain
Aug 9 at 6:29
Great, glad I could help you
– Vlad Iobagiu
Aug 9 at 6:32
Great, glad I could help you
– Vlad Iobagiu
Aug 9 at 6:32
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsitecore.stackexchange.com%2fquestions%2f13196%2fhow-to-implement-a-sitecore-commerce-minion%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password