Name

global.PrePatternExecution

Description

No description available

Script

var PrePatternExecution = Class.create();
PrePatternExecution.prototype = {
  initialize: function() {
  	this.json = {};
  	this.json.mapOfStrings = {};
  	this.json.mapOfLists = {};
  	this.json.mapOfTables = {};
  },
  
  addString : function(key, value) {
  	this.json.mapOfStrings[key] =value;
  },
  
  addList : function(key, list) {
  	this.json.mapOfLists[key] = list;
  },
  
  addTableEntry : function(key, table) {
  	this.json.mapOfTables[key] = table;
  },
  
  addGlideRecordEntryByAttributes: function(mapKey, glideRecord, colNames){
      var mapParams = {};

      for (var keyParam in colNames) {
  		var colName = colNames[keyParam];
          var colValue = glideRecord.getValue(colName);
          if(colValue != null && !colName.equals('discovery_source'))
              mapParams[colName] = colValue;
      }
  	
      mapParams['sys_id']= glideRecord.getValue('sys_id');
      this.addTableEntry(mapKey, mapParams);
  },
  
  toJSON: function() {
  	this.json["executePattern"] = true;
  	this.json["className"] = "PrePatternExecutionData";
  	return JSON.stringify(this.json);
  },

  type: 'PrePatternExecution'
};

Sys ID

9df636f0ff1313003db8b54553e11cc2

Offical Documentation

Official Docs: