PureConnect

 View Only
Discussion Thread View
  • 1.  Send custom notification

    Posted 02-13-2014 13:42
    Hello, i am trying to catch the response sent from Send Custom Notification toolstep from handler in my web application. But not sure how to do it. can anybody please share an example how to catch the response. i Have the following code: CustomNotification notification = new CustomNotification(session); CustomMessageHeader header = new CustomMessageHeader(CustomMessageType.ServerNotification, strObjectID, strEventID); CustomRequest request = new CustomRequest(header); string[] arr = { strPhone, strData }; request.Write(arr); notification.SendServerRequest(request); I need to capture the response from the handler in my application. Please help! Thanks in advance. Shilpa


  • 2.  RE: Send custom notification

    This message was posted by a user wishing to remain anonymous
    Posted 02-14-2014 19:15
    Hello, Hopefully I can offer you some help. :) I'm working in CIC 4.0, so you may have to change a few things if you're on a different version. If I understand the question correctly, you want to communicate from your handler to an IceLib application. To do this, you'll need to start a watch for a particular header. Modifying your code, it would look something like: CustomNotification notification = new CustomNotification(session); notification.CustomNotificationReceived += notification_CustomNotificationReceived; // This will call this method when the response comes back. CustomMessageHeader responseHeader = new CustomMessageHeader(CustomMessageType.ServerNotification, responseObjId, responseEventId); notification.StartWatching(new CustomMessageHeader[] { responseHeader }); CustomMessageHeader header = new CustomMessageHeader(CustomMessageType.ServerNotifi cation, strObjectID, strEventID); CustomRequest request = new CustomRequest(header); string[] arr = { strPhone, strData }; request.Write(arr); notification.SendServerRequest(request); Note that you will have to define an object response id and event id. You'll also have to create the method for the call back in your class. See below: private void notification_CustomNotificationReceived(object sender, CustomNotificationReceivedEventArgs e) { // Insert Response Logic Here. string[] customDataList = e.Message.ReadStrings(); // This is a list of strings that you provide the 'Send Custom Notification' tool step. } Now that you have that, you will need to go to you handler. Under the System tab you will find a "Send Custom Notification". Populate the inputs so that they match the response object id and event id you just specified in your IceLib application. That should be all there is to it! But I would recommend you make the CustomNotification object a field in your class so that you can call StopWatching() to properly close things down. Hopefully this helps, it's a Friday so my mind might be a bit jumbled. :p


Need Help finding something?

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