[rules-users] single binding for or CE flagged by compiler

Wolfgang Laun wolfgang.laun at gmail.com
Mon Mar 16 07:08:40 EDT 2009


As far as I know, this should work:

package orel;
import orel.Main.Trigger;
rule ror1
    when
        $t : (or Trigger(fa == 1)
                 Trigger(fa == 2))
    then
        System.out.println( "fired " + $t.getName() );
end

This is what Drools-5.0.0 kbuilder.getErrors().toString() returns:

[5,11]: [ERR 102] Line 5:11 mismatched input 'Trigger' expecting '(' in rule
ror1 in pattern or[6,14]: [ERR 102] Line 6:14 mismatched input 'Trigger'
expecting ')' in rule ror1[6,30]: [ERR 102] Line 6:30 mismatched input ')'
expecting 'then' in rule ror1

Shouldn't toString() insert line ends? As it is, the result is pretty much
useless.

This works:
rule ror1
    when
        (or $t : Trigger(fa == 1)
            $t : Trigger(fa == 2))
    then
        System.out.println( "fired " + $t.getName() );
end

-W
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090316/31ac0a63/attachment.html 


More information about the rules-users mailing list