"contains" is just syntax sugar for the contains() method. So, in you case, it will effectivelly call:

btype.getAvector().contains(atype);

 So, should work just fine.

 []s
  Edson

Ramesh Bhaskar wrote:

Hi,
   I had a doubt regarding the contains operator.

Assume that I have an object of class which had many attributes. And I have an object B which has a Vector of Objects A. Something like:

   public class A{
      //some attributes
      //some methods
   }

   public class B{
      //some attributes
      Vector Avector<A> = new Vector<A>()
        //some methods
   }

   is it possible to write a rule like this

   rule "test rule"
      when
         atype: A()
         btype: B(avector contains atype)
      then
         //do something else
   end


This might not be syntactically exact. But basically want to know if contains can check object types and not just single attributes.

Thanks
Ramesh Bhaskar
---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email




--
 ---
 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



---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to