Name

sn_comm_management.CommunicationPlanEngineSNC

Description

No description available

Script

var CommunicationPlanEngineSNC = Class.create();
CommunicationPlanEngineSNC.prototype = {

  TABLES: {
  	COMM_PLAN_DEFINITION: "comm_plan_definition"
  },

  COLUMNS: {
  	TABLE: "table",
  	CONDITION_BASED: "condition_based"
  },

  initialize: function(sourceRecord) {
  	this.sourceRecord = sourceRecord;
  	this.bridge = new CommunicationManagementBridgeSNC();
  	this.handlerInstance = this.bridge.getHandlerInstance(this.sourceRecord.getRecordClassName());
  },

  attachPlans: function() {
  	this.handlerInstance.attachPlans(this.sourceRecord);
  },

  canRun: function() {
  	var gr = new GlideRecord(this.TABLES.COMM_PLAN_DEFINITION);
  	gr.addActiveQuery();
  	gr.addQuery(this.COLUMNS.TABLE, this.sourceRecord.getRecordClassName());
  	gr.addQuery(this.COLUMNS.CONDITION_BASED, true);
  	gr.setLimit(1);
  	gr.query();
  	return gr.hasNext();
  },

  type: 'CommunicationPlanEngineSNC'
};

Sys ID

3048c6b65b3b0300e3cc8e6541f91aaf

Offical Documentation

Official Docs: