Hi Wolfgang,<div><br></div><div>I&#39;ve attached a simple test case, which demonstrates the repetitions. If you run it, you&#39;ll see that the rule fires 3 times. [Tested in 5.4]</div><div><br></div><div><div>count = 5, time = 5000ms</div>
<div>count = 5, time = 10000ms</div><div>count = 5, time = 15000ms</div><div><br></div><div>Changing the repeat-interval to 0 has identical results. Changing to a negative number [suggested earlier] causes an infinite loop in Drools.</div>
<div><br></div><div>To clarify, what I&#39;m trying to do is block the rule from firing for the first 5 seconds and then fire normally after that ( as if there was no timer ). For example. The output I&#39;m trying to achieve (not necessarily with timers) is:</div>
<div><br></div><div>count = 5, time = 5000ms</div><div>count = 5, time = 6000ms</div><div>count = 5, time = 7000ms</div><div>count = 5, time = 8000ms</div><div>count = 5, time = 9000ms</div><div>count = 5, time = 10000ms</div>
<div>count = 5, time = 11000ms</div><div>count = 5, time = 12000ms</div><div>count = 5, time = 13000ms</div><div>count = 5, time = 14000ms</div><div>count = 5, time = 15000ms</div><div><br></div><div>Thanks &amp; Regards,</div>
<div><br></div><div>Paul</div><br><div class="gmail_quote">On Thu, Jun 7, 2012 at 7:41 AM, 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 class="im">On 07/06/2012, Mark Proctor &lt;<a href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>&gt; wrote:<br>

&gt; On 06/06/2012 18:39, Vincent LEGENDRE wrote:<br>
&gt;&gt; try with a negative number ?<br>
&gt; I would ommit the number all together. I suspect what 0 does is schedule<br>
&gt; with intervals of 0s, thus it fires straight away.<br>
&gt; timer(int: 5s)<br>
<br>
</div>@myself: I really should RFTM before proposing risky (if working) workarounds.<br>
<br>
The OP&#39;s claim  &quot;if the repeat interval is omitted, it uses the<br>
initial delay as the repeat interval&quot; is, untrue; DRL timer&#39;s<br>
definition is in line with all similar APIs and definitions, i.e.,<br>
when the repeat interval is omitted, then it&#39;s a one shot timer.<br>
<br>
@Paul: As I wrote in a previous mail - there&#39;s got to be another<br>
effect that causes the repetitions. Note that a live timer is<br>
connected to an *activation*, which isn&#39;t the same as being connected<br>
to a *rule*:<br>
   1 rule - n activations - n timers - x firings.<br>
<span class="HOEnZb"><font color="#888888"><br>
-W<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
&gt;<br>
&gt; Mark<br>
&gt;&gt;<br>
&gt;&gt; ----- Original Message -----<br>
&gt;&gt; From: &quot;Paul R.&quot;&lt;<a href="mailto:reverselogic@gmail.com">reverselogic@gmail.com</a>&gt;<br>
&gt;&gt; To: &quot;Rules Users List&quot;&lt;<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;<br>
&gt;&gt; Sent: Mercredi 6 Juin 2012 19:26:22<br>
&gt;&gt; Subject: Re: [rules-users] Initial rule delay<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Thanks Wolfgang, but setting the repeat-interval to 0 seems to have the<br>
&gt;&gt; same effect as omitting the repeat-interval [Tested in 5.1&amp;  5.4].<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Thanks Vincent, this seems to work. However I was hoping for a simpler<br>
&gt;&gt; solution :)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; - Paul<br>
&gt;&gt;<br>
&gt;&gt; On Wed, Jun 6, 2012 at 5:06 PM, Vincent LEGENDRE&lt;<br>
&gt;&gt; <a href="mailto:vincent.legendre@eurodecision.com">vincent.legendre@eurodecision.com</a>&gt;  wrote:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Yes of course ...<br>
&gt;&gt; Simpler this way ...<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ----- Original Message -----<br>
&gt;&gt; From: &quot;Wolfgang Laun&quot;&lt;  <a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;<br>
&gt;&gt; To: &quot;Rules Users List&quot;&lt;  <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Sent: Mercredi 6 Juin 2012 18:02:40<br>
&gt;&gt; Subject: Re: [rules-users] Initial rule delay<br>
&gt;&gt;<br>
&gt;&gt; Try:<br>
&gt;&gt; timer( int:&lt;initial&gt;  0 )<br>
&gt;&gt; -W<br>
&gt;&gt;<br>
&gt;&gt; On 06/06/2012, Paul R.&lt;  <a href="mailto:reverselogic@gmail.com">reverselogic@gmail.com</a>&gt;  wrote:<br>
&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I&#39;m looking for a way to delay a rules initial execution? In the<br>
&gt;&gt;&gt; following<br>
&gt;&gt;&gt; example, I would like to prevent the rule from firing when the first<br>
&gt;&gt;&gt; &quot;Foo&quot;<br>
&gt;&gt;&gt; event is inserted into the working memory.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; rule &quot;DelayTest&quot; when $n : Number() from accumulate( $f : Foo() over<br>
&gt;&gt;&gt; window:time(10s) count($f) ) then // bla end<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; The timer attribute seems to almost support what I&#39;m looking for, i.e.<br>
&gt;&gt;&gt; it<br>
&gt;&gt;&gt; allows for an initial-delay to be specified; but if the repeat interval<br>
&gt;&gt;&gt; is<br>
&gt;&gt;&gt; omitted, it uses the initial delay as the repeat interval.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; timer ( int:&lt;initial delay&gt;  &lt;repeat interval&gt;? )<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; In my case I would like to block the execution of the rule for an<br>
&gt;&gt;&gt; &quot;initial-delay&quot; period, but after that time has elapsed the rule should<br>
&gt;&gt;&gt; fire when every time a new &quot;Foo&quot; event is inserted into the working<br>
&gt;&gt;&gt; memory.<br>
&gt;&gt;&gt; What is the recommended way to do this?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Thanks&amp;  Regards,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Paul<br>
&gt;&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">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>
&gt;<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>
</div></div></blockquote></div><br></div>