1 of 1 people found this helpful
You can use the following code snippets to change the time rules for notification. (Note that notf is an AFNotification)
To change to a periodic time rule with a frequency for 5 minutes and 0 offset:
notf.Analysis.TimeRulePlugIn = myAF.TimeRulePlugIns["Periodic"]; notf.Analysis.TimeRule.ConfigString = "Frequency=300"; notf.CheckIn();
To change to a natural time rule:
notf.Analysis.TimeRulePlugIn = myAF.TimeRulePlugIns["Natural"]; notf.CheckIn();
For more information about time rules, you can refer to the blog post Creating Asset-Based Analytics Programmatically (Rollup and Event Frame Generation) under "Natural and Periodic Time Rules". Both asset-based analysis and notifications should be using the same time rule plugins, hence the configuration is similar.
EDIT: To programmatically start/stop notifications, look into the ANNotification.StartNotification and StopNotification methods.
Thank you Daphne this is what I was looking for