Hi Experts,
We are using below correlation rule but however the code is not able to execute the for each loop -->for(Object identity: identities). I tried typecasting to sailpoint.object.Identity, that is also not working. Could you please suggest what can be the root cause of this issue?
Correlation Rule:
import sailpoint.tools.Util;
import sailpoint.object.Identity;
Map returnMap = new HashMap();
try{
Object emailObj = account.getAttribute("userId");
String email = (emailObj != null ) ? (String) emailObj : null;
log.error("WS Correlation - EmailID is: "+email);
if(null != email)
{
List identities = idn.findIdentitiesBySearchableIdentityAttribute("email", "Equals", email,"email");
log.error("WS Correlation - List identities is: "+ identities);
if( identities != null && identities.size() > 0)
{
if(identities.size() == 1 )
{
log.error("Correlation - List identities email : "+ email);
returnMap.put( "identityAttributeName", "email");
returnMap.put( "identityAttributeValue", email);
}else {
log.error("Correlation : Identity List is greater than 1");
log.error("Correlation : Identity Size is"+ identities.size());
log.error("Correlation : Identity List 2 is "+ identities);
for(Object identity: identities)
{
log.error("Inside for loop "+ identity);
Identity idenObject = (Identity) identity;
log.error("Correlation : Inside For Loop"+ idenObject);
log.error("Correlation : Identity Found is"+ identity);
Object idnWorkdayFileNumberObj = idenObject.getAttribute("workdayFileNumber");
log.error("Correlation : workdayFileNumber Found"+ idnWorkdayFileNumberObj);
String idnWorkdayFileNumber = (null != idnWorkdayFileNumberObj) ? (String) idnWorkdayFileNumberObj : null;
log.error("Correlation - idnWorkdayFileNumber : "+ idnWorkdayFileNumber);
if ( null != idnWorkdayFileNumber)
{
log.error("Correlation : Identity Found");
String idnUID= idenObject.getAttribute("uid");
returnMap.put("identityAttributeName", "uid");
returnMap.put("identityAttributeValue", idnUID);
break;
}
}
}
}
}
}catch(Exception e){
log.error("Exception : In correlation rule " + e.getMessage());
}
return returnMap;