I am facing one weird issue with my custom workflow.
I have 5 steps in a custom workflow and at the 5th step I am having a method which refresh’s the users roles and save the status of the step in workflow variable as shown below.
→ Method is executing successfully and after that I am getting below issue and terminating the workflow.
An unexpected error occurred: sailpoint.tools.GeneralException: The application script threw an exception: java.lang.NullPointerException BSF info: script at line: 0 column: columnNo
The above issue is coming only in production and working smoothly in DEV& QA instances and I am unable to reproduces and find the RCA.
Can you help us with you suggestions to fix the issue.
If it could not find the identity in the first place it will give back a null object. If you execute any method on it like the .getName() however it will throw you a null pointer. Because it cannot get a name from a null object.
Thanks for your response.
I have tried by adding multiple loggers and able to see the error is coming at send_email method but still unable to understand the root cause of the issue.
→ send_email(context,workflow); method is used to send a mail to the approver of the workitem.
->I have kept a logger (like : entering into method send_email) in send_email before executing the logic but even that is not getting printed in my log file and it getting failed with the below exception.
An unexpected error occurred: sailpoint.tools.GeneralException: The application script threw an exception: java.lang.NullPointerException BSF info: script at line: 0 column: columnNo
So your null pointer is already happening before the send_email method is executed.
What does this method do exactly: refershRoles(context, identity)?
Could it be that it is getting an attribute or something from the identity and trying to calculate some things on this attribute while it is actually not existing thus null? Are you sure the workflow variable is defined as it should be and not returning null?
refershRoles(context, identity) will refresh the birthright roles of the user based on the staffType i obseved the logs no issue with the above method.
I kept the loggers like below :-
in the above method I am getting the workflow variables and send mail to the approver.
but my question is if it is getting errored out in the method then it should print me the entering into send_email logger but even that is not coming in my loggers
Okay, could still be something with the logic in your send_mail method.
What happens when you comment all your logic out except for the loggers and the return? Does it providing the loggers then? If so you should check what it is in your logic what returns this null pointer