[rules-users] Parse bug in predicate constraints?

Edson Tirelli tirelli at post.com
Thu Feb 8 18:27:22 EST 2007


   Justine,

   Yes, in 3.0.x you can't break lines in the middle of a predicate. In 
trunk you will be able to.

   []s
   Edson

Justine Hlista wrote:

> Yay!! I was just looking into moving on to the trunk. Unfortunately we 
> have a code freeze tomorrow, so it might have to wait a few days.
>
> Yes, apparently I made a typo when I typed in the example (trying to 
> simplify it, argh!). And while I said it was sensitive to whitespace, 
> the whitespace I actually meant was a line break. Here is the actual 
> rule, which will compile without a line break in the predicate. 
> However, if I insert a line break at the &&,  it throws:
>
> rule "snapshot"
> no-loop true
>     when
>         snap : Scalper120Values(id:uniqueId,
>          shares:sharesFilled,
>          buy:buyShares,
>          sell:sellShares ->((shares.intValue() < (1/780) * ( 
> buy.intValue() + sell.intValue()))&&((buy.intValue() + 
> sell.intValue()) > 500000)));
>     then
>         System.out.println("blah");
> end
>
>
> On 2/8/07, * Edson Tirelli* <tirelli at post.com 
> <mailto:tirelli at post.com>> wrote:
>
>
>        Justine,
>
>        It shouldn't be space sensitive. Where are you inserting the space
>     that is giving you the error? I see your line bellow is missing a
>     ')' in
>     the end, but maybe it was a mistake when you wrote the e-mail... so,
>     could you please clarify?
>
>        In trunk the syntax was simplified to almost what you asked for. In
>     trunk you can write:
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>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 3124-6000
 Mobile: +55 11 9218-4151
 JBoss, a division of Red Hat @ www.jboss.com





More information about the rules-users mailing list