[jboss-jira] [JBoss JIRA] (DROOLS-1596) Error checking allowed values for input nodes of duration and date and time types
Edson Tirelli (JIRA)
issues at jboss.org
Fri Jun 2 18:03:00 EDT 2017
[ https://issues.jboss.org/browse/DROOLS-1596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13415927#comment-13415927 ]
Edson Tirelli commented on DROOLS-1596:
---------------------------------------
I found two problems here.
1. Period class in Java does not implement Comparable, so it was raising a ClassCastException behind the scenes and swallowing it. Fixed.
2. The input "2017-05-16T17:58Z" is a zoned date and time, so it can't be compared to the local date and time from the ranges. They both have to be zoned, or both have to be local. There was, however no helpful error message before, so I fixed the engine to provide one. It now will show something like this:
Error checking allowed values for node 'dateTime': Value '2017-05-16T17:58Z' is not comparable with range '( 2017-05-01T14:03 .. 2017-05-31T14:03 )
> Error checking allowed values for input nodes of duration and date and time types
> ---------------------------------------------------------------------------------
>
> Key: DROOLS-1596
> URL: https://issues.jboss.org/browse/DROOLS-1596
> Project: Drools
> Issue Type: Bug
> Components: dmn engine
> Affects Versions: 7.1.0.Beta2
> Reporter: Edson Tirelli
> Assignee: Edson Tirelli
> Fix For: 7.1.0.Final
>
> Attachments: date_allowed_values.dmn
>
>
> From Melanie:
> --------
> Maybe something is off in our serialization, but when I try to execute the attached file it always tell me my values are incorrect event when they are within the allowed range. That file is a really dumb decision that just create a boxed context with the two inputs it gets. Those inputs are one yearMonthDuration and one date time. Both are defined with Item definition and have a constraints on them. Setting constraints on all the other types works fine.
> --------
> Here are the messages:
> I send P20Y and 2017-05-16T17:58:00.000Z to the back end. Then I use (BuiltInType) BuiltInType.determineTypeFromName(type) in the back end to have the proper feel type and feelType.fromString(value) to get the proper object.
>
> The returned type for yearMonthDuration is duration and a Period with the proper value is create for it. For date time it is a DATE_TIME and a ZonedDateTime is create for it.
>
> All of that seem fine.
> ----------
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the jboss-jira
mailing list