[jboss-jira] [JBoss JIRA] Commented: (JBRULES-3025) Regression: parser rebuts multiple bindings in constraint conjunction and disjunction

Edson Tirelli (JIRA) jira-events at lists.jboss.org
Tue May 17 18:39:00 EDT 2011


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

Edson Tirelli commented on JBRULES-3025:
----------------------------------------

This requires documentation. The decision is to fix the syntax now even if it breaks some odd back cases.

> Regression: parser rebuts multiple bindings in constraint conjunction and disjunction
> -------------------------------------------------------------------------------------
>
>                 Key: JBRULES-3025
>                 URL: https://issues.jboss.org/browse/JBRULES-3025
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: drools-compiler (expert)
>    Affects Versions: 5.2.0.M2
>            Reporter: Wolfgang Laun
>            Assignee: Mark Proctor
>            Priority: Blocker
>             Fix For: 5.2.0.CR1
>
>
> The DRL given below compiled in 5.1.1 and executed as expected, i.e., both rules fired, producing 
>    or R=1x2
>    and R=1x2
> Now, a syntax error is flagged at the position of the 2nd binding ($w:). Moreover, the DRL parser is thrown off-track and crashes with sn EmptyStackException as soon as more rules follow.
> package binding;
> declare Rect
>   length : int
>   width : int
> end
> rule insert
> salience 100
> when
> then
>    Rect r = new Rect();
>    r.setLength( 1 );
>    r.setWidth( 2 );
>    insert( r );
> end
> rule "binding and"
> when
>     $r: Rect( $l: length == 1 && $w: width == 2 )
> then
>     System.out.println( "and R=" + $l + "x" + $w );
> end
> rule "binding or"
> when
>     $r: Rect( $l: length == 1 || $w: width == 1 )
> then
>     System.out.println( "or R=" + $l + "x" + $w );
> end

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list