" /> Formula in CCPulse returns incorrect values - Genesys CTI User Forum

Author Topic: Formula in CCPulse returns incorrect values  (Read 4727 times)

Offline G3n35Y5

  • Newbie
  • *
  • Posts: 46
  • Karma: 0
Formula in CCPulse returns incorrect values
« on: September 03, 2012, 11:31:41 AM »
Advertisement
I have created a template in CCPulse for fetching the place details where an agent is currently logged in. A simple fornula has been configured in this template; content of which is as follows:

result.Text=state.PlaceID;

Even though the agent is logged in, CCPulse shows the value  as '-0'. Could anyone explain what could be the possible reason for same?

Offline bandorka

  • Full Member
  • ***
  • Posts: 120
  • Karma: 1
Re: Formula in CCPulse returns incorrect values
« Reply #1 on: September 03, 2012, 01:39:06 PM »
Hi,

In order to work for this, the following must be done:
1. define a stat on the stat server:
[CurrentAgentStateDNAction]
Category=CurrentState
MainMask=*
Objects=Agent
Subject=DNAction

2.
on a ccp template this stat must be included (later you can hide it, if you don't need)

3. create a formula on this template (similar you use):
    result.Text = GetAgentState();
    function GetAgentState()
    {
    if(state.type != "AgentState") return "n/a";
    var r = state.PlaceID
    return r;
    }

Hope this help,
Bandorka

Offline G3n35Y5

  • Newbie
  • *
  • Posts: 46
  • Karma: 0
Re: Formula in CCPulse returns incorrect values
« Reply #2 on: September 03, 2012, 04:35:05 PM »
Hi Bandorka,

Thanks a lot for your response.
I still have a doubt: What is the need to configure a new statistic in Stat Server in order to make this formula work?

-Genesys_user

Offline bandorka

  • Full Member
  • ***
  • Posts: 120
  • Karma: 1
Re: Formula in CCPulse returns incorrect values
« Reply #3 on: September 04, 2012, 06:55:02 AM »
On stat server (do this on the options tab of the stat server application) you need to configure a new statistics:

[CurrentAgentStateDNAction_NamOfTheStat]
Category=CurrentState
MainMask=*
Objects=Agent
Subject=DNAction

And when you create a new CCP template, add this stat first to the template

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Formula in CCPulse returns incorrect values
« Reply #4 on: September 04, 2012, 05:19:37 PM »
If you don't even know how to create a stat on StatServer highly recommend to ask an specialist to do this tasks...seems you are an end user only and no clue on Genesys platform...you can end damaging something if you do the wrong move.

Offline bandorka

  • Full Member
  • ***
  • Posts: 120
  • Karma: 1
Re: Formula in CCPulse returns incorrect values
« Reply #5 on: September 05, 2012, 08:28:54 AM »
Sorry I missed one more step:
In the CCPulse Application of CME, in Options, Set CustomStatistic, ExtendedCurrentStatus = true.

Offline Tambo

  • Sr. Member
  • ****
  • Posts: 456
  • Karma: 5
Re: Formula in CCPulse returns incorrect values
« Reply #6 on: September 11, 2012, 04:42:58 PM »
you can use this too and it will show you logon time too


result.Text = GetAgentState();
function GetAgentState()

{
if(state.type != "AgentState")
return "n/a";
var r = "(" + FormatDate(state.StartTime) + ") ";
r += " [Place: " + state.PlaceID;
r += " Login: " + state.LoginID + "]";
for(var e = new Enumerator(state.DNs); !e.atEnd();
e.moveNext())
{ r += GetDNState(e.item()); }
return r;
}

function FormatDate(dateVal)
{
var dateObj = new Date(dateVal);
return dateObj.getHours() + ":" + dateObj.getMinutes() + ":"
+ dateObj.getSeconds();
}

function GetDNState(dn)
{
var r = "(" + FormatDate(dn.StartTime) + ") ";
r += " [Switch: " + dn.SwitchID;
for(var e = new Enumerator(dn.Actions); !e.atEnd();
e.moveNext())
{ r += GetAction(e.item()) + " "; }
return r;
}

function GetAction(a)
{
var r = "(" + FormatDate(a.StartTime) + ") ";
r += a.Action;
return r;
}