Genesys Engage on-premises

 View Only

Discussion Thread View
  • 1.  Unable to insert a command in Email chain

    Posted 07-31-2020 05:56
    Hello, I have to  modify WDE in order to call a Web Service whenever a mail is accepted by the agent. My first step has been to insert a new command in the Email chain that accepts the e-mail. Reading the documentation Documentation:IW:Developer:E-Mails:8.5.1 - Genesys Documentation it is not very clear which chain I should use that but my first guess has been "InteractionEmailLoad", so i have created the command (AfterAnswerMailCommand) and I inserted it with this code:

     commandManager.CommandsByName["InteractionEmailLoad"].Insert(0,
                      new CommandActivator() { CommandType = typeof(AfterAnswerMailCommand) });

    But whenever I receive an e-mail, my command code is never executed. I have tried other chains like "InteractionEmailActionOnOpenedEmailById" but the result is the same. I have done similar things with voice calls succesfully so I don't understand why this is not working in this case.
    #GenesysEngageDev

    ------------------------------
    Cristobal Espinosa
    Telefonica Soluciones de Informatica
    ------------------------------


  • 2.  RE: Unable to insert a command in Email chain

    GENESYS
    Posted 08-03-2020 04:54
    Hello,

    I haven't done a WDE customization for a while, and I didn't play/use the E-Mail chain of commands. But maybe the following info will help.

    1) Chain of command to try

    As you mention triggering a WebService when the agent accepts a new e-mail, you could possibly try with the ToasterInteractionEmailAccept chain of commands.
    Here: https://docs.genesys.com/Documentation/IW/8.5.1/Developer/Windows#scrollNav-5

    One advise though, make sure to make your WebService call non-blocking (async I mean). It is never good to block WDE execution (specifically when it is accepting/answering an interaction).

    2) Logs

    You probably know that already. But usually, when I try to figure out what WDE is doing exactly (what chain of commands it is calling in a specific scenario), I enable WDE logs and check there. The name of the chain of commands it invokes will appear in the logs.
    WDE log options: https://docs.genesys.com/Documentation/IW/latest/Dep/LogOptions
    There is also one for ESDK not listed in the link above: https://docs.genesys.com/Documentation/Options/Current/IW/WDE-interaction-workspace#log-ESDK

    I think log.verbose set to all should be enough for the chain of commands. Possibly log.ESDK as well if you don't see them.

    3) Customizing commands

    When you add views or commands, it is better to wait for WDE to fully initialize.
    Voice module is called almost immediately.
    But when you have a lot of additional modules (Email, chat, .... and custom ones), and when you try to add/modify a view or a command in these modules, it is better to wait for full "login" so that you are sure the modules have been loaded by WDE.

    I had written an article on this a while ago - with sample code to explain what I mean.
    See here: https://developer.genesys.com/workspace-desktop-edition-proper-time-to-add-views-and-commands-in-a-plugin/

    4) Another option

    Another way to achieve what you are trying to do would be to leverage IInteractionManager and subscribe for events there.
    IInteractionManager corresponds to WDE point of view on interactions. You will get interaction created when WDE creates one in its memory. And also Interaction related events (with media type, state/status, ...)

    Regards,

    ------------------------------
    Jerome Saint-Marc
    Genesys - Employees
    ------------------------------



  • 3.  RE: Unable to insert a command in Email chain

    Posted 08-07-2020 05:08
    Thank you Jerome, I finally went for option 4, I subscribed for the InteractionCreated event, then I check if the interaction is an Inbound E-mail, and in that case I recover the KVP I need and call the Web Service. Anyway as soon as I have it done I'll try to make a version about the Chain Command you suggest, since I want to understand how it works and get it done that way.

    Cheers

    Cristóbal

    ------------------------------
    Cristobal Espinosa
    Telefonica Soluciones de Informatica
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources