Edson,<br><br>Thanks. I knew there was a better way, I just did not know about it.<br><br>Ron<br><br><div class="gmail_quote">On Nov 15, 2007 5:15 PM, Edson Tirelli <<a href="mailto:tirelli@post.com">tirelli@post.com</a>
> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br> Throwing exceptions in the consequence is not safe and not advisable.
<br> To stop the rules engine you can use the following statement in your consequence:<br><br>drools.halt();<br><br> Use a fact, a call back, or an attribute to identify the problem you detected.
<br><br> []s<br> Edson<br><br><div><span class="gmail_quote">2007/11/15, Ronald R. DiFrango <<a href="mailto:ron.difrango@gmail.com" target="_blank">ron.difrango@gmail.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">
All,<br><br>I have a situation where I want the rules execution to stop processing immediately when it encounters a situation like the following:<br><br>rule "Invalid RTV Line"<br> salience 100<br> <br> when
<br> rtvDetailLine : DetailLine(detailRtvNumber:rtvNumber != null, lineNumber != null ) <br> rtvHeader : RtvHeader( rtvNumber != detailRtvNumber )<br> then<br> logger.debug("Invalid RTV Line");
<br> throw new RuntimeException("Invalid RTV Line");<br>end <br><br>Basically this is a parent child relationship and under some circumstances the process that feeds data into the rules it corrupts this relationship. I want to stop the rules process immediately and do nothing further. As you see above, my first attempt is just throw a runtime exception that is caught/ logged and report by the calling program. Does this seem like a reasonable approach or is there a better approach to do this?
<br><br>Ron<br>
<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 clear="all"><br>-- <br> Edson Tirelli<br> Software Engineer - JBoss Rules Core Developer<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646
<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a>
</blockquote></div><br>