Name

global.PlannedTaskRecalculationExclusion

Description

Exclusions for Planned task recalculations

Script

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

  isExcluded: function(gr) {
      var tableName = gr.getTableName(); 
      if(this.getExclusion(tableName)) {
          return true;
      }
      if( null != gr.getValue("top_task")) {
          var topTaskSysClassName = gr.top_task.sys_class_name;
          if( null != topTaskSysClassName) {
              if( this.getExclusion(topTaskSysClassName)) 
                  return true;
          }   
      }
      return false;
  },

  getExclusion: function(tableName) {
      var gr = new GlideRecord("planned_task_recalculation_exclusions");
      gr.addQuery("exclude_table", tableName);
      gr.query();
      if(gr.next()) {
          //gs.info("Table is Excluded from Recalculation: " + tableName);
          return true;
      }
      return false;
  },

  getExclusions: function () {
      var excludedTables = [];
      var gr = new GlideRecord("planned_task_recalculation_exclusions");
      gr.query();
      while(gr.next()) {
          excludedTables.push(gr.getValue("exclude_table"));
      }
      PPMDebug.log("PlannedTaskRecalculationExclusion.getExclusions -> " + excludedTables.join(","));
      return excludedTables.join(",");
  },

  type: 'PlannedTaskRecalculationExclusion'
};

Sys ID

1064dbc29f230200598a5bb0657fcf0b

Offical Documentation

Official Docs: