[rules-users] Access to currently executing rule in consequence?

Anstis, Michael (M.) manstis1 at ford.com
Fri Apr 11 11:13:23 EDT 2008


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



  _____  

From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of
rrogers at us.imshealth.com
Sent: 11 April 2008 16:04
To: rules-users at 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080411/477cd205/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 7206 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20080411/477cd205/attachment.bin 


More information about the rules-users mailing list