import java.util.ArrayList;
import java.util.List;
import sailpoint.object.Identity;
import sailpoint.api.SailPointContext;
import sailpoint.tools.GeneralException;
public void removeWorkGroupsAssignment(String name) throws GeneralException{
String methodName = "removeWprkGroupAssignment";
log.debug("Entering into the method : "+methodName);
Identity identityObj = context.getObject(Identity.class, name);
List<Identity idWorkGroups = new ArrayList<Identity>();
idWorkGroups = identityObj.getWorkgroups();
for(Identity workGoup : idWorkGroups){
identityObj.remove(workGoup);
context.saveObject(identityObj);
context.commitTansaction();
}
log.debug("Exiting from the method : "+methodName);
}
No comments:
Post a Comment