Name

global.PADProcessDefinitionRepository

Description

Process Definition repository to make GlideRecord call for Process Automation Designer

Script

var PADProcessDefinitionRepository = Class.create();
PADProcessDefinitionRepository.prototype = {
  initialize: function() {
  	var padUtils = new PADUtilsSI();
  	this.isAuthorizedUser = true;
  	if (!padUtils.isPADAuthorizedUser() && !padUtils.userIsPADDelegatedDev())
  		this.isAuthorizedUser = false;
  },
  get: function(sysId) {
  	if (!this.isAuthorizedUser)
  		return {
  			errorType: PADConstants.Errors.UNAUTHORIZED,
  			message: 'You are unauthorized to perform this action.'
  		};
  	
  	if (!sysId)
  		return;
  	
  	var gr = new GlideRecord(PADConstants.TABLES.PD_PROCESS_DEFINITION);
  	gr.get(sysId);
  	return gr;
  },
  update: function(process) {
  	var gr = this.get(process.sysId);
  	gr.setValue('label', process.label);
  	gr.setValue('description', process.description);
  	gr.update();
  	return {
  		label: gr.getValue('label'),
  		description: gr.getValue('description')
  	};
  },
  type: 'PADProcessDefinitionRepository'
};

Sys ID

dd5b17dc77930110b123f825bc5a99ed

Offical Documentation

Official Docs: