import org.apache.log4j.Logger;
import org.apache.log4j.Level;
// If the status has been populated with "Terminated-N-Non Employee" set the account to disabled.
System.out.println("HR System CustomizationRule");
Logger log = Logger.getLogger("HR System CustomizationRule");
log.setLevel((Level) Level.DEBUG);
String acctName = object.getIdentity();
System.out.println("Account Name = "+acctName);
System.out.println("Object = "+object);
String status = object.getAttribute("Status");
System.out.println("Status = "+status);
if ( (null != status) && (0 != status.length()) ) {
if ("Terminated-N-Non Employee".equalsIgnoreCase(status)) {
object.put("IIQDisabled", true);
System.out.println("The 'status' set to Terminated-N-Non Employee on [" + acctName + "], marking IIQDisabled as true.");
log.debug("The 'status' set to Terminated-N-Non Employee on [" + acctName + "], marking IIQDisabled as true.");
}else {
object.put("IIQDisabled", false);
}
} else {
System.out.println("No 'status' field populated on [" + acctName + "], assuming active account.");
log.debug("No 'status' field populated on [" + acctName + "], assuming active account.");
}
return object;
No comments:
Post a Comment