Details
-
Fix
-
Status: Released (View Workflow)
-
Minor
-
Resolution: Fixed
-
2.0.0
-
None
-
None
Description
Current Situation
- When the Schedule Run-time contains an invalid Period definition (e.g. Period begin = 40) the Daily Plan crashes with the following exception (jetty.log):
Exception in thread "Timer-7" java.time.format.DateTimeParseException: Text '2022-09-01 40:00:00' could not be parsed: Invalid value for HourOfDay (valid values 0 - 23): 40 at java.base/java.time.format.DateTimeFormatter.createError(DateTimeFormatter.java:2023) at java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1958) at java.base/java.time.LocalDateTime.parse(LocalDateTime.java:494) at com.sos.joc.classes.JobSchedulerDate.convertDateTimeZoneToTimeZone(JobSchedulerDate.java:286) at com.sos.joc.dailyplan.common.PeriodResolver.addRepeat(PeriodResolver.java:91) at com.sos.joc.dailyplan.common.PeriodResolver.addStartTimes(PeriodResolver.java:60) at com.sos.joc.dailyplan.DailyPlanRunner.calculateStartTimes(DailyPlanRunner.java:843) at com.sos.joc.dailyplan.DailyPlanRunner.generateDailyPlan(DailyPlanRunner.java:267) ....
Desired Behaviour
- The Daily Plan should not crash when an exception occurs.
- The error message should contain details about the cause of the error and be logged in the appropriate log files (joc.log, service-dailyplan.log).
Test Instructions
- Create a schedule with Plan Order automatically=true and Repeat Interval = Repeat.
- set values and Store your changes.
- Use Edit JSON and overwrite the period with:
"periods": [ { "begin": "40", "end": "15:00:00", "repeat": "01:00:00", "whenHoliday": "SUPPRESS" } ]
- Restart the Daily Plan service and check the (joc.log and service-dailyplan.log). log files.
- Expected result: the Daily Plan service should generate orders for all schedules except schedule with the wrong begin time.