1 Reply Latest reply on Jan 2, 2017 6:14 AM by jyi

    Need help on how to adjust timetrue value

    mikespath

      Hello folks:

      I have made some progress on setting the timetrue value in a notification rule that I created through the AFSDK

           var pe = analysis.AnalysisRule.AnalysisRules.Add(system.AnalysisRulePlugIns["PerformanceEquation"]);

                  pe.ConfigString = "@group(\"Start triggers\") @timetrue(\"44\") @severity(\"Warning\")\nStartTriggerMy:= 'sinusoid' > 50;";

                  analysis.TimeRulePlugIn = system.TimeRulePlugIns["Natural"];

                  analysis.SetStatus(AFStatus.Enabled);

      I'm trying to find a way to change this value via the SDK

       

      Below is a snipet of the code I have but I know it's not correct:

       

                  AFAnalysisSearch search = new AFAnalysisSearch(db, "NotificationsExample", string.Format(@"Target:'{0}'", element.GetPath()));

                  search.CacheTimeout = TimeSpan.FromMinutes(10);

                  int count = search.GetTotalCount();

                  foreach (var item in search.FindAnalyses(fullLoad: true))

                  {

                      item.TimeRulePlugIn = MyPISystem.TimeRulePlugIns["timetrue"];

      ...

      Attached is a screenshot of what I'm trying to change

       

      Any guidance will be helpful.  Thank you.