Name

sn_risk.ReliantEntityToItemAssociationExtPoint

Description

Implements extension point sn_grc.ReliantEntityToItemAssociationExtPoint Extension point for handling downstream actions of adding, activating, deactivating and removing reliant entity to item association

Script

var ReliantEntityToItemAssociationExtPoint = Class.create();
ReliantEntityToItemAssociationExtPoint.prototype = {
  initialize: function() {},
  addReliantEntityToItem: function(entityId, itemId) {
      /**
       * @param {String} entityId - The sys_id of the reliant entity.
       * @param {String} itemId - The sys_id of the item.
       * @return void.
       */
      var itemGr = this.getItem(itemId);
      this.getStrategy().associateRiskControlRelationsForItemEntity(entityId, itemId, String(itemGr.content));
  },

  activateReliantEntityToItemAssociation: function(entityId, itemId) {
      /**
       * @param {String} entityId - The sys_id of the reliant entity.
       * @param {String} itemId - The sys_id of the item.
       * @return void.
       */
      var itemGr = this.getItem(itemId);
      this.getStrategy().associateRiskControlRelationsForItemEntity(entityId, itemId, String(itemGr.content));
  },

  removeReliantEntityFromItem: function(entityId, itemId) {
      /**
       * @param {String} entityId - The sys_id of the reliant entity.
       * @param {String} itemId - The sys_id of the item.
       * @return void.
       */
      this.getStrategy().deleteRiskControlRelationForItemEntity(entityId, itemId);
  },

  deactivateReliantEntityToItemAssociation: function(entityId, itemId) {
      /**
       * @param {String} entityId - The sys_id of the reliant entity.
       * @param {String} itemId - The sys_id of the item.
       * @return void.
       */
      this.getStrategy().deleteRiskControlRelationForItemEntity(entityId, itemId);
  },
  handles: function(itemType) {
      if (new sn_grc.ItemGenerationV2Conditions().checkIfRiskComplianceInstalled())
          return true;
  },

  getItem: function(itemId) {
      var itemGr = new GlideRecord('sn_grc_item');
      itemGr.get(itemId);
      return itemGr;
  },

  getStrategy: function() {
      return new sn_grc.ItemGenerationV2Utils().getStrategy("sn_risk");
  },


  type: 'ReliantEntityToItemAssociationExtPoint'
};

Sys ID

53149f1977a61110c4a4b0bdbd5a99cb

Offical Documentation

Official Docs: