AnsweredAssumed Answered

AFAnalysisService.QueryRuntimeInformation Methods

Question asked by Samit.Pise on Dec 17, 2019
Latest reply on Dec 17, 2019 by sraposo

Hi Team,

 

I am trying to get data from AFAnalysisService.QueryRuntimeInformation Methods, but this method returns me zero rows. Please find my code,

 

static void Main(string[] args)
{
PISystems afservers = new PISystems();
var afserver = new PISystems()["bripld-s-8058.asia-pac.shell.com"];
var analysisservice = afserver.AnalysisService;
var afdb = afserver.Databases["Equipment Health Monitoring"];
var afelement = AFElement.FindElements(afdb, afdb.Elements["QGC"], "BLD_WH149", AFSearchField.Name, true, AFSortField.Name, AFSortOrder.Ascending, 1);
DataTable table = new DataTable();
table.Columns.Add("name");
table.Columns.Add("template");

foreach (var element in afelement)
{
List<AFAnalysis> analyses = new List<AFAnalysis>();
var x = analysisservice.QueryRuntimeInformation("status:= 'running' lastEvaluationStatus:='Skipped'", "path template");
foreach (var y in x)
{
DataRow r = table.NewRow();
r["name"] = y[0];
table.Rows.Add(r);
}
var analysis = element.Elements["Separator"].Analyses["SeparatorLevel"];
analyses.Add(analysis);
analysisservice.QueueCalculation(analyses, new AFTimeRange("*-1d", "*"), AFAnalysisService.CalculationMode.FillDataGaps);

}

Outcomes