Which IIQ version are you inquiring about?
Version 8.3
Share all details related to your problem, including any error messages you may have received.
Hi Team,
I have one requirement I need to pas assigned role with two salesforce application attribute through plan and rest application attributes it will take from provisioning policy. Below is my code and error I am getting.
Error: Identity Attribute need to be present in the create provisioning policy of SalesForce User
code:
public ProvisioningPlan buildProvisioningPlanAttribute(HashMap userInputMap){
Application app = context.getObjectByName(Application.class, userInputMap.get("Application"));
String app1 = userInputMap.get("Application");
String iden=userInputMap.get("UserID");
Identity identity = context.getObjectByName(Identity.class,iden );
System.out.println("BuildProvisioningPlanAttribute::!!!!"+"Application"+app1+":Identity"+iden+"::IdentityObject:"+identity);
ProvisioningPlan plan = new ProvisioningPlan();
String appType = null;
String connType = null;
String roleAppName = null;
String srdTitle = null;
String defaultRole = null;
String defaultRole1 = null;
List attreqList = new ArrayList();
String action = userInputMap.get("ActionType");
action = action.trim();
Bundle b = context.getObject(Bundle.class, userInputMap.get("RoleName"));
//roleAppName = b.getAttribute("application_name");
// srdTitle = b.getAttribute("SRDTITLE");
Attributes att= new Attributes();
AccountRequest accReq= new AccountRequest();
accReq.setOperation(AccountRequest.Operation.Create);
accReq.setApplication(app1);
// accReq.setNativeIdentity(userInputMap.get("UserID"));
att.put("comments","RequestId : "+ userInputMap.get("RequestId")+" | "+"RequesterName : "+ userInputMap.get("RequesterName")+" | "+ "ApproverName : "+ userInputMap.get("ApproverName"));
AttributeRequest attReq= new AttributeRequest();
attReq.setOp(ProvisioningPlan.Operation.Add);
System.out.println("BuildProvisioningPlanAttribute::!!!!Calculte Attribute Request Started");
List list =(ArrayList) userInputMap.get("attributes");
System.out.println("BuildProvisioningPlanAttribute:: All List::"+list);
List accreqs = new ArrayList();
Map newlyMap = new HashMap();
if (list != null && !list.isEmpty()) {
System.out.println("BuildProvisioningPlanAttribute::List Szie"+list.size());
for(int i=0;i < list.size();i++ ) {
System.out.println("BuildProvisioningPlanAttribute::Inside For Loop");
newlyMap = (Map) list.get(i);
String attrKey = newlyMap.get("name");
String attrValue = newlyMap.get("value");
accReq.add(new AttributeRequest(attrKey, attrValue));
System.out.println("BuildProvisioningPlanAttribute::Attribute Key::"+ attrKey+"Attribute Value" + attrValue);
}
}
attReq.setArguments(att);
accReq.add(attReq);
accreqs.add(accReq);
//Role Request
AccountRequest roleReq = new AccountRequest();
System.out.println("BuildProvisioningPlanAttribute::Role Request::");
roleReq.setApplication(app1);
// roleReq.setNativeIdentity(userInputMap.get("UserID"));
AttributeRequest roleAttrReq = new AttributeRequest("assignedRoles", userInputMap.get("RoleName"));
roleAttrReq.setOperation(ProvisioningPlan.Operation.Add);
roleReq.add(roleAttrReq);
accreqs.add(roleReq);
System.out.println("BuildProvisioningPlanAttribute::Role Attribute Append Completed");
plan.setIdentity(identity);
// plan.setNativeIdentity(userInputMap.get("UserID"));
plan.setAccountRequests(accreqs);
System.out.println("BuildProvisioningPlanAttribute::END");
return plan;
}