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
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to