cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4255
Views
0
Helpful
15
Replies

Javascript SystemInfo Example

kpickard
Level 5
Level 5

dlender do you have an example javascript gadget that uses the SystemInfo object? The init() format is different that the other Finesse objects and I have been unable to get a working example (probably missing something simple). I can instantiate an object but I never get any callbacks. Also if I call isLoaded() on the object it just fails (rather than returning false). I can call some methods on the object but only those that do not call isLoaded(). Any help would be appreciated. Thanks.

15 Replies 15

dlender
Level 6
Level 6

I got SystemInfo  working in a sample by searching the Finesse desktop script for SystemInfo and copied the instantiation which is:

systeminfo = new finesse.restservices.SystemInfo("",{

    onLoad: _handleSystemInfoLoad,

    onChange: _handleSystemInfoChange

    });


Thank you David (dlender). I knew it had to be something simple I missed and it was. I had not initialized ClientServices properly (I had missed it in this test gadget). It is working now although getThisHost() is still returning 'undefined' for me (still looking at it).

By the way the "" is needed because the prototype differs from the standard ones (for all the other Finesse objects) in that it expects "id" as the first parameter followed by the callback object and an option parent object.

The gadget I originally posted has an old version of the finesse.js in it so I am posting a new version on this post which demonstrates all the SystemInfo methods.

David (dlender) do you know why the SystemInfo onChange callback is not called during a failover? Should it not reflect the temporary change in Status? Just curious.

I also just did a test where I took down the secondary server and then took down the primary server. The client continued to try to re-establish the connection for many minutes after first trying to switch to the down secondary. At no point was the onChange callback fired to let gadgets know that there was trouble in paradise. :-)

Eventually I brought the primary back up and all was good after it reconnected but there were no SystemInfo callbacks at all.

onChange callback will not be fired unless Finesse itself changed.

How can Finesse itself change the In Service status? Are you talking about if the Finesse server itself is up but the PG goes down?

See Chapter 8 of the Finesse WebServices Developer Guide on Finesse High Availability

Only the disconnection of CTI Server would cause a SystemInfo update for Finesse OUT_OF_SERVICE

Hi dlender. My name is Eric and I saw your post and tried to use the sample script that you posted here. I put it in the finesse 3rdpartygadget folder and change the finesse desktop layout to add this gadget. When I logged into finesse, I could see this gadget appearing, however, it only showed the labels “System Info” without the actual system info details, have I missed out any steps or is there any specific condition that the info will appear? I tried changing the agent state, reloading the finesse etc but still couldn’t see anything? Appreciate it if you can provide some clues to me. Thanks a lot!

Hi dlender. My name is Eric and I saw your post and tried to use the sample script that you posted here. I put it in the finesse 3rdpartygadget folder and change the finesse desktop layout to add this gadget. When I logged into finesse, I could see this gadget appearing, however, it only showed the labels “System Info” without the actual system info details, have I missed out any steps or is there any specific condition that the info will appear? I tried changing the agent state, reloading the finesse etc but still couldn’t see anything? Appreciate it if you can provide some clues to me. Thanks a lot!

Hi,

 

The code that dlender posted was from 2014 and there has been changes to the gadget make up since then. Therefore that is probably why you are not seeing the content of the SystemInfo.

 

I don't remember off the top of my head which version was available in 2014, but this may be of some help: https://community.cisco.com/t5/collaboration-blogs/how-to-convert-your-existing-10-5-1-custom-gadget-to-work-with/ba-p/3657841

 

Although there isn't a sample gadget for systeminfo itself, here are sample gadgets for other purposes: https://github.com/CiscoDevNet/finesse-sample-code

 

You can look at how the gadget make up is different and adjust accordingly.

 

Thanx,

Denise

Hi Denise.

Thanks for the precious advice given. Appreciate it if you could give me some idea if we can “catch” the Cisco Finesse Lost Connection which is shown at the top of the finesse (in Red) when there is a lost of connection to the Finesse server? Currently we have a custom finesse gadget for the screen pop and it is done using Finesse Javascript. The whole idea is to detect the lost connection and to perform some exception handling on it.

Eric,

 

The External Reset API Sample Gadget uses the Finesse System Info API.

Here it is:

https://github.com/CiscoDevNet/finesse-sample-code/tree/master/ExternalRestApiSampleGadget

 

And here are the other sample gadgets:

https://developer.cisco.com/docs/finesse/#!sample-gadgets/sample-gadgets

 

Gerry

Hi,

 

Appreciate it if you could give me some idea if we can “catch” the Cisco Finesse Lost Connection which is shown at the top of the finesse (in Red) when there is a lost of connection to the Finesse server? Currently we have a custom finesse gadget for the screen pop and it is done using Finesse Javascript. The whole idea is to detect the lost connection and to perform some exception handling on it.

All of the agents are subscribed to the SystemInfo events which will send the agent a notification of Finesse goes OUT_OF_SERVICE. This way you do not need to poll the SystemInfo API.

 

For the red banner on top, there is more logic to that than just listening to the SystemInfo notification. Basically, the SystemInfo notification will not notify if the notification service or Finesse tomcat goes down. As far as I know, a gadget cannot tap into that logic.

 

I have not used the SystemInfo notification in a gadget myself, but you might want to look at the SystemInfo JavaScript object: https://pubhub.devnetcloud.com/media/finesse/docs/guides/javascript-library/symbols/finesse.restservices.SystemInfo.html

 

Thanx,

Denise

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: