try <br>String ruleName = ...<br><br><div class="gmail_quote">On Thu, Jul 3, 2008 at 7:09 AM, Marina &lt;<a href="mailto:ppine7@yahoo.com">ppine7@yahoo.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
<br>
I need to know the rule name of the rule that fired in the consequence part of the rule. I tried something like the following, just trying to see if I can get it this way:<br>
<br>
package mode.simple;<br>
import java.lang.String;<br>
import java.util.List;<br>
import com.emptoris.ecm.domain.ContractRulesData;<br>
<br>
global java.util.Set approverList;<br>
<br>
rule &quot;testOR_1&quot;<br>
 &nbsp; &nbsp;dialect &quot;java&quot;<br>
 &nbsp; &nbsp;when<br>
 &nbsp; &nbsp; &nbsp; &nbsp;$data : ContractRulesData (sum &gt; 500 || name matches &quot;.*important&quot;)<br>
 &nbsp; &nbsp;then<br>
 &nbsp; &nbsp; &nbsp; &nbsp;approverList.add(&quot;approver3, approver4, Level5&quot;);<br>
 &nbsp; &nbsp; &nbsp; &nbsp;ruleName = drools.getRule().getName();<br>
 &nbsp; &nbsp; &nbsp; &nbsp;System.out.println(ruleName + &quot; is TRUE&quot;);<br>
<br>
end<br>
<br>
When I&#39;m trying to compile the rule, I&#39;m getting the following error:<br>
Builder errors:<br>
Rule Compilation error : [Rule name=testOR_1, agendaGroup=MAIN, salience=0, no-loop=false]<br>
 &nbsp; &nbsp;mode/simple/Rule_testOR_1_0.java (8:391) : ruleName cannot be resolved<br>
 &nbsp; &nbsp;mode/simple/Rule_testOR_1_0.java (9:452) : ruleName cannot be resolved<br>
java.lang.RuntimeException: Unable to compile rules file: testOR_1.drl<br>
<br>
I must be doing something wrong here... ?<br>
<br>
thanks!<br>
<font color="#888888">Marina<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>
</font></blockquote></div><br><br clear="all"><br>-- <br>Steven Williams<br><br>Supervising Consultant<br><br>Object Consulting<br>Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501<br><a href="mailto:steven.williams@objectconsulting.com.au">steven.williams@objectconsulting.com.au</a><br>
<a href="http://www.objectconsulting.com.au">www.objectconsulting.com.au</a><br><br>consulting | development | training | support<br>our experience makes the difference