Click HERE to see how Saviynt Intelligence is transforming the industry. |
05/30/2024 02:55 PM
Hi,
I need to perform validation through an external jar during the schema upload of users. I want to know how I should specify this in the SAV file. I have looked at the samples and in the MODIFYUSERDATAJSON, the class and method names are passed, but I need to know the exact format. Also, is COMPUTEDCOLUMNS mandatory even for jar validations?
Currently, I have used the following format. Please correct me if I am providing anything incorrectly:
#MODIFYUSERDATAJSON={
"COMPUTEDCOLUMNS" : ["USERNAME","FIRSTNAME","LASTNAME","EMAIL","PHONENUMBER","DEPARTMENTNUMBER","STARTDATE","ENDDATE","CUSTOMPROPERTY32","OWNER"],
"PREPROCESSQUERIES" : ["CUSTOMFUNCTION###FUNCTION1"],
"CUSTOMFUNCTIONS" : {
"FUNCTION1" : {
"FULLCLASSNAME" : "com.saviynt.custom.UserPreprocessValidator.validator.UserBulkCustomValidator",
"METHODNAME" : "validateOrganizationUserRule"
}
}
}
This is the final error that I got in the job log:
Error in Users Import - Error while processing data: No signature of method:
com.saviynt.custom.UserPreprocessValidator.validator.UserBulkCustomValidator.validateOrganizationUserRule()
is applicable for argument types:
(com.mysql.cj.jdbc.ConnectionImpl, java.util.HashMap) values:
[com.mysql.cj.jdbc.ConnectionImpl@2450bc23, ...]
Possible solutions:
validateOrganizationUserRule(java.lang.String)
Please help me here.
Regards,
Gokul
Solved! Go to Solution.
06/02/2024 11:56 PM
Hi @gokul
could you please validate if the arguments passed to the method validateOrganizationUserRule are of correct type. What are you passing to this method and what is expected to be returned are they matching with the method definition. Please validate and confirm.
Regards,
Dhruv Sharma
06/03/2024 07:39 PM
It seems java method needs string as input
06/03/2024 10:25 PM
Hi @Dhruv_S @rushikeshvartak
For this method, I am passing the user list as a string, and I have also defined the return type as a string. This is the default method provided in the sample Saviynt bulk user upload validation source file. Also, it works fine when I perform an import through the UI.
public String validateOrganizationUserRule(String userListJson) {
String validatedresponse = gson.toJson(userDataList);
return validatedresponse;
}
06/03/2024 10:40 PM
Can you share full logs
08/08/2024 08:00 PM - edited 08/08/2024 08:05 PM
To trigger the custom validation JAR in the Schema User Upload, we must use the predefined method and class name in the SAV file. By calling the method name `doCustomPreprocessValidation`, we can successfully perform the validation.
Reference Code - https://docs-be.saviyntcloud.com/bundle/SSM-Admin-v55x/page/Content/Resources/Attachments/Connection...
Note: We encountered an issue when using the same package name, class name, and method name. When created this way, regardless of the logic entered inside the method, it defaults to the logic specified in the sample. To resolve this, we changed the package name, and it then worked fine for us.