PureConnect

 View Only
Discussion Thread View
  • 1.  How to trigger an handler

    Posted 05-01-2019 15:39
    Sorry for newbie question. I am trying to build a simple REST handler to call a RESTful web service. I got the example from here (https://github.com/GenesysPureConnect/RestThroughHandlers)

    And I like to do a quick test that it can call the RESTful web service. From Interaction Designer I saw this "manage handler" option (for me it's greyed out), is this the only place that's possible to trigger the handler?

    Thanks,
    Minjie 








    #Handlers

    ------------------------------
    Minjie Xu
    Ascension
    ------------------------------


  • 2.  RE: How to trigger an handler

    Posted 05-01-2019 15:45
    Edited by Aaron Lael 05-01-2019 15:45
    If you set the initiator to "Custom Notification" (or if it is a subroutine, make a calling handler that is initiated by custom notification) and configure it with a object and event value, you can use the sendcustomnotification.exe tool in the server directory of your IC server to trigger it from the command line.  Here's the help blurb from the command line:

    D:\I3\IC\Server>SendCustomNotification.exe /?
    Purpose: Send a Custom Notification to the Enterprise Interaction Center
    Usage: SendCustomNotification [/N=<server>] ObjectID EventID ["Data", ...]
    Where: ObjectID is a string identifying the Notification Object
    EventID is a string identifying the Notification Event
    Data is zero, one or more strings
    <server> is the name of the EIC server to receive this notification

    That should help if I'm understanding you correctly.

    ------------------------------
    Aaron Lael
    State of Utah
    ------------------------------



  • 3.  RE: How to trigger an handler

    Posted 05-01-2019 16:01
    Thank you, Aaron.

    It seems I need to get the IC server installed locally on my laptop. Right now I only have Interaction Designer.

    ------------------------------
    Minjie Xu
    Ascension
    ------------------------------



  • 4.  RE: How to trigger an handler

    Posted 05-01-2019 16:05
    If you don't have access to the IC server, you can also use the ICWS api to trigger a handler.

    This is the ICWS documentation for communicating with handlers.  You still need to have a handler initiated by a custom notification, though, so the first part of my previous post still applies.

    ------------------------------
    Aaron Lael
    State of Utah
    ------------------------------



  • 5.  RE: How to trigger an handler

    Posted 05-02-2019 11:39
    Not to beat the dead horse, so if I use the ICWS, I still need some sort of access to the IC server (some permissions), right? Right now I can only get two WS calls working, create connection (POST) and get connection features. The rest don't work for me, e.g., send notification (POST) and get languages (GET). The most common error I received is:

    {
    "errorId": "error.request.accessDenied.invalidSession",
    "alternateHostList": [],
    "errorCode": 7,
    "message": "A session ID was provided with the request, but it is invalid or the session has already been closed."
    }

    ------------------------------
    Minjie Xu
    Ascension
    ------------------------------



  • 6.  RE: How to trigger an handler

    Posted 05-02-2019 13:12
    I wouldn't call this horse dead just yet.

    Sending a handler notification requires surprisingly little permissions, and if your account has access to create and publish handlers for your environment I'd wager you've met the criteria.  I'd suspect, from that error, that your request is malformed.  I would validate that your connection request is returning a cookie, csrf token and session ID and that you are using all three in your subsequent requests.

    ------------------------------
    Aaron Lael
    State of Utah
    ------------------------------



  • 7.  RE: How to trigger an handler

    Posted 05-21-2019 12:25
    Now I was able to send in the request via POST, and it returned http code 202. Where in the Interaction server can I look for the logs whether this has been processed or not? Thanks again.

    I was also reading the doc (the explanation of code 202 is similar to the description below).
    /icws/{sessionId}/system/handler-notification
    Sends a notification to one or more custom handlers that are watching for the objectId and eventId pair on their initiator.

    Due to the nature of custom handlers, the server does not provide any guarantee that the notification is handled or results in any side-effects.

    ------------------------------
    Minjie Xu
    Ascension Health – IS, Inc.
    ------------------------------



  • 8.  RE: How to trigger an handler

    Posted 05-21-2019 12:28
    If you're looking for confirmation that your handler was triggered by your ICWS call, just throw the handler into debug mode and then make the call.  You'll see it become active and able to step through if your call was successful.

    ------------------------------
    Aaron Lael
    State of Utah
    ------------------------------



  • 9.  RE: How to trigger an handler

    Posted 05-21-2019 17:18
    Thank you, Aaron.

    So I will need to see those info in the Interaction Server on the Windows server, correct? I cannot see it from the Interaction Designer. It seems like I will still need the right to public / debug the handlers.

    ------------------------------
    Minjie Xu
    Ascension Health – IS, Inc.
    ------------------------------



  • 10.  RE: How to trigger an handler

    Posted 05-21-2019 17:51
    Hi,

    Handlers are executed exclusively by a subsystem (Interaction Processor) that forms part of the CIC server. Interaction Designer is simply an IDE to allow you to develop Handlers, but it cannot, on its own, execute them.

    When you run a Handler in debug mode (which, BTW, should NEVER be done on a Production system!) then the Handler is actually being run on the Server and Designer is merely providing monitoring capabilities. You can think of it like remote debugging a Web Application running on a web server. Yes, this is controlled by security settings.

    I would strongly advise you to attend the ICHD training class. This is available both in-person and as a web-based Instructor-led course. In this class, we go over the basics of how Handlers work, how to customize them in a supportable manner, how to use the Debugger etc.

    HTH


Need Help finding something?

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