Friday, January 8, 2021

How to fetch childData in OIM?

 public static HashMap<String, String> getChildData(String requestID) {

String methodName = "getChildData";

System.out.println(CLASS_NAME + "/" + methodName + "; Request ID = " + requestID);

HashMap functionRoleApplicationMap = new HashMap();

try {

Request request = getRequestObject(requestID);

List beneficiaryList = request.getBeneficiaries();

List reqBeneficiaryEntityList = ((Beneficiary) beneficiaryList.get(0)).getTargetEntities();

List<RequestBeneficiaryEntityAttribute> reqBeneficiaryEntityAttributeList = ((RequestBeneficiaryEntity) reqBeneficiaryEntityList

.get(0)).getEntityData();

for (RequestBeneficiaryEntityAttribute reqBeneficiaryEntityAttribute : reqBeneficiaryEntityAttributeList) {

if (reqBeneficiaryEntityAttribute.getName().equalsIgnoreCase("TABLE_NAME")) {

List<RequestBeneficiaryEntityAttribute> childAttributeList = reqBeneficiaryEntityAttribute

.getChildAttributes();


String fieldName = "";

String fieldValue = "";

for (RequestBeneficiaryEntityAttribute childAttribute : childAttributeList) {

if (childAttribute.getName().equalsIgnoreCase("Field Name")) {

fieldName = childAttribute.getValueHolder().toString();

}

if (childAttribute.getName().equalsIgnoreCase("Field Value")

&& null != childAttribute.getValueHolder()) {

fieldValue = childAttribute.getValueHolder().toString();

}

}

// System.out.println(fieldName + "==" + fieldValue);

functionRoleApplicationMap.put(fieldName, fieldValue);

}

}

} catch (Exception e) {

e.printStackTrace();

}

System.out.println("Exiting from the method : " + methodName);

return functionRoleApplicationMap;

}


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