[jboss-jira] [JBoss JIRA] Closed: (JBRULES-1464) Comilation error : 'Syntax error on token ",", delete this token' when referencing a global in an accumulate block

Edson Tirelli (JIRA) jira-events at lists.jboss.org
Tue Feb 19 15:59:27 EST 2008


     [ http://jira.jboss.com/jira/browse/JBRULES-1464?page=all ]

Edson Tirelli closed JBRULES-1464.
----------------------------------

    Fix Version/s: 4.0.5
                   5.0.0-M1
       Resolution: Done

Good catch. Thanks for reporting.

Test case added. Fix committed.


> Comilation error : 'Syntax error on token ",", delete this token' when referencing a global in an accumulate block
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: JBRULES-1464
>                 URL: http://jira.jboss.com/jira/browse/JBRULES-1464
>             Project: JBoss Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Drl Parser/Builder
>    Affects Versions: 4.0.4
>         Environment: Eclise / java version "1.6.0_02"
>            Reporter: Thomas Vanstals
>         Assigned To: Edson Tirelli
>             Fix For: 4.0.5, 5.0.0-M1
>
>
> Hello,
> I'm trying to reference a global in an accumulate block and I get the following error : 
> Rule Compilation error : [Rule name=Hello World, agendaGroup=MAIN, salience=0, no-loop=false]
> 	org/drools/examples/Rule_Hello_World_0.java (15:338) : Syntax error on token ",", delete this token
> 	org/drools/examples/Rule_Hello_World_0.java (41:1544) : Syntax error on token ",", delete this token
> Here is a sample drl file base on the HelloWorld.drl (found in the drools samples)
> ---------------------------------------------------------------------------------------------------------
> package org.drools.examples
>  
> import org.drools.examples.HelloWorldExample.Message;
> import java.util.*;
>  
> global Message globalMessage;
> rule "Hello World"
> 	when
> 		$msgList : List() 
>         	from accumulate( $msg : Message(),
>                              init( List result = new ArrayList(); ),
>                              action( if (globalMessage.getMessage() == $msg.getMessage()) result.add($msg); ),
>                              result( result ))
> 	then
> 		System.out.println("Size: " +  $msgList.size() );  
> end
> ---------------------------------------------------------------------------------------------------------
> If I use 
> action( if ("Hello World" == $msg.getMessage()) result.add($msg); ),
> instead of 
> action( if (globalMessage.getMessage() == $msg.getMessage()) result.add($msg); ),
> it's working great... 
> Regards, 
> Thomas

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list