0542 (MDM) HubJavaUserExits en H2L
0542 (MDM) HubJavaUserExits en H2L
© Copyright Informatica LLC 2001, 2020. Informatica and the Informatica logo are trademarks or registered
trademarks of Informatica LLC in the United States and many jurisdictions throughout the world. A current list of
Informatica trademarks is available on the web at https://www.informatica.com/trademarks.html.
Abstract
The MDM Hub user exits are based on Java code. This article describes the Java user exits, explains how to implement
Java user exits, and describes best practices to follow when you implement user exits.
Supported Versions
• Multidomain MDM 10.1 - 10.3
Table of Contents
User Exits Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
User Exit Processing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
User Exit JAR Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Implementing the User Exit JAR File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Uploading User Exits to the MDM Hub. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Removing User Exits from the MDM Hub. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
UserExitContext Class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Stage Process User Exits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Post-landing User Exit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Pre-stage User Exit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Post-stage User Exit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Load Process User Exits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Post-load User Exit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Match Process User Exits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Pre-match User Exit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Post-match User Exit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Merge Process User Exits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Post-merge User Exit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Unmerge Process User Exits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Pre-unmerge User Exit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Post-unmerge User Exit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Task Management User Exits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
AssignTasks User Exit Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
GetAssignableUsersForTask User Exit Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2
Guidelines for Implementing User Exits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
For example, you can use a post-landing user exit to perform pre-cleansing on addresses before the delta detection
process.
You upload all the user exits to Informatica MDM Hub in a single JAR file. You can upload one JAR file to each
Operational Reference Store.
Informatica MDM Hub supplies input parameter values when it calls a user exit. Follow the guidelines for implementing
user exits to ensure that the user exits do not unnecessarily decrease performance.
You can implement user exits in the following MDM Hub processes:
Stage Process
The stage process moves data from a landing table to a staging table associated with a base object. You can
run the following user exits during the stage process:
• Post-landing user exit. Use the post-landing user exit to refine data in a landing table after you populate
the landing table through an ETL process.
• Pre-stage user exit. Use a pre-stage user exit to perform custom handling of delta processes.
• Post-stage user exit. Use a post-stage user exit to perform custom processing at the end of a stage job.
Load Process
The load process moves data from a staging table to a base object table. You can run the following user exit
during the load process:
• Post-load user exit. Use a post-load user exit to perform custom processing after the load process.
Match Process
The match process identifies base object records that are potential duplicates. You can run the following
user exits during the match process:
• Pre-match user exit. Use a pre-match user exit to perform custom processing before the match process.
• Post-match user exit. Use a post-match user exit to perform custom processing on the match table.
Merge Process
The merge process consolidates duplicate base object records into a single master base object record. You
run the following user exit during the merge process:
• Post-merge user exit. Use a post-merge user exit to perform custom processing after the merge process.
Unmerge Process
The unmerge process unmerges a single master base object record into the individual base object records
that existed before the records were merged. You can run the following user exits during the unmerge
process:
• Pre-unmerge user exit. Use a pre-unmerge user exit to perform custom processing before the unmerge
process.
• Post-unmerge user exit. Use a post-unmerge user exit to preform custom processing after the unmerge
process.
3
User Exit Processing
Informatica MDM Hub processes the user exits as part of the block, batch, or SIF API transaction, as applicable. If the
user exit generates an exception, Informatica MDM Hub rolls back the processing for the block, batch, or SIF API call.
The SIF APIs and batch processes call the same user exits.
When user exits run during a batch process, the user exits run before or after the batch job runs, with the exception of
the post-load and post-merge user exits. The post-load and post-merge user exits run after Informatica MDM Hub
processes each block. You configure the block size in the cmxserver.properties file when you configure the process
servers.
The Informatica MDM Hub installation includes a JAR file called mdm-ue.jar found in <infamdm_install_dir>\hub
\server\lib. The file mdm-ue.jar contains Java interface classes for each user exit.
Use the MDM Hub Console to upload the user exit JAR file with custom code to the Informatica MDM Hub. You can
upload one user exit JAR file for each Operational Reference Store. If you want to change the implementation of a user
exit in Informatica MDM Hub, first remove the user exits from the Informatica MDM Hub. Then upload a JAR file that
contains the user exits with the latest implementation.
1. Verify that you are connected to the Operational Reference Store that you want to upload user exits to.
2. In the Utilities workbench, select User Object Registry.
3. Acquire a write lock.
4. Select User Exits in the navigation pane.
5. Click the Add button.
6. From the Add User Exit window, select Browse.
7. From the Open window, browse to the JAR file that contains the user exits. Select Open.
8. From the Add User Exit window, optionally enter a description, and then select Ok.
The user exits appear in the user exit table in the properties pane.
4
Removing User Exits from the MDM Hub
To delete all user exits from the Informatica MDM Hub, remove the user exits from the user object registry. You cannot
remove individual user exits.
UserExitContext Class
The UserExitContext class contains the parameters that Informatica MDM Hub to the user exits.
The UserExitContext class passes the following parameters to the user exits:
batchJobRowid
Job ID for the batch job. The UserExitContext class passes the BatchJobRowid parameter to all user exits
during batch processes.
connection
stagingTableName
Source table for the load job. The UserExitContext class passes the stagingTableName parameter during the
load and stage process.
tableName
import java.sql.Connection;
/**
* Represents the hub context that is passed to the user exit interfaces.
* This is a placeholder for data that is applicable to all user exits.
*
*/
public class UserExitContext {
String jobRowid;
String tablName;
String stagingTablName;
Connection conn;
/**
* See the corresponding {@link #setBatchJobRowid(String) setter} method for details.
*
* @return the rowid of the batch job
*/
public String getBatchJobRowid() {
return this.jobRowid;
}
/**
* See the corresponding {@link #setTableName(String) setter} method for details.
*
* @return the name of the table used in the hub process
*/
public String getTableName() {
5
return this.tablName;
}
/**
* See the corresponding {@link #setDBConnection(String) setter} method for details.
*
* @return the database connection used in the hub process
*/
public Connection getDBConnection() {
return this.conn;
}
/**
* Set the rowid of the batch job in the context. This is applicable to batch jobs only.
*
* @param batchJobRowid the rowid of the batch job
*/
public void setBatchJobRowid(String batchJobRowid) {
this.jobRowid = batchJobRowid;
}
/**
* Set the name of the table used in the hub process.
*
* @param tableName the name of the table
*/
public void setTableName(String tableName) {
this.tablName = tableName;
}
/**
* See the corresponding {@link #setStagingTableName(String) setter} method for details.
*
* @return the name of the staging table used in the hub load and stage process
*/
public String getStagingTableName() {
return this.stagingTablName;
}
/**
* Set the name of the staging table used in the context. This is applicable to load and
stage process.
*
* @param stagingTableName the name of the staging table
*/
public void setStagingTableName(String stagingTableName) {
this.stagingTablName = stagingTableName;
}
/**
* Set the database connection in the context.
*
* @param connection the database connection used in the hub process
*/
public void setDBConnection(Connection connection) {
this.conn = connection;
}
6
Stage Process User Exits
The stage process can call the post-landing, pre-stage, and post-stage user exits.
The following figure shows the stage process and the user exits that the stage process can call:
The user exits run within the stage process in the following sequence:
Use the post-landing user exit to refine data in a landing table after you populate the landing table through an ETL
process. You can use the post-landing user exit to perform custom processing on the landing table before delta
detection. For example, you might perform hard delete detection, replace control characters with printable characters,
or perform pre-cleansing processing on addresses.
Interface name
The post-landing user exit uses the following fully qualified interface name:
com.informatica.mdm.userexit.PostLandingUserExit
Methods
The post-landing user exit uses the following methods:
void processUserExit(UserExitContext userExitContext, String stagingTableName, String
landingTableName,
String previousLandingTableName) throws Exception;
7
Parameters
The post-landing user exit uses the following parameters:
landingTableName
previousLandingTableName
The previous landing table name that contains a copy of the source data mapped to the staging table from
the previous time the stage job ran.
stagingTableName
userExitContext
Use a pre-stage user exit to perform custom handling of delta processes. You might use a pre-stage user exit to
determine whether delta volumes exceed predefined allowable limits. For example, you might use the user exit to stop
the stage process if the number of deltas from the source system is greater than 500,000.
Interface Name
The pre-stage user exit uses the following fully qualified interface name:
com.informatica.mdm.userexit.PreStageUserExit
Methods
The pre-stage user exit uses the following methods:
void processUserExit(UserExitContext userExitContext, String stagingTableName, String
landingTableName,
String deltaTableName) throws Exception;
Parameters
The pre-stage user exit uses the following parameters:
deltaTableName
The delta table name. The delta table contains the records that Informatica MDM Hub identifies as deltas.
landingTableName
stagingTableName
userExitContext
8
Post-stage User Exit
Informatica MDM Hub calls the post-stage user exit after Informatica MDM Hub loads data into a staging table.
Use a post-stage user exit to perform custom processing at the end of a stage job. You might use a post-stage user
exit to process rejected records from the stage job. For example, you might configure the user exit to delete records
that Informatica MDM Hub rejects for known, noncritical conditions.
Interface Name
The post-stage user exit uses the following fully qualified interface name:
com.informatica.mdm.userexit.PostStageUserExit
Methods
The post-stage user exit uses the following methods:
void processUserExit(UserExitContext userExitContext, String stagingTableName, String
landingTableName,
String previousLandingTableName) throws Exception;
Parameters
The post-stage user exit uses the following parameters:
landingTableName
previousLandingTableName
The previous landing table name that contains the copy of the source data mapped to the staging table from
the previous time the stage job ran.
stagingTableName
userExitContext
9
Load Process User Exits
The load process can call the post-load user exit.
The post-load user exit runs after each block in processed instead of at the end of the batch process. The following
figure shows the load process and the user exits that the load process can call:
The post-load user exit runs within the load process in the following sequence:
Use a post-load user exit to perform custom processing after the load process.
Interface Name
The post-load user exit uses the following fully qualified interface name:
com.informatica.mdm.userexit.PostLoadUserExit
10
Methods
The post-load user exit uses the following methods:
void processUserExit(UserExitContext userExitContext, ActionType actionType,
Map<String, Object>baseObjectDataMap, Map<String, Object> xrefDataMap,
List<Map<String, Object>> xrefDataMapList) throws Exception;
Parameters
The post-load user exit uses the following parameters:
actionType
Indicates whether the load job inserted the record or updated the record.
userExitContext
The following figure shows the match process and the user exits the match process can call:
The user exits run within the match process in the following sequence:
Use a pre-match user exit to perform custom processing before the match process.
11
Pre-match User Exit Interface
Use the appropriate interface name, methods, and parameters when you implement the pre-match user exit.
Interface Name
The pre-match user exit uses the following fully qualified interface name:
com.informatica.mdm.userexit.PreMatchUserExit
Methods
The pre-match user exit uses the following methods:
void processUserExit(UserExitContext userExitContext, String matchSetName) throws Exception;
Parameters
The pre-match user exit uses the following parameters:
matchSetName
userExitContext
Use a post-match user exit to perform custom processing on the match table. For example, you might use a post-
match user exit to manipulate matches in the match queue.
Interface
The post-match user exit uses the following fully qualified interface name:
com.informatica.mdm.userexit.PostMatchUserExit
Methods
The post-match user exit uses the following methods:
void processUserExit(UserExitContext userExitContext, String matchSetName) throws Exception;
Parameters
The post-match user exit uses the following parameters:
matchSetName
The name of the match rule set that Informatica MDM Hub used to find the match.
userExitContext
12
Merge Process User Exits
The merge process can call the post-merge user exit.
The following figure shows the merge process and the user exits the merge process can call:
The user exits run within the merge process in the following sequence:
Use a post-merge user exit to perform custom processing after the merge process. For example, you might use a post-
merge user exit to match and merge child records affected by the match and merge of a parent record.
Interface Name
The post-merge user exit uses the following fully qualified interface name:
com.informatica.mdm.userexit.PostMergeUserExit
Methods
The post-merge user exit uses the following methods:
void processUserExit(UserExitContext userExitContext, List<String> baseObjectRowIds) throws
Exception;
Parameters
The post-merge user exit uses the following parameters:
13
baseObjectRowIds
List of base object row IDs involved in the merge. The first entry is the target base object record. The
remaining entries in the list are the source base objects that merged into the target.
userExitContext
The following figure shows the unmerge process and the user exits that the unmerge process can call:
The user exits run within the unmerge process in the following sequence:
Use a pre-unmerge user exit to perform custom processing before the unmerge process.
Interface Name
The pre-unmerge user exit uses the following fully qualified interface name:
com.informatica.mdm.userexit.PreUnmergeUserExit
14
Methods
The pre-unmerge user exit uses the following methods:
void processUserExit(UserExitContext userExitContext, String rowidSystem,
String pkeySourceObject) throws Exception;
Parameters
The pre-unmerge user exit uses the following parameters:
pkeySourceObject
rowidSystem
The system row ID of the cross-reference record for the base object that the unmerge processes.
userExitContext
Use a post-unmerge user exit to preform custom processing after the unmerge process.
Interface Name
The post-unmerge user exit uses the following fully qualified interface name:
com.informatica.mdm.userexit.PostUnmergeUserExit
Methods
The post-unmerge user exit uses the following methods:
void processUserExit(UserExitContext userExitContext, String rowidObject) throws Exception;
Parameters
The post-unmerge user exit uses the following parameters:
rowidObject
userExitContext
Passes parameters to the user exit.
15
Task Management User Exits
You can use the AssignTasks user exit and the GetAssignableUsersForTask user exit for task management.
Interface Name
The AssignTasks user exit uses the following fully qualified interface name:
com.informatica.mdm.userexit.AssignTasksUserExit
Methods
The AssignTasks user exit uses the following methods:
void processAssignTasks(UserExitContext userExitContext, int maxTasks)
Parameters
The AssignTasks user exit uses the following parameters:
userExitContext
maxTasks
Interface Name
The GetAssignableUsersForTask user exit uses the following fully qualified interface name:
com.informatica.mdm.userexit.GetAssignableUsersForTaskUserExit
Methods
The GetAssignableUsersForTask user exit uses the following methods:
public List<String> processGetAssignableUsersForTask(String taskType, String rowidSubjectArea,
UserExitContext userExitContext)
Parameters
The GetAssignableUsersForTask user exit uses the following parameters:
rowidSubjectArea
taskType
16
userExitContext
When you implement user exits, you affect Informatica MDM Hub performance. Consider if you need to use a
user exit to accomplish what you want to do, or if you can do the same thing asynchronously without relying
on user exits.
For example, when you load data, you might want to create tasks for the pending records. Although it is
possible to create tasks with a user exit, it is unnecessary. You create a bottleneck in the process and
unnecessarily decrease performance. You can create the tasks later because these tasks are not critical at
that point in the process.
The Java user exit context provides a database connection. Use this database connection to query the
database or update the database through direct JDBC calls or SIF API calls.
Consider how SIF API calls from a user exits affects batch performance.
When you call SIF APIs from a user exit, consider how these calls affect batch processes.
Do not use the MDM Hub tables directly if you can use an equivalent SIF API.
If you use the database connection to make SIF API calls or direct JDBC calls, the calls participate in the
same transaction as the user exit caller. The user exit caller maintains the changes made in the transaction.
Do not explicitly call commit or rollback on the connection passed to the user exits.
User exits run with full access to MDM Hub objects. User exits run with full access to MDM Hub Object
regardless of the context. You can use the user exit SIF client to call a subset of supported SIF APIs. Only the
supported SIF APIs can participate in the same transaction as the user exit caller. You cannot use the user
exit SIF client to access unsupported SIF APIs.
To avoid recursive pre-unmerge user exit calls, do not use the Unmerge SIF API with the post-unmerge user
exit.
To avoid recursive post-merge user exit calls, do not use the MultiMerge SIF API with the post-merge user
exit.
To avoid recursive post-load user exit calls, do not use the MultiMerge SIF API with the post-load user exit.
When you use the Put API with the post-load user exit, set the Put API BypassPostLoadUE parameter to true
to prevent recursive post-load user exit calls.
17
Author
MDM Documentation Team
18