We have deployed a couple versions of the rule but now we hit a casting issue. Here is the error message as seen on Identity Cubes after running the aggregation:
And here is the code:
import sailpoint.object.*;
import sailpoint.rule.*;
import java.util.*;
import java.util.Map;
import java.util.HashMap;
import sailpoint.object.Identity;
String ssn = (String) account.getAttribute("SSN_LAST_FOUR");
String dob = (String) account.getAttribute("BIRTH_DATE");
String first = (String) account.getAttribute("FIRST_NAME");
String last = (String) account.getAttribute("LAST_NAME");
Map returnMap = new HashMap();
//Search IDN for Exact Last 4 SSN Match
List identities = idn.findIdentitiesBySearchableIdentityAttribute("ssnLastFour", "Equals", ssn, "email");
if( identities != null && identities.size() > 0) {
for (Identity identity: identities){
//Check to see if the Last Name Matches
if(null != identity.getLastname()){
if(identity.getLastname().equals(last)){
//Now we have two of three criteria matched, if DOB or First Name match add the identity to the map
if(null != identity.getFirstname()){
if(identity.getFirstname().equals(first)){
returnMap.put("name", identity.getName());
}
}
if(null != identity.getAttribute("birthDate")){
if(identity.getAttribute("birthDate").equals(dob)){
returnMap.put("identity",identity);
}
}
}
}
}
}
return returnMap;```
From a similar post we saw reference to defining the List like "List<sailpoint.rule.Identity> identities =..." however this update fails the SaaS validator. This snippet came from [Using IDNRuleUtil findIdentitiesBySearchableIdentityAttribute function - IdentityNow (IDN) / Discussion and Questions - SailPoint Developer Community Forum](https://developer.sailpoint.com/discuss/t/using-idnruleutil-findidentitiesbysearchableidentityattribute-function/3917#_gl=1*lwvs81*_gcl_au*MTc1MzkzMTY2Mi4xNjg4OTk2OTg4)