If you really need the rule name in the consequence you can also access the implicit KnowledgeHelper instance "drools":-
rule "test"
when
eval(true)
then
System.out.println("Rule name = " + drools.getRule().getName());
end
That's right Leandro, using an AgendaEventListener is much more elegant!Best Regards,
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com
2010/10/7 Leandro Romero <leandro.s.romero@gmail.com>I am not 100% sure, but in my opinion an elegant way to do it would be to create a class that extends from DefaultAgendaEventListener and then override the "afterActivationFired" method._______________________________________________
If you are using that fact in another rule and you want it to be updated, you have to call "update($d)" or you can modify $d inside a modify block.
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users