4

I have created a Custom Minion and added it in Habitat Minion environment json file. I wanted to create a separate patch file for my custom minion.

Any suggestions on how to do that?

1 Answer 1

3

It's pretty simple.

Put this part of configuration to your Habitat Minion JSON file in Policies values:

{
        "$type": "Sitecore.Commerce.Core.PolicySetPolicy, Sitecore.Commerce.Core",
        "PolicySetId": "Entity-PolicySet-{your_policy_name}PolicySet"
      },

Create a separate JSON file with your configuration and paste configuration like:

{
  "$type": "Sitecore.Commerce.Core.PolicySet, Sitecore.Commerce.Core",
  "Id": "Entity-PolicySet-{your_policy_name}PolicySet",
  "Version": 1,
  "IsPersisted": false,
  "Name": "{your_policy_name}PolicySet",
  "Policies": {
    "$type": "System.Collections.Generic.List`1[[Sitecore.Commerce.Core.Policy, Sitecore.Commerce.Core]], mscorlib",
    "$values": [
      {
        "$type": "Plugin.Habitat.{ProjectName}.Policies.{your_policy_type}, Plugin.Habitat.{ProjectName}",
        "YourPropertyName": "ABC"
      }
    ]
  }
}

After that publish your changes and run Bootstrap()

1
  • 1
    When I configure my minion in the environment json, I can use the RunMinion API call to invoke the minion, but if I define it in a policy set in a separate file, I get MinionNotFound. I have simply copied the minion definition to the policy set so the namespace should be okay. And I have bootstrapped the engine. Any ideas?
    – ebug
    Commented Nov 21, 2018 at 10:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.