How to catch events triggered from openframe in topframe (ServiceNow)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2022 02:44 AM
Dear community,
we are trying to use an openframe to show Genesys call center interface.
The initial setup is working fine: We can load within openframe the Genesys call center interface, make phone calls, etc.
But now we would need to capture the events triggered from this openframe into ServiceNow.
Example: When a phone call is received and answered from the call center, an interaction task should be created in ServiceNow.
However, we cannot find specific documentation which could explain how to do this.
Can you please provide help on this?
Thanks in advance for your help.
Regards,
Alex.-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2023 02:22 PM
I have been fighting a custom configuration for over a year now with this being an issue- as well as tracking login etc. You will need to handle the events from your webApp in your Ui Page that is loaded into the openFrame. In our application- we use GlideAjax/getXMLAnswer to pass data back and forth. It isn't a proper event handler necessarily, but it works reasonably well. The issues we have had pertain to session tracking/sync mostly. AWS Connect (our integration) is good about handling the events and the workers/API are pretty well structured to manage multiple instances of the app etc, but the present issue is the other way around for me- it's communicating from SN into the "openFrame". Now imagine this- you get kicked out of SN but your webapp is still running- then a call comes in- it triggers a callback then realizes that your session isn't logged in with SN and now you've lost your page permissions as well, so notifications and audio also don't work. There's some serious issues and limitations with openFrame. All I can say is with the UI page- treat it like your own website. Had to use DOM manipulation just to make the thing sizeable/moveable in Agent Workspace. (Come on... you'd think that one would be common sense. HI said it can't be done and they don't plan to implement it.)
Example of one of the callbacks that executes-- that I use to track and save the size of the agent's phone when they resize it. This one runs immediately before openFrame inits There's some other oddities to be aware of with openFrame as far as how it loads/is rendered, particularly in agentWorkspace. (it is a good bit different as it's a react component in Workspace) If I can help lemme know.
var getSize = function() {
var aja = new GlideAjax('U_connect_CTI_ajax');
aja.addParam('sysparm_name', 'getSize');
aja.addParam('sysparm_snUser', window.NOW.user.userID);
aja.getXMLAnswer(function(response){
console.info('---response from getSize Ajax: ', JSON.parse(response));
response = JSON.parse(response);
height = parseInt(response.height);
width = parseInt(response.width);
config = {
height : height,
width : width,
};
console.info(config, height, width);
});
};
Essentially you can perform typical DOM/HTML targeting and manipulation through Window.Top etc.
You really don't have much access to SN APIs from the OpenFrame other than what is built in. For agent workspace you can use the URL parsing/params combined with the openFrame API for a lot of nav/tab related stuff. That DOES work well.
I'm working on communication between the two that is a bit more effective. As of now I can't even get the CustomEvent "openframe_communication" to trigger in my UI script.
If you need to do form manipulation, that stuff is easiest done from client script/g_scratchpad if you can't do it from serverSide AJAX functions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 04:05 AM
Dear zeeOh,
first of all thank you for providing feedback on this. Actually the documentation about how to implement openframe in ServiceNow shines by its absence.
We have found also a workaround for doing this which I'd like to share with you, just in case you will find it helpful:
* We're using custom widget where we have embeded the call center client as iframe within html section.
* This widge has been also added to a specific page.
* In openframe configuration we have created an entry where just add as URL the page and the widget with a relative path (in our case it would be "openframe_portal?id=openframe_page")
* To ensure this is working fine, you have to add to the widget dependencies the openframe.min.js whose relative path is "/scripts/openframe/latest/openFrameAPI.min.js" to ensure that every update over this library is taken.
Once done all of above, from our widget client side we are able to capture events coming from the client call center adding a event listener as well as calling the openframe functions. All the database actions can be done from server side.
I don't think this is the best approach but doind this at least you let the openframe configuration doing the basic setup for the child frame.
Hope this helps.