Question
Infosys Limited
IN
Last activity: 15 Mar 2023 10:53 EDT
Closed day in calendar skipped sporadically
We are using business days to calcualte the wait time in or application using the below expression @(Pega-RULES:BusinessCalendar).addTime(Param.Date, 8, 0, 0, 0, true, DCMDefault)
Param.Date is calculated using the below expression @(Pega-RULES:DateTime).CurrentDate("yyyyMMdd", OperatorID.pyTimeZone)
We observe that when we calcuate teh wait time from Decemebr 20 and later dates, we see that the wait time does not sometimes include January2, 2023 (which is one of the closed days as per 2023 calendar).
Can you let us know why this issue would happen and possible way to fix it. Have attached the screenshot of both 2022 and 2023 calendars with closed days for reference.
***Edited by Moderator Marije to remove SD specific Product and Version, add closed Enh.Req***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Updated: 3 Mar 2023 0:56 EST
Wipro
US
In a project for a financial services client, we had difficulty calculating business days for wait time in their Pega application due to differences in time zones between the calendar settings and the application. We fixed the issue by updating the time zone settings in the Pega application to match the calendar's time zone. The BusinessCalendar class in Pega is customizable, and it's essential to keep the business calendar updated to reflect any changes in the holiday schedule. Additionally, it's necessary to consider other dependencies and factors that may affect wait time calculation. In summary, it's crucial to ensure that the correct time zone is set in the application, and all closed days are appropriately configured in the business calendar while also considering any dependencies and factors affecting the wait time calculation.
Infosys Limited
IN
@RishabR16722312 Agreed. So We needed to calculate the 8 business days from Dec 21, 2022. Taking this into consideration weekends and closed days (in calendar) should not be calculated when arriving at Wait Time.
Going by this if I calculate Wait Time, it should wait till Jan 4, 2023 as per business days (26Dec 2022 and 2Jan2023 are closed days + weekends). But 8 business days from Dec 21, 2022 came up as Jan 3, 2023 instead of Jan 4, 2023.
Also, this behaviour does not seem to be consistent. One thing to note is that these behaviours are observed when the wait time is calculated across 2 calendar year (2022 and 2023). Please refer to the screenshot of both 2022 and 2023 calendars for reference.
Can you tell us what could have caused this behaviour or if this is a known issue in Pega for which Hotfix is available.
Updated: 3 Mar 2023 21:08 EST
Wipro
US
Thank you for your response regarding the issue you are facing with calculating wait time in your Pega application. Based on the information you have provided, it appears that the issue may be related to differences in time zones between the calendar settings and the application.
To resolve this issue, I recommend taking the following steps:
- Check the time zone settings in your Pega application and ensure that they match the time zone of your calendar. This can be done by going to the Admin Studio, selecting System > Settings > Regional Settings, and setting the correct time zone.
- Ensure that all closed days are appropriately configured in the business calendar. You can do this by going to the Business Calendar in Dev Studio and adding any closed days to the calendar.
- Check for any inconsistencies in wait time calculation across two calendar years. If the issue persists, provide me with the exact steps to reproduce the issue and any error messages or log files that you have.
Thank you for your response regarding the issue you are facing with calculating wait time in your Pega application. Based on the information you have provided, it appears that the issue may be related to differences in time zones between the calendar settings and the application.
To resolve this issue, I recommend taking the following steps:
- Check the time zone settings in your Pega application and ensure that they match the time zone of your calendar. This can be done by going to the Admin Studio, selecting System > Settings > Regional Settings, and setting the correct time zone.
- Ensure that all closed days are appropriately configured in the business calendar. You can do this by going to the Business Calendar in Dev Studio and adding any closed days to the calendar.
- Check for any inconsistencies in wait time calculation across two calendar years. If the issue persists, provide me with the exact steps to reproduce the issue and any error messages or log files that you have.
Regarding the inconsistency in behavior that you have observed when calculating wait time across two calendar years, I recommend investigating this issue further to provide an accurate solution. Specifically, I suggest gathering the exact steps taken to calculate the wait time and any error messages or log files that were generated during the process. This information will help me identify the root cause of the issue and provide a more accurate solution.
To resolve the issue of wait time calculation, I have provided some guidance above. The three steps above are my recommendation to ensure accurate wait time calculation.
In addition to the above steps, I recommend regularly updating the business calendar to reflect any changes in the holiday schedule and considering any dependencies or factors that may affect wait time calculation.
In the past, we have had (I have led Pega projects for over 9 years - this is based on expertise and experience) clients in the financial services industry who had specific holiday schedules for different regions and countries. To ensure accurate wait time calculation, we needed to update the business calendar regularly to reflect any changes in the holiday schedule.
In addition, we have had clients with complex approval workflows that depended on multiple factors such as the type of request, the requester's role, and the urgency of the request. In these cases, we needed to consider all the dependencies when calculating the wait time to ensure that the request was processed in a timely manner.
Overall, it's essential to take into account any dependencies or factors that may affect wait time calculation and regularly update the business calendar to reflect any changes in the holiday schedule. By doing so, we can ensure accurate and reliable wait time calculation in the Pega application.
Here are some additional dependencies that can affect wait time calculation and the actions we took to address them:
- Time zone differences between different locations: In some cases, a business may have multiple locations with different time zones. This can affect wait time calculation if not taken into account. To address this, we (bringing experience from myself and my team from past projects) recommend setting up separate business calendars for each location and configuring them with the correct time zones.
- Different work schedules for different teams or departments: In some organizations, different teams or departments may have different work schedules or holidays. This can affect wait time calculation if not taken into account. To address this, we recommend setting up separate business calendars for each team or department and configuring them with their respective work schedules and holidays.
- Dependencies on external systems or services: In some cases, wait time calculation may depend on external systems or services, such as payment gateways or third-party APIs. Any downtime or issues with these systems can affect wait time calculations. To address this, we recommend setting up appropriate monitoring and alerting systems to quickly identify and resolve any issues with external dependencies.
- Complex business rules or workflows: In some cases, wait time calculation may be affected by complex business rules or workflows. To address this, we recommend thoroughly reviewing and testing all business rules and workflows involved in wait time calculation to ensure that they are accurate and efficient.
- Changes in regulation or compliance requirements: In some industries, changes in regulations or compliance requirements can affect wait time calculation. To address this, we recommend regularly reviewing and updating the business calendar to reflect any changes in regulations or compliance requirements.
In the past, my team and I have faced similar dependencies, such as time zone differences between different locations and complex business rules or workflows. To address these, we worked closely with our clients to identify and understand the dependencies involved and provided tailored solutions that addressed their specific needs. We also provided guidance on best practices for maintaining the business calendar and reviewing and testing business rules and workflows to ensure accurate wait time calculation.
Overall, by investigating the issue further and following the recommended steps I have provided, we should be able to ensure accurate wait time calculation in your Pega application.
Up until now, this should have given you some specific recommendations relevant to the guidance and context you have provided.
Additionally, just to reiterate, if you have any error messages or log files related to the issue, please provide them to me so that I can investigate further.
If you are able to provide this information, I can analyze them to get more information about the issue and identify the root cause.
In the past, we have used error messages and log files to troubleshoot issues and provide more specific recommendations to customers. For example, if we receive an error message related to a specific activity or rule, we can analyze the logs to understand how the rule was executed and identify any issues or errors. This information can then be used to provide more specific recommendations to the customer.
We have also used log files to track the flow of data and identify any issues related to data processing or integration. For example, if we receive a log file related to an issue with a database connection, we can analyze the logs to understand how the data was retrieved and identify any issues or errors.
Overall, by analyzing error messages and log files, we can gain a deeper understanding of the issue and provide more specific and targeted recommendations to the customer (like you).
As for your question about whether this is a known issue in Pega for which a hotfix is available, we recommend opening a support ticket with Pega Support for further assistance in resolving the issue and determining if a hotfix is necessary. To do this, please go to the My Support Portal and log in. From there, you can create a new support ticket and provide the details of the issue you are experiencing.
I hope this information, recommendations and context provided based on my experience and projects with clients helps you resolve the issue. I am available to help should you decide to come back with more context and/or questions. If this helps you solve your problem, I am happy I could help.
Updated: 3 Mar 2023 20:55 EST
Wipro
US
In essence, the problem you have reported is that when calculating a wait time in a Pega application, the result is inconsistent and not always accurate when calculating across two calendar years. Specifically, the reported scenario involves calculating 8 business days from Dec 21, 2022, but the result is Jan 3, 2023 instead of Jan 4, 2023, which is the expected result. The solution recommended is to check the time zone settings in the Pega application and ensure they match the time zone of the calendar, ensure all closed days are appropriately configured in the business calendar, and check for any inconsistencies in wait time calculation across two calendar years. It is also recommended to regularly update the business calendar to reflect any changes in the holiday schedule and consider any dependencies or factors that may affect wait time calculation. Additionally, I suggest investigating the issue further by gathering the exact steps taken to calculate the wait time and any error messages or log files that were generated during the process.
In essence, the problem you have reported is that when calculating a wait time in a Pega application, the result is inconsistent and not always accurate when calculating across two calendar years. Specifically, the reported scenario involves calculating 8 business days from Dec 21, 2022, but the result is Jan 3, 2023 instead of Jan 4, 2023, which is the expected result. The solution recommended is to check the time zone settings in the Pega application and ensure they match the time zone of the calendar, ensure all closed days are appropriately configured in the business calendar, and check for any inconsistencies in wait time calculation across two calendar years. It is also recommended to regularly update the business calendar to reflect any changes in the holiday schedule and consider any dependencies or factors that may affect wait time calculation. Additionally, I suggest investigating the issue further by gathering the exact steps taken to calculate the wait time and any error messages or log files that were generated during the process.
Hotfix: As I mentioned, it is difficult to say if this is a known issue in Pega for which a hotfix is available without further investigation. I recommend opening a support ticket with Pega Support for further assistance in resolving the issue and determining if a hotfix is necessary. To do this, please go the My Support Portal and log in. From there, you can create a new support ticket and provide the details of the issue you are experiencing. The support team will be able to investigate the issue and provide you with the most accurate information regarding any known issues and available hotfixes.
Please see above for a more detailed response.
Updated: 15 Mar 2023 10:53 EDT
Pegasystems Inc.
GB
Please note that Pega's basic DateTime representation is time zone UTC. - it uses Java's Instant https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html which is always in UTC.
App designers should convert it to a local date time when displaying it to the user.
Problems occur if operator and business calendar time zones are different. If both are same will not face this issue.
Please find the same from the below articles:
How BusinessCalendar functions AddDays() and AddTime() treat holidays, weekends, and time zones
Troubleshooting DateTime issues
DifferenceBetweenDays is calculated incorrectly
You have not specified the version of Pega that you are using.
I have checked and no hotfixes exist for any Pega 8.x versions related to faulty Business Calendar issues.
Please go through our Resolved Issues documentation to confirm.
Please note that Pega's basic DateTime representation is time zone UTC. - it uses Java's Instant https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html which is always in UTC.
App designers should convert it to a local date time when displaying it to the user.
Problems occur if operator and business calendar time zones are different. If both are same will not face this issue.
Please find the same from the below articles:
How BusinessCalendar functions AddDays() and AddTime() treat holidays, weekends, and time zones
Troubleshooting DateTime issues
DifferenceBetweenDays is calculated incorrectly
You have not specified the version of Pega that you are using.
I have checked and no hotfixes exist for any Pega 8.x versions related to faulty Business Calendar issues.
Please go through our Resolved Issues documentation to confirm.
If this does not answer your question, then as @RishabR16722312 suggests you could log a support incident. Please provide the INC reference here so that we can help track it.