martinweiler commented on code in PR #3788:
URL: 
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3788#discussion_r1851034452


##########
jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/timer/BusinessCalendarImpl.java:
##########
@@ -494,4 +500,66 @@ protected void handleWeekend(Calendar c, boolean 
resetTime) {
             dayOfTheWeek = c.get(Calendar.DAY_OF_WEEK);
         }
     }
+
+    private void validateProperties() {
+
+        boolean startHourProvided = validateRequiredProperty(START_HOUR);
+        boolean endHourProvided = validateRequiredProperty(END_HOUR);
+        if (startHourProvided) {
+            startHour = getPropertyAsInt(START_HOUR);
+            validateRangeForProperty(startHour, START_HOUR, 0, 23, null, null);
+        }
+        if (endHourProvided) {
+            endHour = getPropertyAsInt(END_HOUR);
+            validateRangeForProperty(endHour, END_HOUR, 0, 23, null, null);
+        }
+        if (startHourProvided && endHourProvided) {
+            hoursInDay = startHour < endHour ? endHour - startHour : (24 - 
startHour) + endHour;
+        }
+
+        for (int weekendDay : weekendDays) {
+            validateRangeForProperty(weekendDay, WEEKEND_DAYS, 0, 7, "No 
weekend day", "Saturday");
+        }
+        if (timezone != null && !isValidTimeZone(timezone)) {
+            errorMessage.append("Invalid timezone: 
").append(timezone).append(". Refer to valid timezones: 
https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html\n";);
+        }
+
+        if (!errorMessage.isEmpty()) {
+            throw new IllegalArgumentException(errorMessage.toString());
+        }
+    }

Review Comment:
   It would be good to emit a log message here that summarizes the settings, 
including the configured ones.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to