10

I have create a custom predicate according to the documentation: https://doc.sitecore.net/developers/xp/segmentation/create-a-custom-predicate.html

The rule has been defined in /sitecore/system/Settings/Rules/Definitions/Elements/My Rules/Custom Rule. The compiled DLL has been copied to XConnectFolder\App_data\jobs\continuous\AutomationEngine and an XML file has been generated and copied to XConnectFolder\App_data\jobs\continuous\AutomationEngine\App_Data\Config\sitecore\Segmentation\MyPredicates.xml.

After this, the Sitecore Marketing Automation Engine Windows service has been restartet.

I create a new autmation campaign, create a "Custom listener" which uses my predicate rule, and save the campaign. Then, I'm adding a contact to an automation campaign, but when I do this the following appears in the automation engine log file:

2018-11-26 16:33:54.460 +01:00 [Error] An error occurred during activity invocation for activity '890dc014-8e70-b4b4-d15a-6cc837f7c11a' in plan '2667589a-34b9-4f98-aad3-6d3f3075c8d6' DescriptorId : 9f3a44f4-179a-4d19-8583-14a8874e5bba Sitecore.XConnect.Segmentation.ExpressionBuilder.PredicateDescriptorException: No predicate descriptor was registered with Id '9f3a44f4-179a-4d19-8583-14a8874e5bba'.

Why does this error appear when the predicate has been registered in Sitecore and added to an Automation Engine XML file?

Sitecore 9.0.2

Edit:

This is the (obfuscated) XML used in the Segmentation folder.

<Settings>
  <Sitecore>
    <XConnect>
      <Services>
        <DescriptorLocator>
          <Options>
            <PredicateDescriptors>
              <MyRuleClassName>
                <id>{9F3A44F4-179A-4D19-8583-14A8874E5BBA}</id>
                <type>MyRuleNamespace.MyRuleClassName, MyAssembly</type>
              </MyRuleClassName>
            </PredicateDescriptors>
          </Options>
        </DescriptorLocator>
      </Services>
    </XConnect>
  </Sitecore>
</Settings>
  • Can you provide your XML file? You might also need to copy the predicates to Reference Data service. – Pete Navarra Nov 27 '18 at 3:48
  • @PeteNavarra Done. What is the "Reference Data service" ? – GTHvidsten Nov 27 '18 at 9:15
  • xConnect is made up of 5 services: Collection Index Service, Collection Search Service, Marketing Operations engine service, Marketing Reporting Service, and Reference Data Service. I don't know for sure, but it could be that the Marketing Operations engine is trying to do something with Reference Data. What I see above, everything looks right. – Pete Navarra Nov 27 '18 at 14:52
  • So either the namespace is wrong, or it's a problem with another service. You might poke around the other log files. In a single instance of xConnect all the roles are combined, except the windows services, it would just be the `XConnectFolder\App_data` instead of going into jobs. – Pete Navarra Nov 27 '18 at 14:52
  • I would also advise that maybe you hop on #marketing-automation channel on Sitecore Slack, and we can have more conversation about this to troubleshoot. Then we can arrive at an answer. – Pete Navarra Nov 27 '18 at 14:53
13

Turns out this had a really easy answer (after conferring with Sitecore Support).

XML-files for Automation Engine must have the prefix sc., so I renamed MyPredicates.xml to sc.MyPredicates.xml, and lo and behold the exception disappeared and my rules were executed without any problems.

Seeing as the documentation never mentions this, it is a very easy thing to overlook. The XConnect model, for instance, can have any name you desire (as long as it ends in .json), so it was definitely natural to expect this XML file to follow the same rules. The support technician agreed that this should be a part of the documentation and has sent a note to them, so hopefully they will add this.

  • This is an incredibly important find! Might I suggest a blog post? – Pete Navarra Dec 3 '18 at 15:41
  • @PeteNavarra Good idea! I'll try to type something down before the holidays :) – GTHvidsten Dec 3 '18 at 15:47
  • @GTHvidsten I was wondering if Sitecore Support also explained the reasoning behind this? – Steve McGill Dec 6 '18 at 14:01
  • @PeteNavarra Done: onceinawhitemoon.net/2018/12/… – GTHvidsten Dec 17 '18 at 17:45
  • @SteveMcGill Unfortunately they did not. Would be very interesting to know the rationale for this. Nowadays it seems like they have multiplied their development teams and having them not talk to eachother. – GTHvidsten Dec 17 '18 at 17:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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