Click HERE to see how Saviynt Intelligence is transforming the industry. |
11/02/2022 02:59 AM
Hello,
I am trying to run a Custom Action from a JAR in a User Update Rule.
My rule is (triggered when user is updated from UI):
If Users.First Name is updated OR Users.middlename is updated OR Users.lastname is updated OR Users.Custom Property 1 is updated OR Users.country is updated OR Users.Custom Property 4 is updated
Then
(Custom Action)
In the Custom Action attributes, I am putting the good values for class name and method name.
Then, I modify country of a user in the UI. The rule is triggered (I can see it in the Update History of the user and in the Rule Execution trail). But, the custom action does not run successfully with the following error in logs : (just to say, at the begginning of my method, there is a log to say that we enter the method, and I can not find it in logs, so my method is not even called).
[quartzScheduler_Worker-10] DEBUG changeaction.UserChangeActionService - action to be taken::[29###doCustomAction###14###com.saviynt.custom.UserPreprocessValidator.validator.UserCustomAction]
[quartzScheduler_Worker-10] DEBUG changeaction.UserChangeActionService - Exiting checkAndExecuteRules
[quartzScheduler_Worker-10] DEBUG changeaction.UserChangeActionService - newbatchMap [29###doCustomAction###14###com.saviynt.custom.UserPreprocessValidator.validator.UserCustomAction:[testuser]]
[quartzScheduler_Worker-10] DEBUG changeaction.UserChangeActionService - Calling customAction, keysarr - [29, doCustomAction, 14, com.saviynt.custom.UserPreprocessValidator.validator.UserCustomAction]
[quartzScheduler_Worker-10] DEBUG changeaction.UserChangeActionService - class: com.saviynt.custom.UserPreprocessValidator.validator.UserCustomAction, method: doCustomAction
[quartzScheduler_Worker-10] DEBUG changeaction.UserChangeActionService - Custom Action -\u003e Class Name : com.saviynt.custom.UserPreprocessValidator.validator.UserCustomAction
[quartzScheduler_Worker-10] DEBUG changeaction.UserChangeActionService - Custom Action -\u003e Method Name : doCustomAction
[quartzScheduler_Worker-10] ERROR changeaction.UserChangeActionService - Exception
groovy.lang.MissingPropertyException: No such property: db for class: com.saviynt.ecm.services.changeaction.UserChangeActionService
at com.saviynt.ecm.services.changeaction.UserChangeActionService.customAction(UserChangeActionService.groovy:12155)
at com.saviynt.ecm.services.changeaction.UserChangeActionService$_excuteFinal_closure7.doCall(UserChangeActionService.groovy:605)
at com.saviynt.ecm.services.changeaction.UserChangeActionService.excuteFinal(UserChangeActionService.groovy:442)
at com.saviynt.rulerun.RuleRunService$_runRulesWithTrail_closure11_closure32_closure33.doCall(RuleRunService.groovy:693)
at com.saviynt.rulerun.RuleRunService$_runRulesWithTrail_closure11_closure32.doCall(RuleRunService.groovy:614)
at com.saviynt.rulerun.RuleRunService$_runRulesWithTrail_closure11.doCall(RuleRunService.groovy:612)
at com.saviynt.rulerun.RuleRunService.runRulesWithTrail(RuleRunService.groovy:611)
at com.saviynt.rulerun.RuleRunService.runRules(RuleRunService.groovy:57)
at RuleRunJob.execute(RuleRunJob.groovy:60)
at org.quartz.core.JobRunShell.run(JobRunShell.java:199)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546)
Any idea on this error ?
Thanks
11/02/2022 11:29 AM
You have error in custom code,
groovy.lang.MissingPropertyException: No such property: db
if possible attach code or share snippet
11/03/2022 03:38 AM
Hello,
I do not think this is a problem related to custom code.
The code I am testing with is a simple code (which you can find below).
I can't even see the println in logs when trying to run Custom Action from User Update rule (even though the rule is triggered).
However, when I run this method (doCustomAction) from a job (ExternalJarJob), it is working and I see traces in logs.
Also, I've looked for "db" in my code and it does not appear anywhere.
public class UserCustomAction {
[...]
public void doCustomAction(String userJson){
System.out.println("doCustomAction: "+userJson);
}
public void doCustomAction(){
System.out.println("doCustomAction");
}
public void doCustomAction(Map<String, Object> map){
System.out.println("doCustomAction: "+map.toString());
}
[...]
}
Regards,
Benjamin