In the previous section, we created an AssemblyLine for copying data from the source system to the Profiles database. Another common operation in a production environment is processing updates in source systems and updating appropriate attributes of user's profile in the Profiles database. To do this, you use a special configuration for JDBC Connector in the iterator mode, which makes the connector able to recognize the changes in the source system data. Using this option, the JDBC Connector stores data from a previous run in the Tivoli Directory Integrator System Store and compares the results of the current request with the data in System Store. If it find any changes, the JDBC Connector places the data from the updated record to work object attributes. You can then process the data using Profile Connector.
By default, Tivoli Directory Integrator uses Apache Derby as the System Store database, however, you can configure it to use another relational database such as DB2. This article in Tivoli Directory Integrator documentation provides the how-to information: http://publib.boulder.ibm.com/infocenter/tivihelp/v2r1/topic/com.ibm.IBMDI.doc_7.0/systemstore.htm
In this example, we do not pre-check if the user is available in the Profiles database using Profile Connector because this task has been completed in the previous example. Instead, we demonstrate how to handle an error in Profile Connector to skip an entry if the Connector does not find the user with appropriate unique ID in the Profiles database.
We update only the ipTelephoneNumber and groupwareEmail attributes because the other attributes are not changed in time and therefore, we do not need to update them.
Add JDBC Connector and configure it to process the changes
Perform these steps for this task.
- Create a new AssemblyLine. Click New Assembly Line and call it, for example, processChanges.
- Add a JDBC Connector using the Add component button in your assembly line. Choose Connectors from Select Type Filter on the left side and select JDBC Connector from the Components list. Enter the name for your connector, for example, JDBCConnector_delta. Select Iterator in the Mode dropdown list and click Next.
- Use the same value as before for the following fields and click Finish :
Test the connection by clicking Connect and Next.
- JDBC URL: In our example, it is jdbc:db2://localhost:50000/peopledb.
- JDBC Driver: For DB2, it is com.ibm.db2.jcc.DB2Driver.
- Username: In our example, Administrator.
- Password: User's password.
- Table Name: In this example, it is EMPCUSTDATA, which could be selected using the Select button.
Click the Delta tab, check Enable Delta, and enter a name for an attribute which uniquely identifies record in a table. In our example, it is PREMAIL.
Go back to the Input Map tab and add attributes mapping for IPTELEPHONYNUMBER, PREMAIL, and SECEMAIL.
Add Profiles Connector in update mode
To add the Profiles Connector in update mode, perform these steps:
- Select Update for Mode and name it, for example, ProfileConnector_update.
- Test the connection by clicking Connect .
- On the Output Map tab, click Add to add map work.SECEMAIL to groupwareEmail and work.IPTELEPHONYNUMBER to ipTelephoneNumber.
- On the Link Criteria tab, link the email attribute with $PREMAIL.
- Handle errors if the Profile Connector does not find user record in the Profiles database. Go to the Hooks tab and edit one by one DataFlow (Update) -> Update Error and DataFlow (Update) -> Default On Error by adding the following script:
- Save your work using Ctrl+s.
- (Optional) During the first run of AssemblyLine, JDBC Connector imports values for all work attributes into System Store. To avoid any changes in the Profiles database, disable Profile Connector so it will not update user profile attributes. To disable Profile Connector, change the State of the Profile Connector to Disabled in the dropdown list.
- Run the AssemblyLine for the first time.
After the first run, the Delta Store in Tivoli Directory Integrator System Store stores current values of all work attributes for all users so, next time the JDBC Connector will provide to Profile Connector only the user attributes that have been changed in the table.
Continue with section 4.7 Make a single command line script form an AssemblyLine
Parent topic: 4.0 Tivoli Directory Integrator