cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1629
Views
25
Helpful
8
Replies

Finesse getNotificationConnectionState does not work

santhivinnakota
Level 1
Level 1

Hello DevNet Experts,

We are running Finesse 11.6 version and I have CRM Siebel/C360 integrated inside Finesse as an iFRAME. SO, when agent logs into Finesse, we also make the agent login into Siebel C360 which gets launched inside Finesse as an iFRAME. When call comes in, our code triggers the Siebel C360 to render with the caller information.

Now, the issues we are seeing are as below. For what ever reason, if Finesse "Automatically gets reloaded" i.e. due to a browser refresh and/or finesse failover etc, the Siebel C360 inside iFRAME gets to a blank page. Inorder to solve this, I am trying to check on a few attributes, to have teh Siebel C360 get to its home page. I am trying to get the Client Services getNotificationState and a State of Finesse anything other than Notready code id -1.  Whenever there is an automatic failover, I did see getNotificationConnectionState is going to "Connected" state. But, from my custom code, whenever I use "

finesse.clientservices.ClientServices.getNotificationConnectionState()" the code stops working.  Can I get some help in this regard?

 

Thanks,

Santhi

 

 

4 Accepted Solutions

Accepted Solutions

dekwan
Cisco Employee
Cisco Employee

Hi,

 

When you are using the finesse.clientservices.ClientServices.getNotificationConnectionState() method, is the ClientServices already initiated?

 

I suggest using the browser's developer tool and adding a breakpoint to see what the error is when it hits the finesse.clientservices.ClientServices.getNotificationConnectionState() method.

 

Thanx,

Denise

View solution in original post

Hi,

 

The init function does not have a return so using finesse.clientservices.ClientServices.getNotificationConnectionState() is the correct way. Did you use the browser's debugging to see what happens when this method is called? What is the error?

 

Thanx,

Denise

View solution in original post

Hi Denise,
Thank you. Sorry, I was out sick.
Either in developer logs or in persistent logs, I do not see any error at all. Code comes out and does not execute from this point simply. I don't see error.
I tried to use it inside init: to see what state it returns.
ONE pointer that can solve this issue is - Can you please tell me if there is an event in Finesse that distinguishes between a manual refresh and a automatic browser refresh?? If I can get an event that comes only during automatic browser refresh (or finesse failover), I can send an explicit Siebel C360 Refresh on receiving this event. Thank you.

------------------------------------------------------------
init : function() {
var cfg = finesse.gadget.Config;
clientLogs = finesse.cslogger.ClientLogger; // declare clientLogs
finesse.clientservices.ClientServices.init(cfg, false);
// alert ("Is this getting hit first?");
// Initiate the ClientLogs. The gadget id will be logged as a part of the message
clientLogs.init(gadgets.Hub, "Siebel APAC Gadget", finesse.gadget.Config);
clientLogs.log("Inside init"); --- > This gets shown in Client logs.
// clientLogs.log("NS is" +finesse.clientservices.ClientServices.getNotificationConnectionState()); --> After this line, nothing gets executed and no error.
user = new finesse.restservices.User({
id : cfg.id,
onLoad : handleUserLoad,
onChange : handleUserChange
});

containerServices = finesse.containerservices.ContainerServices.init();
containerServices.addHandler(
finesse.containerservices.ContainerServices.Topics.ACTIVE_TAB,
function() {
clientLogs.log("Gadget is now visible"); // log to Finesse logger
// automatically adjust the height of the gadget to show the html
gadgets.window.adjustHeight();
});
containerServices.makeActiveTabReq();

}
Thanks,
Santhi

View solution in original post

Hi Denise,

Thank you much. Can you please tell me if there is any specific event that distinguishes between a manual refresh and an automatic load of finesse ( and failover)??
I have to get hold of NotificationState being Connected" and when finesse loads automatically (browser refresh or network glitch or failover), then execute the code to refresh Siebel c360 to home page.

I thought about getting the "Not Ready-Connection Failure" as the state when finesse automatically loads...but, as you know that's not always the case, and, when browser refresh happens or when finesse fails over, it can come to the same state as before if client/server polling picks up within the desired time.
So, can you help me with an event that is visible that I can use for finesse auto load(during failovers) and browser glitches please?


So, I need something as below::

render = function() {
if (finesse.clientservices.ClientServices.getNotificationConnectionState()== "Connected " && WHEN FINESSE AUTOMATICALLY LOADS ) {
var siebelLink = https://customer360.tcc.etn.com:9011/siebel/app/Salesoui/;
var SiebelLinkRefresh = siebelLink+"?SWECmd=GotoView&SWEView=Sales+Home+Page+View";
clientLogs.log("In render. Executing Siebel Refresh");
document.getElementById("myFrame").src = SiebelLinkRefresh;
}
}

Thanks,
Santhi

View solution in original post

8 Replies 8

dekwan
Cisco Employee
Cisco Employee

Hi,

 

When you are using the finesse.clientservices.ClientServices.getNotificationConnectionState() method, is the ClientServices already initiated?

 

I suggest using the browser's developer tool and adding a breakpoint to see what the error is when it hits the finesse.clientservices.ClientServices.getNotificationConnectionState() method.

 

Thanx,

Denise

Hello Denise,

Thank you. Yes, I hope I did the correct coding in getting the client services initiated and code looks as in Blue

But, after that, I am unable to get on how to get the output of this state "Connected/Recovered" etc assigned to a variable. If I simply assign to a string variable, the code simply stops and comes out of that place.
Should this be like
_cs = finesse.clientservices.ClientServices.init(cfg);

String s = _cs.getNotificationConnectionState()
If I can catch hold of this, then I can use it in a if check to refresh Siebel C360 under iFRAME when the Clientservices state changes and comes back to "Connected". Can you please help me with this? Thank you

------------------------
//Start
var finesse = finesse || {};
finesse.gadget = finesse.gadget || {};
finesse.container = finesse.container || {};

/** @namespace */
finesse.modules = finesse.modules || {};
finesse.modules.CRMGadget = (function($) {
return {
/**
* Performs all initialization for this gadget
*/
init : function() {
var cfg = finesse.gadget.Config;
clientLogs = finesse.cslogger.ClientLogger; // declare clientLogs
finesse.clientservices.ClientServices.init(cfg, false);
// alert ("Is this getting hit first?");
// Initiate the ClientLogs. The gadget id will be logged as a part of the message
clientLogs.init(gadgets.Hub, "Siebel APAC Gadget", finesse.gadget.Config);
clientLogs.log("Inside init");
// clientLogs.log(finesse.clientservices.ClientServices.getNotificationConnectionState());
user = new finesse.restservices.User({
id : cfg.id,
onLoad : handleUserLoad,
onChange : handleUserChange
});

containerServices = finesse.containerservices.ContainerServices.init();
containerServices.addHandler(
finesse.containerservices.ContainerServices.Topics.ACTIVE_TAB,
function() {
clientLogs.log("Gadget is now visible"); // log to Finesse logger
// automatically adjust the height of the gadget to show the html
gadgets.window.adjustHeight();
});
containerServices.makeActiveTabReq();

}
};
}(jQuery));

Hi,

 

The init function does not have a return so using finesse.clientservices.ClientServices.getNotificationConnectionState() is the correct way. Did you use the browser's debugging to see what happens when this method is called? What is the error?

 

Thanx,

Denise

Hi Denise,
Thank you. Sorry, I was out sick.
Either in developer logs or in persistent logs, I do not see any error at all. Code comes out and does not execute from this point simply. I don't see error.
I tried to use it inside init: to see what state it returns.
ONE pointer that can solve this issue is - Can you please tell me if there is an event in Finesse that distinguishes between a manual refresh and a automatic browser refresh?? If I can get an event that comes only during automatic browser refresh (or finesse failover), I can send an explicit Siebel C360 Refresh on receiving this event. Thank you.

------------------------------------------------------------
init : function() {
var cfg = finesse.gadget.Config;
clientLogs = finesse.cslogger.ClientLogger; // declare clientLogs
finesse.clientservices.ClientServices.init(cfg, false);
// alert ("Is this getting hit first?");
// Initiate the ClientLogs. The gadget id will be logged as a part of the message
clientLogs.init(gadgets.Hub, "Siebel APAC Gadget", finesse.gadget.Config);
clientLogs.log("Inside init"); --- > This gets shown in Client logs.
// clientLogs.log("NS is" +finesse.clientservices.ClientServices.getNotificationConnectionState()); --> After this line, nothing gets executed and no error.
user = new finesse.restservices.User({
id : cfg.id,
onLoad : handleUserLoad,
onChange : handleUserChange
});

containerServices = finesse.containerservices.ContainerServices.init();
containerServices.addHandler(
finesse.containerservices.ContainerServices.Topics.ACTIVE_TAB,
function() {
clientLogs.log("Gadget is now visible"); // log to Finesse logger
// automatically adjust the height of the gadget to show the html
gadgets.window.adjustHeight();
});
containerServices.makeActiveTabReq();

}
Thanks,
Santhi

Hi,

 

Using the browser's debugger with a breakpoint, I was able to see that finesse.clientservices.ClientServices.getNotificationConnectionState() is undefined at the location in your pasted code. That is why nothing gets executed after.

 

It doesn't appear that the function works until the gadget is fully loaded. When I use it in the below code, I see it is "connected" 

containerServices.addHandler(finesse.containerservices.ContainerServices.Topics.ACTIVE_TAB, function() {
                clientLogs.log("Gadget is now visible");
                // log to Finesse logger
                var connectionState = finesse.clientservices.ClientServices.getNotificationConnectionState();
                clientLogs.log("connectionState is: " + connectionState);
                // automatically adjust the height of the gadget to show the html
                gadgets.window.adjustHeight();
            });

Thanx,

Denise

 

Hi Denise,

Thank you much. Can you please tell me if there is any specific event that distinguishes between a manual refresh and an automatic load of finesse ( and failover)??
I have to get hold of NotificationState being Connected" and when finesse loads automatically (browser refresh or network glitch or failover), then execute the code to refresh Siebel c360 to home page.

I thought about getting the "Not Ready-Connection Failure" as the state when finesse automatically loads...but, as you know that's not always the case, and, when browser refresh happens or when finesse fails over, it can come to the same state as before if client/server polling picks up within the desired time.
So, can you help me with an event that is visible that I can use for finesse auto load(during failovers) and browser glitches please?


So, I need something as below::

render = function() {
if (finesse.clientservices.ClientServices.getNotificationConnectionState()== "Connected " && WHEN FINESSE AUTOMATICALLY LOADS ) {
var siebelLink = https://customer360.tcc.etn.com:9011/siebel/app/Salesoui/;
var SiebelLinkRefresh = siebelLink+"?SWECmd=GotoView&SWEView=Sales+Home+Page+View";
clientLogs.log("In render. Executing Siebel Refresh");
document.getElementById("myFrame").src = SiebelLinkRefresh;
}
}

Thanks,
Santhi

Hi,

 

Thank you much. Can you please tell me if there is any specific event that distinguishes between a manual refresh and an automatic load of finesse ( and failover)??

Not that I'm aware of. During failover, the SystemInfo event will show that the Finesse system goes OUT_OF_SERVICE before the container switches to the other node (when the red banner is showing), but that is about it. 

 

Thanx,

Denise

Hi Denise,
Thank you for the help and clarifying for me. I will try to find a work around through CRM iFRAME side.

Thanks a lot,
Santhi