case 1 could be:<div><br></div><div><i>package something</i></div><div><i><br></i></div><div><i>dialect &quot;java&quot; </i></div><div><i><br></i></div><div><i>rule &quot;Some rule&quot;</i></div><div><i>   when</i></div>


<div><i>      Something()</i></div><div><i>   then</i></div><div><i>      try{</i></div><div><i>         callSomeDangerousLogicHere();</i></div><div><i>      catch (Exception ex){</i></div><div><i>         //manage your exception here</i></div>


<div><i>      }</i></div><div><i>end</i></div><div><i><br></i></div><div>The second approach is to write something like this in your java code:</div><div><br></div><div><i>ksession.insert (someObject);</i></div><div><i>...</i></div>

<div>
<i><br></i></div><div><i>try{</i></div><div><i>   ksession.fireAllRules();</i></div><div><i>} catch (Exception e){  // &lt;-- This will be a ConsequenceException</i></div><div><i>   //manage your exception here</i></div>

<div><i>}</i></div><div><br></div><div>  </div>
<div>Best, <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/13 sumatheja <span dir="ltr">&lt;<a href="mailto:sumatheja@gmail.com" target="_blank">sumatheja@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Hi Wolfgang,<br>Whats the advantage of option 2 over 1? Can you give sample code for option 2??<div><div></div><div><br><br><div class="gmail_quote">2010/10/13 Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>&gt;</span><br>




<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">In drl, you could use<br>  dialect &quot;java&quot;<br>at outermost level, but one never does, because that&#39;s the default.<br>




<br>I&#39;d use option (2).<div><div></div><div><br><br>-W<br><br><div class="gmail_quote">2010/10/13 sumatheja <span dir="ltr">&lt;<a href="mailto:sumatheja@gmail.com" target="_blank">sumatheja@gmail.com</a>&gt;</span><br>





<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">Hi Wolfgang,<br>                  I am actually writing all the rules in a .drl and importing them into a guvnor. I didn&#39;t mention the dialect explicitly anywhere in the code. Is the default dialect MVEL. Is there a way to make one time declaration of dialect in my case instead of declaring it for all the rules.<br>







<br><div class="gmail_quote">2010/10/13 Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>&gt;</span><div><div></div><div><br><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">







I&#39;d say you are using <br>   dialect &quot;mvel&quot;<br>There is no try/catch statement in MVEL. You have the options:<br><br>(1) Use Java, not MVEL.<br><br>(2) Surround the fireAllRules() with try/catch and put it in a loop that&#39;s terminated<br>








if there is no exception.<br><br>-W<br><br><br><div class="gmail_quote"><div>2010/10/13 sumatheja <span dir="ltr">&lt;<a href="mailto:sumatheja@gmail.com" target="_blank">sumatheja@gmail.com</a>&gt;</span><br>

</div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
Hi All, <br><div><div></div><div>        I have a set of rules. After firing the rules if an exception occurs in a rule the following rules are not getting evaluated. So i tried writing a try catch block inside the consequence part of the rule, but then i get an error saying &quot;&#39;unable to build the consequence.[Error:was expecting type: java.lang.Object but found type:null]&quot;<br>










<br>Here follows my code<br><br><br clear="all"><b>rule &#39;Test rule&#39;<br>ruleflow-group &quot;Test Ruleflow&quot;<br>no-loop<br>    when<br>        $c:Car()<br>        Driver()<br>        <br>    then <br>       try{<br>










          $c.getModel()<br>          } catch (Exception Ee) {<br>           System.out.println(&quot;caught an exception: &quot;+Ee.toString());<br>          }<br>end</b><br><br>However if i remove the try catch block it buils fine.<br>










<br>Can anyone let me know if i&#39;m missing something here.<br><br>Thanks in advance :)<br>-- <br>cheers<br><font color="#888888">Sumatheja <br><br><br>
</font><br></div></div><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></div></blockquote></div><br>
<br>_______________________________________________<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></div></div><font color="#888888"><br><br clear="all"><br>-- <br>cheers<br>Sumatheja Dasararaju<br><br><br>
</font><br>_______________________________________________<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></div><br>_______________________________________________<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><br clear="all"><br>-- <br>cheers<br>Sumatheja Dasararaju<br><br><br>
</div></div><br>_______________________________________________<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>