PureEngage On-Premises

 View Only

Sign Up

  • 1.  How to use IConfigurationService SubscribeNotification Method?

    Posted 05-27-2015 15:47
    Hi,

    I need to write a WDE Custom module that is able to receive agent skill update notification, i saw that the SubscribeNotification in subject could help me but i can't find any example or sample that use it and i really don't understand how to invoke it.
    More specificaly:
    • ?ICfgObject CfgObject...Is it my agent's skill? is it a new instance of CfgSkill in my case??
    • object asker...What is it? a new EventHandler? My own class?  a reference of something else?
    • the Subscription return value...what to do with it?
    I'm pretty new abt WDE customization as you can understand...
    Please help.

    Thanks,

    Carlo


  • 2.  RE: How to use IConfigurationService SubscribeNotification Method?

    Posted 07-21-2015 16:03

    Hello,

    You need to subscribe for an event from Configuration Server and implement your EventHandler which handles skill modification related events. For this please consider "Handling Events" chapter in Platform SDK Developer's Guide.

    Interaction events can be handled at several levels of the customization stack: Workspace, ESDK, PSDK.
     
    The most straightforward is Workspace level:

    Use event handler IInteractionManager.InteractionEvent


    Or at PSDK level:

    IChannelManager channelManager = container.Resolve<IChannelManager>();
    tserverChannel = channelManager.Register(<TServerName>, "MyClientName");
    tserverChannelchannel.RawSubscriber.SubscriptionBroker.Register<IMessage>(this.HandleTEvent);

    Please refer to "Extension Samples", they provide developers with examples of various use cases. Genesys recommends that you examine the samples before making changes to Workspace Desktop Edition.

    Example of registering an event handler:

    // The start of your extension module public void Initialize()
     {
       // ... container.Resolve().Subscribe(MyEventHandler);
     } 

    Example of event handler:
    void MyEventHandler(object eventObject)
            {
                string eventMessage = eventObject as string;
                if (eventMessage != null)
                {
                    switch (eventMessage)
                    {
                        case "Login":
                            container.Resolve<IInteractionManager>().InteractionCreated += ExtensionSampleModule_InteractionCreated;
                            break;
                        case "Logout":
                            viewEventManager.Unsubscribe(MyEventHandler);
                            container.Resolve<IInteractionManager>().InteractionCreated -= ExtensionSampleModule_InteractionCreated;
                            break;
                    }
                }
            } 

    Roman T