Friday, August 7, 2015

OIM Reconciliation Event Data Transformation Example

Tested On: Oracle Identity Manager 11.1.2.0 and Oracle Internet Directory 11.1.1.6.0 OIM Connector
Description: Demonstrates how to manipulate reconciliation event data when running user reconciliation scheduled job for most Identity Connector Framework (ICF) connectors (Refer to the connector's documentation for specific instructions). The example given here uses the OID 11.1.1.6.0 connector (ODSEE/OUD/LDAPV3, Target System = OpenLDAP).
References: https://docs.oracle.com/cd/E22999_01/index.htm
https://docs.oracle.com/cd/E22999_01/doc.111/e28603/extnd_func.htm#BGBBBCGE


1. Create a Java class that contains the transformation logic for the reconciliation field. The transformation logic must be placed under "public Object transform(HashMap parentData, HashMap childData, String sField)" method. Given below is example.

package com.blogspot.oraclestack.transformation;
import java.util.HashMap;
import oracle.core.ojdl.logging.ODLLevel;
import oracle.core.ojdl.logging.ODLLogger;
/**
* Reconciliation Transformation Example
* Uses First Name and Last Name values from the target system
* and constructs Display Name by concatenate both values.
* @author rayedchan
*/
public class OpenLDAPReconciliationEventDataTransformer
{
// Logger
private static final ODLLogger LOGGER = ODLLogger.getODLLogger(OpenLDAPReconciliationEventDataTransformer.class.getName());
/**
* Method for transforming the attributes. Incoming parent and child data are
* from the target system.
* @param parentData HashMap<String,Object> containing parent data details
* @param childData HashMap<String,Object> containing child data details
* @param reconField Name of reconciliation field being transformed
* @return New value for reconciliation field being operated on
*/
public Object transform(HashMap<String,Object> parentData, HashMap<String,Object> childData, String reconField)
{
LOGGER.log(ODLLevel.NOTIFICATION, "Parameters: Parent Data = {0}, Child Data = {1}, Field = {2}", new Object[]{parentData, childData, reconField});
// Get values using the target data. Use reconciliation field name to fetch value.
String firstName = (String) parentData.get("First Name");
LOGGER.log(ODLLevel.NOTIFICATION, "First Name = {0}", new Object[]{firstName});
String lastName = (String) parentData.get("Last Name");
LOGGER.log(ODLLevel.NOTIFICATION, "Last Name = {0}", new Object[]{lastName});
// Construct Display Name
String displayName = firstName + "." + lastName;
LOGGER.log(ODLLevel.NOTIFICATION, "Populating {1} with value = {0}", new Object[]{displayName, reconField});
return displayName;
}
}

2. Create a JAR file with the class and upload JAR file to Oracle Identity Manager as a Java Tasks type. Refer to OIM Upload Jar Utility for instructions.

JAR file Upload Verification

3. Create a new lookup definition (E.g. Lookup.RESOURCE_HERE.UM.ReconTransformation) which contains associations between the reconciliation field being transformed and the fully qualified Java class name that has the transformation logic.

Code Key = The name of the reconciliation field being transformed. This value is passed in as the third parameter in the transform() method.

Decode = The fully qualified Java class name that contains the logic to transform the reconciliation field specified in the Code Key.

LDAP Example:
Lookup.LDAP.UM.ReconTransformation
Code Key = Title
Decode = com.blogspot.oraclestack.transformation.OpenLDAPReconciliationEventDataTransformer

4. Modify the UM Configuration lookup definition for your particular resource (Lookup.RESOURCE_HERE.UM.Configuration) and add an entry for the transformation lookup.

Code Key =  Recon Transformation Lookup
Decode = Name of your transformation lookup definition

LDAP Example:
Lookup.LDAP.UM.Configuration
Code Key = Recon Transformation Lookup
Decode = Lookup.LDAP.UM.ReconTransformation

5. Verify transformation field by running reconciliation scheduled job and inspecting the reconciliation event.

Target User Data in OpenLDAP

LDAP User Reconciliation Scheduled Job

Reconciliation Event with Title field transformed

Custom Logs

2 comments:

  1. Thanks for sharing this example.

    Do you know if it's correct for trusted reconciliation too?

    ReplyDelete