Genesys CTI User Forum

Genesys CTI User Forum => Genesys-related Development => Topic started by: CarloACN on May 26, 2015, 05:57:54 PM

Title: WDE 8.5 Customization How to receive event notification for Agent Skills update?
Post by: CarloACN on May 26, 2015, 05:57:54 PM
Hi all,

how can i receive and notify to the agent his skills update?

I tried using the IConfigurationService  in the following way:
this.configurationService.PropertyChanged += new PropertyChangedEventHandler(notifyPropertyChanged_PropertyChanged);
but the method notifyPropertyChanged_PropertyChanged is not invoked for the skills update.

I saw that the IConfigurationService  has the following methods:
[list]
[li]SubscribeNotification(Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.ICfgObject CfgObject, object asker);[/li]
[li]SubscribeNotification(Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.NotificationQuery notificationQuery, object asker);[/li]
[/list]

Can they help?
if yes how to apply those subscription?

Thanks a lot.

Carlo
Title: Re: WDE 8.5 Customization How to receive event notification for Agent Skills update?
Post by: daniel_san on May 27, 2015, 01:33:15 PM
[quote author=CarloACN link=topic=8873.msg39568#msg39568 date=1432663074]
Hi all,

how can i receive and notify to the agent his skills update?

I tried using the IConfigurationService  in the following way:
this.configurationService.PropertyChanged += new PropertyChangedEventHandler(notifyPropertyChanged_PropertyChanged);
but the method notifyPropertyChanged_PropertyChanged is not invoked for the skills update.

I saw that the IConfigurationService  has the following methods:
[list]
[li]SubscribeNotification(Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.ICfgObject CfgObject, object asker);[/li]
[li]SubscribeNotification(Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.NotificationQuery notificationQuery, object asker);[/li]
[/list]

Can they help?
if yes how to apply those subscription?

Thanks a lot.

Carlo
[/quote]

I was trying to do something similar but it was not able.

You may try to get the groups who agent belongs.

Title: Re: WDE 8.5 Customization How to receive event notification for Agent Skills update?
Post by: CarloACN on May 27, 2015, 03:39:33 PM
Thanks daniel_san and Regard Miyagi san by me  ;D

Talking seriously...how to apply your advise? how to retrieve the agent group? my problem is that i need a notification of this update and not a simple retriev...
My biggest problem is that i dont understand how to invoke the SubscribeNotification method...what are the input parameter?
[list type=decimal]
[li]ICfgObject CfgObject...Is it my agent's skill? is it a new instance of CfgSkill in my case??[/li]
[li]object asker...What is it? a new EventHandler? My own class?  a reference of something else?[/li]
[li]the Subscription return value...what to do with it?[/li]
[/list]

Please Help...

Title: Re: WDE 8.5 Customization How to receive event notification for Agent Skills update?
Post by: cavagnaro on May 27, 2015, 04:54:17 PM
Usually you convert them to IMessages and then you can work with them. but now...a listener to an update...CfgServer propagates changes to all its clients. Maybe see what CfgServer sends when you do that change and try to capture that.

The fact you have a query means it limits what it listens...shouldn't be that...
Title: Re: WDE 8.5 Customization How to receive event notification for Agent Skills update?
Post by: daniel_san on May 28, 2015, 09:00:18 AM
[quote author=CarloACN link=topic=8873.msg39582#msg39582 date=1432741173]
Thanks daniel_san and Regard Miyagi san by me  ;D

Talking seriously...how to apply your advise? how to retrieve the agent group? my problem is that i need a notification of this update and not a simple retriev...
My biggest problem is that i dont understand how to invoke the SubscribeNotification method...what are the input parameter?
[list type=decimal]
[li]ICfgObject CfgObject...Is it my agent's skill? is it a new instance of CfgSkill in my case??[/li]
[li]object asker...What is it? a new EventHandler? My own class?  a reference of something else?[/li]
[li]the Subscription return value...what to do with it?[/li]
[/list]

Please Help...
[/quote]

Regards from miyagi  ;D

I didnīt konw that you can subscribe to skill events. Something new i know now  :)

I needed to do someting similar, Refresh Skills on Agent. I did it working with events of WD. For example on makecallcommand, i read directly the configuration of the agent on configuration manager to see what groups has the agent. The IAgent on constructor was not refreshing and i did it reading on configuration.

I donīt know if itīs usefull for you, i think that i can not help you  :(
Title: Re: WDE 8.5 Customization How to receive event notification for Agent Skills update?
Post by: Kubig on May 28, 2015, 11:27:10 AM
Notifications about configuration changes are distributed to the IWS/WDE client by default (driven by option). So, there must be existing part, where you are able to get these information. Just have never tried it.
Title: Re: WDE 8.5 Customization How to receive event notification for Agent Skills update?
Post by: CarloACN on June 05, 2015, 01:46:04 PM
Well...i hope it could be useful for someone else too...please find below the solution:

           
            readonly Genesyslab.Desktop.Modules.Core.SDK.Configurations.IConfigurationService configurationService;
          private Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Subscription subscriptionCFGSkill;
          private Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Subscription subscriptionCFGPerson;
                                        .
                                        .
                                        .
            this.configurationService.NecessaryNotificationAgainEvent += new EventHandler(this.configurationService_NecessaryNotificationAgainEvent);

            this.configurationService.ConfigService.Register(new Action<ConfEvent>(this.NotifConfigUpdateHandler));
            this.subscriptionCFGPerson = this.configurationService.SubscribeNotification(new NotificationQuery()
            {
                ObjectType = CfgObjectType.CFGPerson,
                TenantDbid = this.configurationService.WorkingTenant,
                ObjectDbid = this.agent.ConfPerson.ObjectDbid
            }, (object)this);
            this.subscriptionCFGSkill = this.configurationService.SubscribeNotification(new NotificationQuery()
            {
                ObjectType = CfgObjectType.CFGSkill,
                TenantDbid = this.configurationService.WorkingTenant
            }, (object)this);
                                                    .
                                                    .
                                                    .
            private void configurationService_NecessaryNotificationAgainEvent(object sender, EventArgs e)
        {
            if (this.subscriptionCFGPerson != null)
                this.subscriptionCFGPerson = this.configurationService.SubscribeNotification(new NotificationQuery()
                {
                    ObjectType = CfgObjectType.CFGPerson,
                    TenantDbid = this.configurationService.WorkingTenant
                }, (object)this);
        }
            private void NotifConfigUpdateHandler(ConfEvent message)
        {
            log.Debug("Agent Update check, Updated EventType: " + message.ObjectType);
            switch (message.ObjectType)
            {
                case CfgObjectType.CFGPerson:
                      .
                      .
                      .
                    break;
            }
        }

                                             
Title: Re: WDE 8.5 Customization How to receive event notification for Agent Skills update?
Post by: cavagnaro on June 05, 2015, 02:45:02 PM
Thanks a lot for sharing!  ;D
Title: Re: WDE 8.5 Customization How to receive event notification for Agent Skills update?
Post by: daniel_san on June 08, 2015, 12:34:52 PM
Great!  :D