Try this:

rule "FindMismatchedBars"
        when
                f : Foo(fooId : id)
                bars : ArrayList() from collect( Bar(id != fooId) )
        then
                System.out.println( "For " + f + " got " + bars ); 
end

And see attached project.

--- On Tue, 8/18/09, techy <[email protected]> wrote:

> From: techy <[email protected]>
> Subject: Re: [rules-users] Collect from
> To: [email protected]
> Date: Tuesday, August 18, 2009, 12:07 PM
> 
> Please someone help me on this.
> 
> techy wrote:
> > 
> > I would like to collect All Foo() for which there is
> no Bar() as given
> > below.Please help me on this. 
> > Thanks.
> > 
> > //psedo rule
> > rule 'test'
> > list : from collect( Foo(fooId: id) and not Bar(id
> !=fooId))
> > then
> > //do conseq
> > end
> > 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Collect-from-tp25014904p25029332.html
> Sent from the drools - user mailing list archive at
> Nabble.com.
> 
> _______________________________________________
> rules-users mailing list
> [email protected]
> https://lists.jboss.org/mailman/listinfo/rules-users
>


      

Attachment: DroolsCollectUnlike.tar.gz
Description: GNU Zip compressed data

_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to