Support Article
Pega does not consider Calendar when using AddTime function
SA-101637
Summary
The Pega application does not consider the Calendar when using the AddTime function in Batch Requestor Context through an agent.
The logic to calculate the Goal and Deadline time is as below:
@(Pega-RULES:BusinessCalendar).addTime(.CaseSLAStartDateTime,0,HoursToAdd,MinutesToAdd,WaitDateTime,true,Calendar)
Error Messages
Not Applicable
Steps to Reproduce
- Configure a workflow with an assignment where the SLA proceeds the case. In the Batch Requestor Context (SLA execution context), the platform determines the Goal and Deadline time.
- Use the AddTime() function to calculate the Goal and Deadline time.
Root Cause
The AddTime function does not work correctly when it runs in the Batch Requestor Context (through an agent).
This works in the Browser Requestor Context when the browser request and the calendar are both in the 'Australia/Sydney' time zone.
The AddTime function does not work in the agent because, the agents run in the Batch Requestor context and the default locale is set to JVM locale (since no operator is associated with it), which is 'ETC/UTC' in this system.
Resolution
Perform the following local-change:
- Change the Calendar in the web node.
- Restart the nodes to reflect the changes.
Published July 18, 2020 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.