[rules-users] parsing error using accumulate

Edson Tirelli tirelli at post.com
Thu Sep 6 10:30:08 EDT 2007


   Well, seems the parser is raising the wrong message here... need to fix
that...
   But the syntax should be something like:

rule "calculate average"
        when
                $media : Number( doubleValue > 50000)
                            from accumulate( Instance( $value : classValue
),
                                          average($value))
        then
                System.out.println(media );
end

   []s
   Edson




2007/9/6, Isabelle Hupont <ihupont at ita.es>:
>
>
> Hi!
>
> I'm integrating Weka with Drools v.4 and I have a parsing error while
> trying
> to read the following DRL rule:
>
> rule "calculate average"
>         when
>                 $inst : Instance()
>                 $media : Double(double value > 50000)
>                             from accumulate($value : inst.classValue()
>                                           average($value))
>         then
>                 System.out.println(media );
> end
>
> I have the following error:
>
> org.drools.compiler.DroolsParserException: Unknown error while parsing.
> This
> is a bug. Please contact the Development team.
>         at org.drools.compiler.DrlParser.compile(DrlParser.java:180)
>         at org.drools.compiler.DrlParser.parse(DrlParser.java:61)
>         at
> org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java
> :158)
>         at com.sample.DroolsTest.readRule(DroolsTest.java:67)
>         at com.sample.DroolsTest.main(DroolsTest.java:24)
>
> What I am doing wrong?
> Thx
> --
> View this message in context:
> http://www.nabble.com/parsing-error-using-accumulate-tf4390367.html#a12517682
> Sent from the drools - user mailing list archive at Nabble.com.
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070906/905ad135/attachment.html 


More information about the rules-users mailing list