As far as I can see there is nothing wrong with your first attempt.
I've attached a test file of your scenario. It works for me. Can you please test my file and create a test case that fails?


On Thu, Dec 31, 2009 at 10:26 AM, orchid <> wrote:

Hi All,
I'm using Drools 5.x. I have the following class:
public class Machine{
  private List rules = new ArrayList();

The 'rules' list holds strings. I would like from my rule to check whether
that list contains the string "rule2".

I've tried doing this in the following ways, but get compilation error:

rule "rule1"
   /*1st attempt:*/ $m:Machine(rules contains "rule2")
   /*2nd attempt:*/ $m:Machine(rules.contains("rule2") )
What am I doing wrong?

Thanks in advance !!!

View this message in context:
Sent from the Drools - User mailing list archive at
rules-users mailing list


Esteban Aliverti