<div dir="ltr"><div><div><div>You just make sure that the documentation for 5.x remains as I&#39;ve added it, and that it is updated accordingly for the 6.x Expert manual.<br><br></div>I don&#39;t think that the behaviour in 5.x when fireAllRules() is called and repeating timers execute their tasks even when the Engine is idle is evil. The general flow of logic is consistent even though some executions happen later compared to what would happen when running in fireUntilHalt.<br>
<br></div>But you can indeed uphold the position that any timer activity is in conflict with the Engine being suspended after fireAllRules() returns. But what should be the consequence? Delay the return? Terminate the timers? Disallow timers being launched in a run initiated by fireAllRules()? Let&#39;s hope that 6.x reacts cleanly...<br>
<br></div><div>-W<br></div><div><div><div><br><br><br></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 24 June 2013 21:05, Mark Proctor <span dir="ltr">&lt;<a href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">btw sorry about the confusion. The reason was we have changed the behaviour in 6, and in the mean time I&#39;d forgotten what the exact behaviour was in 5.<div>
<br></div><div>In 6.x there is no async behaviour, for fireAllRules,  all action happens in the user thread.  So there will be no rule firing if fireAllRules (passive mode) is not called, or you are not using fireUntilHalt (reactive mode). </div>
<div><br></div><div>There have been several discussion on IRC, and the conclusion was were very uncomfortable with async operations of timers, in passive mode. If people want reactive behaviour, they should use the engine in reactive mode, if they want passive behaviour, they should use the engine in passive mode.</div>
<div><br></div><div>Timers  are no longer part of  Agenda, and instead we have a TimerNode that lives in the network. It&#39;s role is simply to control tuple propagation. The code is a lot simpler and more isolated than 5.x, this is also very helpful (if not necessary) in the multi-core work we plan to do.</div>
<div><a href="https://github.com/droolsjbpm/drools/blob/master/drools-core/src/main/java/org/drools/core/phreak/PhreakTimerNode.java" target="_blank">https://github.com/droolsjbpm/drools/blob/master/drools-core/src/main/java/org/drools/core/phreak/PhreakTimerNode.java</a></div>
<div><br></div><div><br></div><div>We do think there may be some future use cases for a mixed hybrid/passive execution mode. Where some rules are passive, some reactive, but we&#39;d rather that we found a way to do this declaratively.</div>
<div><br></div><div>Mark</div><div><br><div><div>On 22 Jun 2013, at 07:17, Wolfgang Laun &lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>&gt; wrote:</div><br><blockquote type="cite">
<div dir="ltr"><div><span> </span><span>Added to <a href="https://github.com/droolsjbpm/drools/tree/master/drools-docs/drools-expert-docs/src/main/docbook/en-US/Chapter-LanguageReference" target="_blank"><span>Chapter-LanguageReference</span></a></span><span> / </span><strong>Section-Rule.xml</strong> on master.<br>

</div><div>-W<br><span title="copy to clipboard"><span></span></span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 20 June 2013 22:55, Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>OK, and now? You can wrap it into a couple of docbook tags and add it to the Expert manual, I&#39;m not reserving the copyright ;-)<span><font color="#888888"><br>

</font></span></div><span><font color="#888888">-W<br></font></span></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">
On 20 June 2013 21:29, Mark Proctor <span dir="ltr">&lt;<a href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div style="word-wrap:break-word">I assumed you were quoting from some documentation.<span><font color="#888888"><br></font></span><div><span><font color="#888888">Mark</font></span><div>
<div><br><div><div>On 20 Jun 2013, at 17:08, Wolfgang Laun &lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>&gt; wrote:</div><br><blockquote type="cite"><div dir="ltr"><div>
<div>You sound absolutely sibyllic. Which documentation will you update - I&#39;m not aware of any documentation describing the behaviour of timers. What, in your opinion, was the &quot;behaviour in an older version&quot;? And what &quot;older version&quot; are you referring to anyway? I&#39;ve ascertained that what I described is the behaviour in 5.1.1, 5.2.0, 5.3.0, 5.4.0 and 5.5.0.<br>



<br></div>And: where is it written that execution tied to a repeating timer &quot;must be constrained within fireAllRules?&quot; I could make a very good case for arguing that RHS executions due to timer expiry aren&#39;t &quot;firing&quot; in the classic sense - that&#39;s just what happens when the LHS matches.<br>



<br></div>-W<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 20 June 2013 15:44, Mark Proctor <span dir="ltr">&lt;<a href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We&#39;ll update the documentation, that was probably the behaviour in an older version. The behaviour should not have rules async firing, unless there is proper async controls, as with fireUntilHalt, otherwise the firings must be constrained within fireAllRules.<br>




<br>
Mark<br>
<div>On 20 Jun 2013, at 12:04, Wolfgang Laun &lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>&gt; wrote:<br>
<br>
&gt;    A rule controlled by a timer becomes active when it matches, and<br>
&gt;    once for each individual match. Its consequence is executed<br>
&gt;    repeatedly, according to the timer&#39;s settings. This stops as soon<br>
&gt;    as the condition doesn&#39;t match any more.<br>
&gt;<br>
&gt;    Consequences are executed even after control returns from a call<br>
&gt;    to fireUntilHalt(). Moreover, the Engine remains reactive to any<br>
&gt;    changes made to the Working Memory. For instance, removing a fact<br>
&gt;    that was involved in triggering the timer rule&#39;s execution causes<br>
&gt;    the repeated execution to terminate, or inserting a fact so that<br>
&gt;    some rule matches will cause that rule to fire. But the Engine is<br>
&gt;    not continually active, only after a rule fires, for whatever<br>
&gt;    reason. Thus, reactions to an insertion done asynchronously will<br>
&gt;    not happen until the next execution of a timer-controlled rule.<br>
&gt;<br>
&gt;    Disposing a session puts an end to all timer activity.<br>
&gt;<br>
&gt;    -W<br>
</div>&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<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>
</blockquote></div><br></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></blockquote>


</div><br></div></div></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></blockquote></div><br></div>
</div></div></blockquote></div><br></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></blockquote>
</div><br></div></div><br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">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></blockquote></div><br></div>