We had 2 source mapping for an identity attribute. One is from an authoritative source application and another is from Active Directory. We have removed mapping from Active Directory( Updated Identity.xml). However, for the existing identities when the authoritative source attribute value is updated null, the identity attribute source mapping is showing the Active Directory attribute in AttributeMetadata (even though there is no mapping with Active Directory attribute for that identity attribute. We have run the identity refresh with âRefresh identity attributesâ option enabled. But still, it is not getting updated.
There is no way to purge old AttributeMetadata from identity cube XML. You need to remove it using IIQ Java API suing a one time rule runner task or a refresh rule
You can attempt to resolve the issue by implementing a pre-refresh rule to clear the attribute metadata. To configure a pre-refresh rule for a specific refresh task, you can set the âpreRefreshRuleâ attribute in the TaskDefinition. This attribute is not visible by default, but you can add it to the task properties.
Here is a sample code snippet that can help you achieve this:
if(null!=identity){
List attributeMetaDataList = identity.getAttributeMetaData();
if(null!=attributeMetaDataList && !attributeMetaDataList.isEmpty()){
List attributeMetaDatas = new ArrayList();
attributeMetaDatas.addAll(attributeMetaDataList);
for(AttributeMetaData metaData: Util.safeIterable(attributeMetaDatas)){
identity.remove(metaData);
}
try{
context.saveObject(identity);
context.commitTransaction();
log.debug("AttributeMetaData removed for: "+identity.getName());
}
catch(Exception e){
log.error("Exception Encountered in removing the AttributeMetaData: " + e.getMessage());
}
}
else{
log.debug(âAttributeMetaData not foundâ);
}
}
else{
log.error(âIdentity Object not foundâ);
}