Bug 1253575 - Drools nested date comparison expressions with OR condition
Drools nested date comparison expressions with OR condition
Status: VERIFIED
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: BRE (Show other bugs)
6.1.0
Unspecified Unspecified
unspecified Severity high
: ER3
: 6.2.0
Assigned To: Mario Fusco
Marek Winkler
:
Depends On:
Blocks: 1253576
  Show dependency treegraph
 
Reported: 2015-08-14 02:59 EDT by Hisao Furuichi
Modified: 2015-10-08 11:01 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1253576 (view as bug list)
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Hisao Furuichi 2015-08-14 02:59:03 EDT
Description of problem:

Following RHS which uses Date object comparison works fine:

DateContainer( date >= "15-Oct-2013" || date <= "01-Oct-2013" )

If there are multiple conditions connecting with "||" or "&&" as follows, syntax error occurs:

DateContainer ( (date >= "19-Dec-2015" && date <= "03-Jan-2016" ) || (date >= "17-Dec-2016" && date <= "02-Jan-2017" ))	

Exception is

===
Unable to Analyse Expression date >= "19-Dec-2015" && date <= "03-Jan-2016" || date >= "17-Dec-2016" && date <= "02-Jan-2017":
[Error: Comparison operation requires compatible types. Found class java.util.Date and class java.lang.String]
[Near : {... "03-Jan-2016" || date >= "17-Dec-2016" && date <= "02-Jan-2017" ....}]
                                                               ^
[Line: 25, Column: 2]
===

Additional info:
BZ-1072217 covers non-nested comparison like this:

DateContainer( date >= "15-Oct-2013" || date <= "01-Oct-2013" )
Comment 1 Hisao Furuichi 2015-08-14 03:00:02 EDT
I tested with BRMS 6.1.2, and the issue still occurs.
Comment 2 Mario Fusco 2015-08-18 05:37:35 EDT
Fixed by https://github.com/droolsjbpm/drools/commit/dc81e1f1c
Comment 3 Marek Winkler 2015-10-08 11:01:04 EDT
Verified in BRMS 6.2.0 ER3.

Note You need to log in before you can comment on or make changes to this bug.