Tuesday, August 22, 2023

Active Period Rule1

import java.util.Date;

import org.apache.commons.logging.Log;

import sailpoint.api.SailPointContext;

import sailpoint.object.AuditEvent;

import sailpoint.object.Certification;

import sailpoint.tools.GeneralException;

public class ActivePeriodRule1 {

static Log logger = null;

static SailPointContext context = null;

static Certification certification = null;

private static void callActivePeriodRule1() {

String auditTarget = null;

String auditAction = "UserENTCertEvent";

auditTarget = certification.getEntities().get(0).getIdentity();

AuditEvent auditEvent = new AuditEvent();

auditEvent.setSource("User Entitlement Certification Event Trigger");

auditEvent.setAction(auditAction);

auditEvent.setTarget(auditTarget);

auditEvent.setAttributeValue("CN=SailPoint IdentityIQ,OU=Groups,OU=mighty,OU=com");

auditEvent.setCreated(new Date());

try {

context.saveObject(auditEvent);

context.commitTransaction();

context.decache(auditEvent);

} catch (GeneralException e) {

logger.error("GeneralException in ActivePerioRule1 : " + e.getMessage());

}

}

public static void main(String[] args) {

callActivePeriodRule1();

}

}


No comments:

Post a Comment

Fetch Members from Workgroup

  import java.util.ArrayList;   import java.util.Iterator;   import java.util.List;   import sailpoint.api.ObjectUtil;   import sailpoint.ob...