<div>Hi, </div>
<div> </div>
<div>Anyone knows how to catch the exception when firing the rules? </div>
<div> </div>
<div>I wrapped the session.fireAllRules() method using try...catch, however it doesn't work: when someone wrote bad code in the rule's action part, the Exception will be thrown and printed to the stderr, and this will make the rule engine stop working -- the try...catch outside doesn't help anything.
</div>
<div> </div>
<div>If the exception thrown from the rule's action part can be caught externally, the system can be protected from interrupting Exception.</div>
<div>
<p><font style="BACKGROUND-COLOR: #ffffff" face="courier new,monospace" color="#3333ff">try {<br> _log.debug("Firing rules in : " + getName());</font></p>
<p><font style="BACKGROUND-COLOR: #ffffff" face="courier new,monospace" color="#3333ff"> session.fireAllRules();</font></p>
<p><font style="BACKGROUND-COLOR: #ffffff" face="courier new,monospace" color="#3333ff">} catch (Exception e) {<br> _log.info("Error when firing rules: ", e);<br>}</font> <br></p>
<p>Thanks, <br>Yang</p></div>