Hi All, <br> Can anyone give me sample code for exception handling in drools rule consequence i.e RHS.<br> <br><br><div class="gmail_quote">On Wed, Oct 13, 2010 at 7:12 PM, sumatheja <span dir="ltr"><<a href="mailto:sumatheja@gmail.com">sumatheja@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi Michael, <br> I have written this rule in the guvnor editor, i did import java.lang.Exception.<br>
<br><div class="gmail_quote">2010/10/13 Michael Anstis <span dir="ltr"><<a href="mailto:michael.anstis@gmail.com" target="_blank">michael.anstis@gmail.com</a>></span><div><div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Did you import the Exception class?<br><br><div class="gmail_quote">2010/10/13 sumatheja <span dir="ltr"><<a href="mailto:sumatheja@gmail.com" target="_blank">sumatheja@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><div></div><div>
Hi All, <br> 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 "'unable to build the consequence.[Error:was expecting type: java.lang.Object but found type:null]"<br>
<br>Here follows my code<br><br><br clear="all"><b>rule 'Test rule'<br>ruleflow-group "Test Ruleflow"<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("caught an exception: "+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'm missing something here.<br><br>Thanks in advance :)<br>-- <br>cheers<br><font color="#888888">Sumatheja <br><br><br>
</font><br></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></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></blockquote></div><br><br clear="all"><br>-- <br>cheers<br>Sumatheja Dasararaju<br><br><br>