Monday, September 23, 2024

Fetch Members from Workgroup

  import java.util.ArrayList;

  import java.util.Iterator;

  import java.util.List;

  import sailpoint.api.ObjectUtil;

  import sailpoint.object.Identity;

  import sailpoint.tools.GeneralException;

  List workgroupMembersList = new ArrayList();

  try {

    Identity objectByName = context.getObjectByName(Identity.class, "Operations");

    Iterator workgroupMembers = ObjectUtil.getWorkgroupMembers(context, objectByName, null);

    while (workgroupMembers.hasNext()) {

      Object[] object = (Object[]) workgroupMembers.next();

      Identity identity = (Identity) object[0];

      workgroupMembersList.add(identity.getName());

    }

  } catch (GeneralException e) {

    log.error("GeneralException : "+e.getMessage());

  }

  return workgroupMembersList;

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