Direct Statistic Definition
Starting with ORS 8.1.400.45, the _genesys.statistic.sData function is enhanced to allow you to directly define statistic parameters in the SCXML routing strategy code via a JavaScript object passed as an input parameter. This enhancement is useful when strategy logic requires statistic parameters to dynamically change.
Background: Configuration Server currently stores statistic parameters as Transaction/Statistic objects in its database. Previous to this enhancement, if a strategy requested a statistic, it could only use the _genesys.statistic.sData function with the name of the Transaction/Statistic object in the Configuration Database defined as a string input parameter.
Statistic Parameters in JavaScript Object
[+] Statistic Parameters in JavaScript Object
JavaScript Object Properties
{
Params: {},
Extensions: {}
}
Properties of “Params":
Property |
StatServer API meaning |
Mandatory |
Type
|
MainActionsMask Value must be defined as a string containing Stat Server Action names, delimited by a comma.
Action names are the same as used in the configuration of Statistical Types in Stat Server. Wildcard(*) and logical NOT(~) character are supported. See the Stat Server 8.1 User’s Guide, section “Statistical Type Sections”, table 9, “MainMask” and “RelMask”.
|
SRequestParams.MainActionsMask |
Yes (if not statistic of JavaCategory)
|
String
|
RelActionsMask Same as above for Value |
SRequestParams.RelActionsMask |
No
|
String
|
Category Values are the same as used in the configuration of Statistical Types in Stat Server. All rules, applicable for corresponding options are supported. See the Stat Server 8.1 User’s Guide. |
SRequestParams.Category |
Yes
|
String
|
Interval Contains the interval type as a string. See the Stat Server 8.1 User’s Guide, “TimeProfiles section”, table 1) – Sliding, Growing, Selection, SinceLogin. |
SRequestParams.Interval |
Yes
|
String
|
TimeRange2Start Starting point of time range in seconds. See the “Stat Server 8.1 User’s Guide”, “TimeRanges section”. |
SRequestParams.tmStart |
Yes for ServiceFactor category, not applicable otherwise.
|
Number
|
TimeRange2End End of time range in seconds. See the Stat Server 8.1 User’s Guide, “TimeRanges section”. |
SRequestParams.tmEnd |
Yes for ServiceFactor category, not applicable otherwise.
|
Number
|
Subject |
SRequestParams.Subject |
Yes (if not statistic of JavaCategory)
|
String
|
TimeRangeStart Starting point of time range in seconds. See the Stat Server 8.1 User’s Guide, “TimeRanges section”. |
SRequestParams.tmLeftRangeLimit |
Yes, if category requires it. Optional otherwise.
|
Number
|
TimeRangeEnd End of time range in seconds. See the Stat Server 8.1 User’s Guide, “TimeRanges section”. |
SRequestParams.tmLeftRangeLimit |
Yes, if category requires it. Optional otherwise
|
Number
|
Properties of “Extensions":
Property |
StatServer API meaning |
Mandatory |
Type
|
DynamicFilter Contains a filter expression. See the Stat Server User’s Guide, “Filters section”. |
SOpenStatEx, pExtensions->"DynamicFilter" |
No
|
String
|
DynamicTimeProfile Contains a time profile expression. See the Stat Server User’s Guide, “TimeProfiles section”. |
SOpenStatEx, pExtensions->"DynamicTimeProfile" |
No
|
String
|
DynamicUserDataFormula See the Stat Server 8.1 User’s Guide, “Custom Formulas” section. |
SOpenStatEx, pExtensions->"DynamicUserDataFormula" |
No
|
String
|
DynamicFormula Not supported in current version of Stat Server. |
SOpenStatEx, pExtensions->"DynamicFormula" |
No
|
String
|
JavaStats |
SOpenStatEx, pExtensions->"JavaStats ".Type shall be described as JavaScript object with the structure as shown Under Type. |
Yes, if category requires it. Not applicable otherwise.
|
{
JavaExtension: “”,
JavaSubCategory: “”
}
|
Sample Statistic Definitions
[+] Sample Statistic Definitions
_genesys.statistic.sData Function with Statistic Definition:
<script>
var s_Stat = {
Params: {
Category: "TotalNumber",
MainActionsMask: "CallEntered",
Subject: "DNAction",
Interval: "Growing"
},
Extensions: {
DynamicFilter: “ANI=\"7181234567\""
}
};
var s_Val = _genesys.statistic.sData('sip_a_vq1_Switch_sip1.Q', s_Stat);
</script>
With Extensions:
{
Params: {
MainActionsMask: “CallAnswered”,
Category: “TotalNumber”,
Interval: “Growing”,
Subject: “DNAction”
},
Extensions: {
DynamicFilter: “DNIS=\"701\""
}
}
Without Extensions:
{
Params: {
MainActionsMask: “CallAnswered”,
Category: “TotalNumberInTimeRange”,
Interval: “Growing”,
Subject: “DNAction”,
TimeRangeStart: 0,
TimeRangeEnd: 20
}
}
JavaStats:
{
Params: {
Category: "JavaCategory",
Interval: "Growing"
},
Extensions: {
JavaStats:{
JavaExtension: "eServiceContactStat.jar",
JavaSubCategory: "age of oldest email"
}
}
}