Tivoli Directory Integrator – On Multiple Entries

Tivoli Directory Integrator (TDI) is a pretty neat tool that comes packaged with IBM Tivoli Identity Manager (ITIM).  TDI comes out to the box with a multitude of connectors that are used to as the name says, connect to different sources.  One of the most common business processes where TDI is used is to extract data, transform the data and then load the data into different data source (ETL).  For an example, it is common to use TDI to extract Human Resources data and using a DMSL connector, send the data over to the ITIM Application for processing.

One of the main considerations in extracting data from different sources is the data.  The data values, the data relationships and attributes do not always exist as advertised.

For example:  The process pulls the employee information from SAP and then does a lookup to Active Directory using the employee number.  Active Directory is only supposed to have one entry for each employee.  “Supposed to” is the key word.  In some cases, there are multiple AD accounts for one employee.

Tivoli Directory Integrator connector contains Hooks to customize the behavior of the solution; in this blog we will discuss the “On Multiple Entries” hook for a connector in Lookup mode.  This explanation is going with the assumption that you have a working knowledge of TDI so this blog will just dive into the details.

This is one solution to process Multiple Entries in a TDI Lookup Connector.

Assumptions:

  • Link Criteria is by the AD attribute ‘employeeNumber’
  • Connector Mode is Lookup
  • We want to get the samAccountName (s) for a specific employeenumber
  • The data is going to be written to a file with a passive connector named “outputADInformation”

In the “On Multiple Entries” Hook , add the following code.

thisConnector.setCurrent(thisConnector.getFirstDuplicateEntry());

This will set the current record so the output mapping will take the current, move it to the conn and now in the
‘After Lookup’ hook the data will be in Work.

In the “After Lookup” Hook, add the code to process the data and then call the “outputADInformation” connector to write the data to a file.

//write   the value in work for the first multiple entry and for

//instances   where only one record is returned
outputADInformation.add(   work );

//get   the samAccountName for all matching values
if   ( thisConnector.getDuplicateEntryCount() > 0 ) {

var nextEntry;
while (( nextEntry =   thisConnector.getNextDuplicateEntry ()) != null ) {

 //get the value from nextEntry and put it in work
work.setAttribute(“personADID”,   nextEntry.getString(“samAccountName”));
outputADInformation.add(   work );
}

}

There is still some work to do but this should get you past the ‘On Multiple’ data situation.

1 reply
  1. Vince
    Vince says:

    Hello,

    thanks for this solution! It helped me great!

    I noticed something weird however : in the file the last multiple entry is written twice …
    Will try to fix this up … 🙂

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply