[rules-users] Rule id / Rule name

Nadav Hashimshony nadavh at gmail.com
Thu Oct 7 10:15:25 EDT 2010


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 at 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,.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20101007/38cda996/attachment.html 


More information about the rules-users mailing list