aubinf

Notification.Instances is null or count = 0 even if I have active notification

Discussion created by aubinf Champion on May 27, 2011
Latest reply on Jun 2, 2011 by dtakara

Hi everybody,

 

I'm integrating a Silverlight page into a process book using the Microsoft Web Browser control.

 

My Silverlight page display a summary of all active notifications (with nice animations ) of a specific AF database by calling a WCF json method.

 

Now in my dev env. everything is fine but in production env. the Notification.Instances is always null and when a trace the code and inspect the notification object, the exception object is assigned to a <>.

 

Here is my service method to get all active notifications :

 
        /// 
        ///   Gets all active notifications.
        /// 
        /// 
        public IEnumerable GetNotifications() {

            var notificationList = new ANNotificationList(AFNotification.FindNotifications(
                AFDB(),
                "*",
                AFSearchField.Name,
                AFSortField.Name,
                AFSortOrder.Ascending,
                100));

            notificationList.InstanceEvent += NotificationListInstanceEvent;
            var notificationInstances = notificationList.GetInstances();

            return (from notif in notificationInstances
                    where notif.Instances != null && notif.Instances.Any(n => n.IsActive)
                    select new PINotification() {
                                                    Name = notificationList.Notifications[notif.NotificationID].Name,
                                                    Description =
                                                        notificationList.Notifications[notif.NotificationID].Description,
                                                    ErrorInfo =
                                                        notificationList.Notifications[notif.NotificationID].
                                                        ErrorMessage,
                                                    Status =
                                                        notificationList.Notifications[notif.NotificationID].Status.
                                                        ToString(),
                                                    IsActive = true,
                                                    Since =
                                                        notif.Instances.Where(n => n.IsActive).First().StartTime.
                                                        LocalTime
                                                });

        }

        static void NotificationListInstanceEvent(object sender, ANInstanceEventArgs e) {
            //NotImplementedException();
        }

 

 

Now this function always return nothing because notif.Instances is always null or count = 0 even if I have active notification (verified in PI System Explorer). 

 

Anyone have an idea where I could look at ???

 

 

Outcomes