If you really need the rule name in the consequence you can also access the implicit KnowledgeHelper instance "drools":-<br><br>rule "test"<br> when<br> eval(true)<br> then<br> System.out.println("Rule name = " + drools.getRule().getName());<br>
end<br><br><div class="gmail_quote">2010/10/7 <a href="mailto:esteban.aliverti@gmail.com">esteban.aliverti@gmail.com</a> <span dir="ltr"><<a href="mailto:esteban.aliverti@gmail.com">esteban.aliverti@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">That's right Leandro, using an AgendaEventListener is much more elegant!<div><br></div><div>
Best Regards,<br clear="all"><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>- Developer @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com </a><br>
- Blog @ <a href="http://ilesteban.wordpress.com" target="_blank">http://ilesteban.wordpress.com</a><br>
<br><br><div class="gmail_quote">2010/10/7 Leandro Romero <span dir="ltr"><<a href="mailto:leandro.s.romero@gmail.com" target="_blank">leandro.s.romero@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">
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.<br><br>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.<br>
<br><br>
<br></div>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br>