Name

sn_ci_analytics.CAConfig

Description

Create configs for Conversational Analytics from sys properties.

Script

var CAConfig = Class.create();
CAConfig.prototype = {
  initialize: function() {},

  //Batch size require for a request, default set to 1MB
  getBatchSize: function() {
      return gs.getProperty("sn_ci_analytics.ca.batch_size", 1000);
  },

  //Maximum size allowed per request
  getMaxBatchSize: function() {
      var maxSize = this.getBatchSize() * 3;
      return maxSize;
  },

  // Maximum retry for a request before failing it, default set to 3
  getMaxRequestRetry: function() {
      return gs.getProperty("sn_ci_analytics.ca.max_retry", 3);
  },

  // Application table name
  getAppTableName: function() {
      return gs.getProperty("sn_ci_analytics.ca.app_table_name", "sn_ci_analytics_application");
  },

  // Application record sys_id for Virtual Agent(Default)
  getAppRecordSysId: function() {
      return gs.getProperty("sn_ci_analytics.ca.app_record_sysid", "879230a7730310108564b17afef6a7ae");
  },

  // Is Broadcast conversations allowed
  isBroadcastAllowed: function() {
      return gs.getProperty("sn_ci_analytics.ca.allow_broadcast", false);
  },

  getJobMaxConversationCount: function() {
      return gs.getProperty("sn_ci_analytics.ca.job_max_conversation_count", 3000);
  },

  getDetails: function() {
      return {
          "sn_ci_analytics.ca.batch_size": this.getBatchSize(),
          "sn_ci_analytics.ca.max_retry": this.getMaxRequestRetry(),
          "sn_ci_analytics.ca.app_table_name": this.getAppTableName(),
          "sn_ci_analytics.ca.app_record_sysid": this.getAppRecordSysId(),
          "sn_ci_analytics.ca.allow_broadcast": this.isBroadcastAllowed(),
          "sn_ci_analytics.ca.job_max_conversation_count": this.getJobMaxConversationCount(),
          "sn_ci_analytics.ca.reason_max_length": this.getReasonMaxLength()
      };
  },

  getReasonMaxLength: function() {
      return gs.getProperty('sn_ci_analytics.ca.reason_max_length', 1000);
  },
  
  isAnalyticsProcessingEnabled: function(){
  	return gs.getProperty('sn_ci_analytics.ca.processing_enabled', true);
  },
  
  enableAnalyticsProcessing: function(){
  	return gs.setProperty('sn_ci_analytics.ca.processing_enabled', true);
  },
  
  disableAnalyticsProcessing: function(){
  	return gs.setProperty('sn_ci_analytics.ca.processing_enabled', false);
  },
  
  type: 'CAConfig'
};

Sys ID

bff4c75c737210108564b17afef6a750

Offical Documentation

Official Docs: