Jump to: navigation, search

Statistic Custom Template Sample

You can download the sample custom template for statistics using the following link:

Statistic Custom Template Sample

Overview

GMS enables you to easily develop your own service by using services composition and custom business logic. The sample template provided here addresses a statistic use case on how to get information about maxInteractions, currentMargin, and currentInteraction from a group of approximately 500 agents. The goal is to use this statistic on the customer-side (browser) to show how quickly a request has been answered.

The response from the GMS statistic will be similar to the Pulse statistic. For example:

 
{
    "maxInteractions": 2,
    "currentInteractions": 0,
    "currentMargin": 2
}

While the GMS Stat Server APIs allow you to query statistics against Stat Server, the APIs return the statistic response as a JSON object. For the use case described here, the response from GMS for this type of statistic may not meet business needs with the response size, CPU consumption, and security.

However, the benefits of using the Statistic custom template are:

  • Network Load - Size of transmitted information is significantly reduced.
  • CPU Consumption - Reduced on client-side; all parsing/formatting process is completed on the GMS/ORS-side.
  • Security - Sensitive information is not exposed.

Prerequisite

GMS 8.5.005.xx and higher.

Running the Sample

  1. Download the zip file. You can save the zip file to the same directory as the templates that are included with the GMS installation: <GMS installation directory>/service_templates, or you can create a new directory to store your custom templates.
  2. Go to the GMS Service Management UI > Tools > Service Templates.
  3. Load the template:
    1. Click Add Service Template.
    2. Select the get-gastat.zip file.
  4. Create the service:
    1. Go to the GMS Service Management UI > Services > Configured Services.
    2. Click Add Service.
    3. Select the get-gastat service, and enter a name for your service.
  5. You can now configure the custom statistic service.
  6. When you have finished with the configuration, you can call your new service using a REST client.

About the Code

The template is a zip file that contains two files:

  • get-gastat.json - Contains the configuration options associated with the service (service type, statistic details, and so on).
  • get-gastat.scxml - Contains the logic of the service. In this sample, it contains a call to the GMS Stat Server API as well as the parsing and formatting logic.

Disclaimer

THIS CODE IS PROVIDED BY GENESYS TELECOMMUNICATIONS LABORATORIES, INC. ("GENESYS") "AS IS" WITHOUT ANY WARRANTY OF ANY KIND. GENESYS HEREBY DISCLAIMS ALL EXPRESS, IMPLIED, OR STATUTORY CONDITIONS, REPRESENTATIONS AND WARRANTIES WITH RESPECT TO THIS CODE (OR ANY PART THEREOF), INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. GENESYS AND ITS SUPPLIERS SHALL NOT BE LIABLE FOR ANY DAMAGE SUFFERED AS A RESULT OF USING THIS CODE. IN NO EVENT SHALL GENESYS AND ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, ECONOMIC, INCIDENTAL, OR SPECIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ANY LOST REVENUES OR PROFITS).

Feedback

Comment on this article:

blog comments powered by Disqus
This page was last modified on 11 April 2018, at 11:26.