Created
November 29, 2016 15:37
-
-
Save BenGGolden/82fd9822afeec4d3cf9d54cc8d3d0942 to your computer and use it in GitHub Desktop.
Sitecore rule engine condition to determine if the current user is in a particular engagement plan state
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class IsInEngagementStateCondition<T> : WhenCondition<T> where T : RuleContext | |
| { | |
| public ID StateId { get; set; } | |
| protected override bool Execute(T ruleContext) | |
| { | |
| var automationStateManager = Tracker.Current.Session.CreateAutomationStateManager(); | |
| return automationStateManager.IsInEngagementState(StateId); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment