Wednesday, August 19, 2020

Group Owner Rule (Status and Location)

import sailpoint.object.QueryOptions;

import sailpoint.object.Identity;


QueryOptions qo = new QueryOptions();

qo.addFilter(group.getFilter());

Iterator identities = context.search(Identity.class, qo);

// Find the employee with the lowest employee ID.

Identity emp = null;

String empId = null;

Identity owner = null;

String ownerEmpId = null;

while (identities.hasNext()) {

  emp = identities.next();

  empId = emp.getAttribute("empId");

  if (empId != null && (ownerEmpId == null || empId.compareTo(ownerEmpId) < 0)) {

    owner = emp;

    ownerEmpId = empId;

  }

}

// When all of the employee IDs in the subgroup are null, default to spadmin.

if (owner == null) {

  return "spadmin";

}

return  owner;

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...