[rules-users] using from with not

Chris West crayzfishr at gmail.com
Thu Oct 4 12:49:21 EDT 2007


Ok, the parenthesis makes sense.

But when I enclose the pattern as Michael suggested, it gets a runtime error
trying to parse.  I attached a sample project illustrating this in an
earlier response.  So isn't there still a problem?

-Chris

On 10/4/07, Edson Tirelli <tirelli at post.com> wrote:
>
>
>    From the manual:
>
> "A not statement must be followed by parentheses around the pattern that
> it applies to. In the simplest case of a single pattern (like below) you can
> omit the parentheses."
>
>    We improved the docs for the next version. Hope it is clearer now. But
> Michael got it right.
>
>     []s
>     Edson
>
> 2007/10/4, Anstis, Michael (M.) < manstis1 at ford.com>:
> >
> >  What if you try "not (Foo(id == 10) from $foos) "?
> >
> >  ------------------------------
> > *From:* rules-users-bounces at lists.jboss.org [mailto:
> > rules-users-bounces at lists.jboss.org] *On Behalf Of *Chris West
> > *Sent:* 04 October 2007 16:59
> > *To:* Rules Users List
> > *Subject:* Re: [rules-users] using from with not
> >
> > It does not compile.  The error is:
> > unknown:32:20 mismatched token: [@243,682:685='from',<38>,32:20];
> > expecting type THEN
> >
> > -Chris
> >
> > On 10/4/07, Anstis, Michael (M.) <manstis1 at ford.com> wrote:
> > >
> > >  Does it not compile (in which case can you post the error)?
> > >
> > > Or does it not activate?
> > >
> > >  ------------------------------
> > > *From:* rules-users-bounces at lists.jboss.org [mailto:
> > > rules-users-bounces at lists.jboss.org] *On Behalf Of *Chris West
> > > *Sent:* 04 October 2007 16:03
> > > *To:* Rules Users List
> > > *Subject:* [rules-users] using from with not
> > >
> > >  Hello,
> > >
> > > Does anyone know why rule "GoodBye2" below does not compile, but rule
> > > "GoodBye1" does compile using Drools 4.0.0?  The only difference is
> > > the "not".  Shouldn't this be valid?
> > >
> > > Thanks,
> > > -Chris
> > >
> > >
> > > package com.sample
> > >
> > > import com.sample.DroolsTest.Message;
> > > import com.sample.DroolsTest.Foo;
> > > import java.util.List;
> > >
> > > rule "Hello World"
> > >     when
> > >         m : Message( status == Message.HELLO, message : message )
> > >     then
> > >         System.out.println( message );
> > >         m.setMessage( "Goodbye cruel world" );
> > >         m.setStatus( Message.GOODBYE );
> > >         update( m );
> > > end
> > >
> > > rule "GoodBye1"
> > >     no-loop true
> > >     when
> > >         m : Message( status == Message.GOODBYE, message : message,
> > > $foos: foos )
> > >         Foo(id == 10) from $foos
> > >     then
> > >         System.out.println ( message );
> > >         m.setMessage( message );
> > >
> > > end
> > >
> > > rule "GoodBye2"
> > >     no-loop true
> > >     when
> > >         m : Message( status == Message.GOODBYE, message : message,
> > > $foos: foos )
> > >         not Foo(id == 10) from $foos
> > >     then
> > >         System.out.println( message );
> > >         m.setMessage( message );
> > >
> > > end
> > >
> > >
> > > _______________________________________________
> > > rules-users mailing list
> > > rules-users at lists.jboss.org
> > > https://lists.jboss.org/mailman/listinfo/rules-users
> > >
> > >
> > >
> >
> > _______________________________________________
> > 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
> _______________________________________________
> 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/20071004/55702ec4/attachment.html 


More information about the rules-users mailing list