GetActiveInstances() method of ANNotificationList does not return anything

Discussion created by MBanchuzhnyy on Apr 10, 2014
Latest reply on Apr 24, 2014 by Mike Zboray

Good morning everyone!


We've just experienced strange issue. In our application we retrieve list of active notifications using common algorithm (that was mentioned in vcampus many times):

// 1. Get all notifications using filter 
ANNotificationList notificationList = new ANNotificationList(AFNotification.FindNotifications(myDatabase, "", filteredCategory, null, AFSortField.Name, AFSortOrder.Ascending, 10000));

// 2. Extract Notification instances using given timeframe or extract active notifications
List<ANNotificationInstances> notificationInstances = notificationList.GetInstances(new AFTime(StartTime), new AFTime(EndTime));

// or for active – DOES NOT WORK!
List<ANNotificationInstances> notificationInstances = notificationList.GetActiveInstances();



 does not return anything. The most interesting thing that sometime it works, and sometime it doesn't. We were not able to figure out what does influence on it. We have other test machine with old PI NOtifications installed (version 1.2.1205.6 ) and there is no any problem there. The version of Pi Notifications on machine where we have problem is 1.2.1205.10. We downgraded version to 1.2.1205.6, and probably accidentially method started to work, but today morning we again see no Active notifcations using GetActiveInstances() method.




 If I use 

notificationList.GetInstances(new AFTime(StartTime), new AFTime(EndTime));

 then I can find notifications using its Id and AFNotification class from AF SDK. Then filter them using property IsActive like this:

foreach (ANNotificationInstances instance in notificationInstances)           {
    AFNotification notification = AFNotification.FindNotification(mySystem, instance.NotificationID);
    // get metadata
    foreach (var item in instance.Instances)
              if (item.IsActive == true)

It supports that there are active notifications in the system.




Has anybody seen something similar?


Thank you.