08/16/2022 09:53 AM
Can I get a sample JAR file to understand the code writing?
I want to use preprocessor code in REST connector using modifyuserjson.
08/16/2022 11:20 AM
08/16/2022 09:45 PM
Hi Rushikesh,
Thank you very much for your quick response.
Do you have any sample java code for preprocessor.
I want to understand how you have picked user variable from source(Success Factor) and compared it with Saviynt user.
I am using REST connector API. And I want to check duplicity based on firstname+lastname+DOB.
Thank you,
Sandeep
08/17/2022 10:26 AM
Spring maven code exist in below link
https://saviynt.freshdesk.com/helpdesk/attachments/43201110065
08/21/2022 11:29 PM
Hi Rushikesh,
Have you used the above-shared query during user import using REST connector (modifyuserJSON).
Because your provided document is directing to Third Party Access Governance - Validation Jars.
Thank you,
08/22/2022 04:28 AM - edited 08/22/2022 04:28 AM
Hi @sandeepverma ,
I am providing a sample User Import Preprocessor code which removes accents/diacritics from firstname and lastname in the import feed :
package com.saviynt.pps.preprocessor;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.text.Normalizer;
import java.util.Map;
public class dataNormalizer {
public void removeAccents(Connection connection, Map tempTableNamesMap) throws Exception {
System.out.println("--------------------------------------------------------------------");
System.out.println("Preprocessing Logic initiated!");
System.out.println("Connection=" + connection.toString());
System.out.println("Temp Table Names Map= " + tempTableNamesMap.toString());
String metaDataQuery="select firstname,lastname,username from "+ tempTableNamesMap.get("NEWUSERDATA");
//String existingUsernames="select username from "+ tempTableNamesMap.get("CURRENTUSERS");
ResultSet rs1,rs2;
CallableStatement cstmt=null;
try{
Statement statement=connection.createStatement();
rs1=statement.executeQuery(metaDataQuery);
while(rs1.next()){
System.out.println("Normalising Accents for:"+rs1.getString(3));
String firstname= Normalizer.normalize(rs1.getString(1), Normalizer.Form.NFD).replaceAll("\\p{M}", "");
String lastname=Normalizer.normalize(rs1.getString(2), Normalizer.Form.NFD).replaceAll("\\p{M}", "");
String username=Normalizer.normalize(rs1.getString(3), Normalizer.Form.NFD).replaceAll("\\p{M}", "");
String updateQry="UPDATE " + tempTableNamesMap.get("NEWUSERDATA") + " SET firstname = '" +firstname+ "', lastname='" +lastname+ "' where username='"+username+"'";
cstmt=connection.prepareCall(updateQry);
cstmt.execute();
if (!connection.getAutoCommit()) {
connection.commit();
}
}
System.out.println("Preprocessor Logic Ending!");
}
catch (Exception e){
System.out.println("Exception Occurred: "+e);
}
}
}
Documentation : https://saviynt.freshdesk.com/support/solutions/articles/43000571860-normalizing-the-identity-data-u...