public RuleTriggerExecutionContext GetExecutionContext(RuleTriggerData data) { RuleTriggerExecutionContext context = new RuleTriggerExecutionContext(); if (data.ContainsKey("UserId")) { int userId; if (int.TryParse(data["UserId"], out userId)) { var user = PublicApi.Users.Get(new UsersGetOptions() { Id = userId }); if (!user.HasErrors()) { context.Add(PublicApi.Users.ContentTypeId, user); context.Add(_triggerid, true); //Added this trigger so that it is not re-entrant } } } return(context); }
public RuleTriggerExecutionContext GetExecutionContext(RuleTriggerData data) { RuleTriggerExecutionContext context = new RuleTriggerExecutionContext(); if (data.ContainsKey("UserId")) { int userId; if (int.TryParse(data["UserId"], out userId)) { var user = PublicApi.Users.Get(new UsersGetOptions() {Id = userId}); if (!user.HasErrors()) { context.Add(PublicApi.Users.ContentTypeId, user); context.Add(_triggerid , true); //Added this trigger so that it is not re-entrant } } } return context; }