There is an implicit KnowledgeHelper object called "drools" available in the
RHS.
 
drools.getRule().getName() will provide what you need.



  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: 11 April 2008 16:04
To: rules-users@lists.jboss.org
Subject: [rules-users] Access to currently executing rule in consequence?



Is there an easy way to access information about the currently executing
rule (e.g. Name, salience, group) within a rule consequence?  E.g.
 
rule "Sample Rule"
    salience = 100
when
        $v : Fact(name == "Test")
then
    System.out.println("The currently executing rule is " +
<???>.getName());
end
 
I could copy the name into the print but of course then I have it in two
places I need to keep in sync. I know I can get the full log but that's not
what I'm interested in. 
 
-Russ

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to