Sitecore 8.1 U3

I am trying to fetch customer details from BI and pushing them to sitecore by creating customer items with the necessary details. Each of these customers should be enrolled in an engagement plan when we push/create the customer item in sitecore.

Using WCF service on CM server which creates the customer item and using the below code to programatically enroll the contact in engagement plan as there wont be contact in session to use. Took inspiration from https://maigruen.netzkern.de/use-sitecore-analytics-from-wcf-service.aspx

  if (!Tracker.IsActive) { Tracker.StartTracking(); }
 var siteContext = scConfig.Factory.GetSite("dev");
        using(var context = new SiteContextSwitcher(siteContext))
            var managerInContext = 
managerInContext.EnrollInEngagementPlan(engagementPlanId, engagementPlanStateId);

I have also tried creating contact using contactRepository and used the below but dint work either.

var manager = AutomationStateManager.Create(contact);
            manager.EnrollInEngagementPlan(engagementPlanId, engagementPlanStateId);

However, I am getting the contact created in xDb but the automation states are not being set for the contact with the engagement plan.

Any thoughts around this would be appreciated.

Thanks Sri

1 Answer 1


Calling manager.SaveChanges(AutomationManager.Provider) after enrolling user to the plan made the automation transitions work as expected.

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.