yesamer commented on code in PR #6394:
URL: 
https://github.com/apache/incubator-kie-drools/pull/6394#discussion_r2194323526


##########
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/util/EvalHelper.java:
##########
@@ -167,6 +179,19 @@ public static PropertyValueResult getDefinedValue(final 
Object current, final St
                 case "weekday":
                     result = ((TemporalAccessor) 
current).get(ChronoField.DAY_OF_WEEK);
                     break;
+                case "value":
+                    result = null;
+                    if (current instanceof LocalTime) {
+                        result = BigDecimal.valueOf(((LocalTime) 
current).toSecondOfDay());
+                    } else if (current instanceof OffsetTime) {
+                        result = BigDecimal.valueOf(((OffsetTime) 
current).toLocalTime().toSecondOfDay());
+                    } else if (current instanceof LocalDate date) {
+                        ZonedDateTime dtAtMidnightUTC = 
date.atStartOfDay(ZoneOffset.UTC);
+                        result = 
BigDecimal.valueOf(dtAtMidnightUTC.toEpochSecond());
+                    } else if (current instanceof ZonedDateTime) {
+                        result = BigDecimal.valueOf(((ZonedDateTime) 
current).toEpochSecond());
+                    }
+                    break;

Review Comment:
   @AthiraHari77 Can you please add at least one test for any single `if` 
branch? eg. it seems to me the first `if` is not covered. Thanks



-- 
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