In Sitecore 8.2
there is a dll named Sitecore.Analytics.Automation
and it contains the below properties:
public class AutomationRuleContext : RuleContext
{
public AutomationRuleContext();
public AutomationStateContext ContactState { get; set; }
public bool IsBackgroundUpdater { get; set; }
public string PageEventName { get; set; }
public PageEventItem PageEvent { get; set; }
public Item StateItem { get; set; }
public CurrentInteraction Visit { get; set; }
public Contact Contact { get; set; }
}
and implementation is used as below:
public class MyClass<T> : WhenCondition<T> where T : AutomationRuleContext
Existing project Sitecore 8.2 is using
public AutomationStateContext ContactState { get; set; }
properties in the Execute method
.
The Execute
method is in the WhenCondition
class as below:
public abstract class WhenCondition<T> : RuleCondition<T> where T : RuleContext
{
protected WhenCondition();
public override void Evaluate(T ruleContext, RuleStack stack);
protected abstract bool Execute(T ruleContext);
}
does anyone have an idea about AutomationRuleContext
and WhenCondition
, where it's moved in Sitecore 10.2
, and how can we use them in the Sitecore 10.2 project while migration?