[jboss-jira] [JBoss JIRA] (DROOLS-296) Drools date coercion and conditional OR

RH Bugzilla Integration (JIRA) jira-events at lists.jboss.org
Wed Nov 13 08:54:07 EST 2013


    [ https://issues.jboss.org/browse/DROOLS-296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12923169#comment-12923169 ] 

RH Bugzilla Integration commented on DROOLS-296:
------------------------------------------------

Mario Fusco <mfusco at redhat.com> made a comment on [bug 1029908|https://bugzilla.redhat.com/show_bug.cgi?id=1029908]

If I try a simple Drools rule with conditions on date type and uses conditional OR (||) I get the following error. If I change || to && it works fine.

Condition
$container: DateContainer( date >= "15-Oct-2013" || date <= "01-Oct-2013" )

Error
Unable to Analyse Expression date >= "15-Oct-2013" || date <= "01-Oct-2013":
[Error: Comparison operation requires compatible types. Found class java.util.Date and class java.lang.String]
[Near :
{... date >= "15-Oct-2013" || date <= "01-Oct-2013" ....}

]
^
[Line: 9, Column: 1] : [Rule name='Test rule']
                
> Drools date coercion and conditional OR
> ---------------------------------------
>
>                 Key: DROOLS-296
>                 URL: https://issues.jboss.org/browse/DROOLS-296
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 5.5.0.Final
>         Environment: Windows 7
>            Reporter: Madhura Jayaratne
>            Assignee: Mark Proctor
>
> If I try a simple Drools rule with conditions on date type and uses conditional OR (||) I get the following error. If I change || to && it works fine.
> Condition
> $container: DateContainer( date >= "15-Oct-2013" || date <= "01-Oct-2013"  )
> Error
> Unable to Analyse Expression date >= "15-Oct-2013" || date <= "01-Oct-2013":
> [Error: Comparison operation requires compatible types. Found class java.util.Date and class java.lang.String]
> [Near : {... date >= "15-Oct-2013" || date <= "01-Oct-2013" ....}]
>                                               ^
> [Line: 9, Column: 1] : [Rule name='Test rule']

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list