Reputation: 7375
Is it possible to retrieve rule name in the then clause of drool rule?
rule "A"
when
---
then
// something that outputs "A"
Thanks.
Upvotes: 15
Views: 9638
Reputation: 723
As Cyril said, you can get the rule name in the then clause by calling drools.getRule().getName() of the drools rule.
Just a little more info, you can check the getName() method in Rule Interface in the following api: http://docs.jboss.org/jbpm/v5.1/javadocs/org/drools/definition/rule/Rule.html
Upvotes: 4
Reputation: 702
Yes, in then clause you may use expression:
drools.getRule().getName()
Upvotes: 35