Thats a clever suggestion, <br><br>Another way (more brute force procedural), is to use agenda-groups.<br><br>So most of your rules are in an agenda-group called &quot;calculateDate&quot; or similar.<br>You then have a group called &quot;deftault&quot; which just has the rule that checks if the date is still null, and sets it.
<br><br>You then (from the api) do<br>workingMemory.setFocus(&quot;calculateDate&quot;);<br>workingMemory.setFocus(&quot;default&quot;);<br>workingMemory.fireAllRules();<br><br>or similar. <br><br>In the next release, we are looking at including an &quot;Otherwise()&quot; functionality for this, so you have a rule that declares that it will fire only if no other rules did.
<br>I have a prototype implementation of that in trunk.<br><br>So lots of options, I think the agenda group may be a little too verbose though, I liked Michael&#39;s suggestion in a previous email.<br><br>Michael.<br><br>
<br><br><div><span class="gmail_quote">On 1/9/07, <b class="gmail_sendername">Michael Suzio</b> &lt;<a href="mailto:msuzio@gmail.com">msuzio@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
One way around this is to set the high-salience &quot;default&quot; rule to also trigger on the non-existence of some &quot;marker&quot; object.&nbsp; Then, in the consequence, you can always assert a new instance of that object, which then effectively blocks the rule from triggering again.&nbsp; If you want it to automatically manage itself, you may be able to do an assertLogical on the marker object and then it will get removed when the business object gets retracted.
<br><br>So, something like this maybe:<br><br>rule &quot;Pre&quot;<br>salience 10<br>when<br>&nbsp;$bo: BusinessObject(targetDate != null)<br>&nbsp;!Marker()<br>then<br>&nbsp;assertLogical(new Marker());<span class="q"><br>&nbsp;Date tmp = null;
<br>&nbsp;$bo.setTargetDate(tmp);
<br>&nbsp;modify($bo);<br>end<br><br><br></span>I&#39;ve had to do that sort of stuff before to handle edge cases like this.<br><span class="sg"><br>&nbsp;&nbsp; --- Michael<br>

</span><br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br><br></blockquote></div>
<br>