jrapin

AFnotification updated but no notification raised

Discussion created by jrapin on Apr 20, 2012
Latest reply on Apr 30, 2012 by mhamel

Hello everybody,

 

I try to update an AFNotification, the configuration is correctly updated in PI-AF, but the notifications instances are not updated until I restart the Notification service (in windows services / restart service).

 

Actually, i've a configuration that correspond to a warning level, with an instance raised. I update the configuration to make the notification to a non raised level. I save it, the configuration is OK, but the instance is still marked as active despite the fact that all the conditions return false in the configuration ...

 

Here is a example of my code, the notif object is an AFNotification :

 
   notif.CheckOut(); 
 
                //TODO : confirm the systematic delete  ?
                //Clear all precedent rules
                AFUtil.ClearRules(notif);
 
                SaveAnalysis(notif);
                SaveTimeRule(notif);
 
                notif.ApplyChanges();
                
                notif.CheckIn();
                notif.Database.CheckIn(AFCheckedOutMode.ObjectsCheckedOutThisSession);
 
                notif.Refresh();
             
                if (IsEnabled)
                {
                    notif.Status = AFStatus.Enabled;
                    ANNotification.StopNotification(notif);
                    ANNotification.StartNotification(notif);
                }
                else
                {
                    notif.Status = AFStatus.Disabled;
                    ANNotification.StopNotification(notif);
                }
Does anyone have an idea concerning my code ? What's wrong ? 
Thanks for your replies ....
Best regards, 
Jean

Outcomes