[rules-users] Error in OR rule

Giovanni Motta mottagio at gmail.com
Mon May 24 10:10:00 EDT 2010


Hello, i had similar problems with or constructs, and decided to avoid them.
Drools expert manual says that or constructs are internally rewritten, i
suppose this mechanism is not fine-tuned.
My 2 cents...

2010/5/24 Piotr Jedrychowski <pjedrychowski at proximetry.pl>

> Hello.
>
> I have a problem with such a condition after 'when':
> (or (and MyFact(id==1) MyFact(id==2)) (or MyFact(id==3) MyFact(id==4)))
>
> For this condition I got this error:
> errors; [7,41]: [ERR 101] Line 7:41 no viable alternative at input 'or'
> in rule "Sensor-1-ON"[7,64]: [ERR 102] Line 7:64 mismatched input
> 'MyFact' expecting ')' in rule "Sensor-1-ON"[7,84]: [ERR 102] Line 7:84
> mismatched input ')' expecting 'then' in rule "Sensor-1-ON"
>
> When I changed my condition to this:
> (or (and MyFact(id==1) MyFact(id==2)) MyFact(id==3) MyFact(id==4))
> everything is correct. Both conditions from logic point of view, are the
> same, but the first one can't be compiled. Why?
>
> Maybe someone had similar problem and could help me?
>
> I'm using:
> * JBoss 4.2.3.GA
> * Drools 5.0
>
> Regards,
> Piotr
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100524/a58cfea7/attachment.html 


More information about the rules-users mailing list