Name

sn_em_arm.EvtMgmtUpdateAlertMgmtJob

Description

The updated alerts job

Script

var EvtMgmtUpdateAlertMgmtJob = Class.create();
EvtMgmtUpdateAlertMgmtJob.prototype = Object.extendsObject(EvtMgmtAlertMgmtJob, {

  type: 'EvtMgmtUpdateAlertMgmtJob',

  getStartTime: function() {
      var startTime = this.lastArmJobHash.getValue('hash');
      return startTime;
  },

  getInProgressTime: function() {
      //for long processing of the business rules the ALERT_MANAGEMENT_DELAY time should be the same as time the business rule takes
      var endTime = new GlideDateTime();
      var backSeconds = gs.getProperty(this.ALERT_MANAGEMENT_DELAY, "5");
      var gt = new GlideTime(1000 * backSeconds);
      endTime.subtract(gt);
      return endTime;
  },

  getAlerts: function(startTime, endTime, jobNum) {
      var groupingG2Time = this.lastCreatedTimeHash.getValue('hash');
      var recentAlerts = this.evtMgmtAlertMgmtUtils.getUpdatedAlerts(startTime, endTime, this.chunkSize, groupingG2Time, this.waitForGrouping, jobNum);
      return recentAlerts;
  },

  getAlertsThisSecond: function(exactTime, lastSimultaneousAlertNumber, jobNum) {
      return this.evtMgmtAlertMgmtUtils.getUpdatedAlertsThisSecond(exactTime, lastSimultaneousAlertNumber, this.chunkSize, this.lastCreatedTimeHash.hash, this.waitForGrouping, jobNum);
  },

  updateHash: function(inProgressEndTime) {
      //setting the date time for the hash table for the next retrieval   
      this.lastArmJobHash.setValue('hash', inProgressEndTime);
      this.lastArmJobHash.update();
  },

  getLastGrTime: function(gr) {
      return gr.getValue("sys_updated_on");
  },

});

Sys ID

d95d09eeb79920107c038229ce11a9be

Offical Documentation

Official Docs: