Btw, is there a more elegant way to get from Drools the rule he caught?
my way foeces the user to set the ruleId for each rule he writes.

Nadav.

On Thu, Oct 7, 2010 at 4:14 PM, Nadav Hashimshony <nadavh@gmail.com> wrote:
Hi,

I would like to return to the Fact object the rule id that was caught

my facts class has a memeber

String caughtRule;

and set and get

setCaughtRuleId (String s) { caughtRule= s;}
String getCaughtRuleId () {return caughtRule;}


my rule looks like:

rule "01"
salience 100
activation-group "mygrp"
    no-loop true
    when
        d : CFactClass(   someMember matches "some-string");

    then
        System.out.println("01 caught");
        d.setCaughtRuleId("01");
        d.setCaught();
end


when the rule is fired i see the the setCaught() worked (its a boolean variable) but the setCaughtRuleId methids return empty string...

any ides?

Thanks
Nadav,.