Support Article
ToWorkParty @checkForSubstitute NPE due to null value actionDate
SA-19226
Summary
BPM Router activity with "Check Availability" throws NullPointerException. In the assignment if you check the box "Check Availability", and the operator is not available at that time then it throws NullPointerException and the flow goes into error. Ideally it should find the substitute operator provided in the operator page and assign the task to the substitute.
Error Messages
NullPointerException.
The stack trace shows function "IsAvailableSpecificDay"
Steps to Reproduce
1. Set the operator unavailable for a week by selecting the dates Unavailable from/to.
2. Operator’s calendar should have Europe/Paris timezone
3. Now set the working hour from 080000-170000 to 080000-080001 ( just to make sure you are creating a ticket out of business hour)
4. Make sure that the assignment has Check Availability option checked.
5. Create an assignment for this user.
The ToWorkParty activity (OOTB) throws a NullPointerException when it tries to call the function @checkForSubstitute()
IsAvailableSpecificDay() which is called by the checkForSubstitute() function throws the nullpointer error because of null value on actionDate variable.
In IsAvailableSpecificDay() function, on line 57 parseDateTimeString() returns null value.
Create a flow with an assignment.
In the assignment, select any router ( To Worklist, To WorkParty ) and check the box "Check Availability" to true.
Make sure that the person who is getting the work is not available on that date. ( select Unavailable from/to dates, and provide a substitute operator )
Run the flow, you will get null pointer error.
Root Cause
A defect in Pegasystems’ code or rules:
NullPointerException is due to objStartDate which is not getting set/returned by the "isAvailable" function.
parseDateTimeString API is being used to parse the DateString value in isAvailable, differenceBetweenDays,
nextBusinessDay API's , which in turn calls parseInternalDateTime API, in which we are just doing substring of the dateValue expecting
only 23 characters in the date string as we generally have timeZones as GMT,IST,EST etc.
But here the timeZone is CEST, so when the substring is done on the dateString value timeZone in the dateString is truncated to 'CES' only, so the parsing of date value fails.
Resolution
Apply HFix-25565
Published February 9, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.