• Not Answered

Creating a custom listener/decision point for Marketing Automation Plan

I'm attempting to understand how to create a custom feature for Marketing Automation, so I started by creating a simple "Hello, World" style condition that just returns true, so I can see it run through the plan...

 

I created the simple class, inheriting from ICondition:

namespace CSDemo9.Libraries.Predicates.Rules
{
	public class SampleRule : ICondition
	{
		public bool Evaluate(IRuleExecutionContext context)
		{
			var stuff = context;
			Log.Info(context?.ToString() ?? "NULL", this.GetType().FullName);

			return true;
		}
	}
}

And added the config file to automation settings, registering the rule:

<Settings>
    <Sitecore>
        <XConnect>
        <Services>
            <DescriptorLocator>
            <Options>
                <PredicateDescriptors>
                   <RequestedProductIsInStock>
                        <id>{FA926D5F-793B-48BB-AC6B-2DBF39AE21E1}</id>
                        <type>CSDemo9.Libraries.Predicates.Rules.SampleRule, CSDemo9.Libraries.Predicates</type>
                    </RequestedProductIsInStock>
                </PredicateDescriptors>
            </Options>
            </DescriptorLocator>
        </Services>
        </XConnect>
    </Sitecore>
</Settings>

However, after registering the rule, the automation stops working and I get this exception in the log for the marketing automation:

Failed to create activity instance from type 'Sitecore.Marketing.Automation.Activity.CustomListener, Sitecore.Marketing.Automation.Activity, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'
System.ArgumentException: Problems processing configuration-based DescriptorLocators.  1 error(s) encoutered : 
Unable to resolve type for Predicate Descriptor with Id - 'fa926d5f-793b-48bb-ac6b-2dbf39ae21e1'

I did deploy the dll for my class to both the site root bin and the marketing automation folder. I tried deploying it to the parent xconnect folder too to see if that would help but it didn't. It seems like I'm missing something but I'm not sure where else I should deploy this or if that is even the problem.

I also registered the condition in the content tree, pointing to the same library, and the ID of that item is the same as the config above...

How can I troubleshoot this, so that I can resolve this issue and my plan can see my type?

2 Replies