I haven't tried this myself but looking at the AF SDK reference, my impression is that you could get an AFEventFrame from the AFNotificationRule.ContentExample Property and than get the AFEventFrame.Analysis Property.
However, Mike is passing the AFAnalysis.Name to the AFNotificationRule.Criteria in his example about how to Configure a Notification via AF SDK, so reading the Criteria property may work too but I would assume you don't want to Replace it.
Thanks for your answer.
I tried using ContentExample but it always returns null...
Any other suggestions?
"ContentExample" already suggested an optional property.
Yeah, the AFNotificationRule.Criteria Property returns the search criteria to for the AFEventFrame that triggers the creation of the AFNotificationRule. The AFEventFrame.Analysis Property gives you the Analysis which created the AFEventFrame.
1 of 1 people found this helpful
There is no direct linkage between the notification rule and the analysis in AFSDK. The best way to get it is to parse the criteria and look for the "AnalysisName" token:
var tokens = AFEventFrameSearch.ParseQuery(el.NotificationRules.Criteria);
var token = tokens.FirstOrDefault(t => t.Filter == AFSearchFilter.AnalysisName);
if (token != default(AFSearchToken))
string name = token.Value;
AFAnalysis analysis = el.Analyses[name];
Thanks, Mike, that is much cleaner way than what I was going to do