<br><br><div class="gmail_quote">On 30 January 2012 17:18, Philipp Herzig <span dir="ltr">&lt;<a href="mailto:pherzig@googlemail.com">pherzig@googlemail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks Wolfgang for your reply.<br>
<br>
doSomething simply persists something with JPA, no events are<br>
retracted or updated. The behavior does also not change when there is<br>
a simple println in the then clause.<br>
<br></blockquote><div>OK.<br><br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I thought events are automatically retracted once no rule applied<br>
anymore.  The EventObject class with the map is used only for<br>
abstraction within the architecture (actually a property pattern). No<br>
intention to speed up something.<br></blockquote><div><br>There&#39;s no information in the (only) rule that would permit an automatic retraction.<br>Mostly this is possible when temporal operators are used.<br><br>Searching for EventObject/create without matching EventObject/delete is<br>
causing a lot of work, since each insertion requires an exhaustive linear<br>search for the absence of a delete or the presence of a create.<br><br>What do you call after the bunch insert? fireAllRules() ?<br><br>-W<br><br>
<br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
As I said, the activation firing works fine when no timer is present<br>
and, of course, deletes are already inserted before the creates,<br>
otherwise the rule won&#39;t fire. <br></blockquote><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Do you know how the Scheduler works? According to the observed<br>
behavior I would guess that there is a background job invoked every<br>
100ms checking if there are timer delayed activations which has to be<br>
fired.<br>
If this is the case, I wonder why only some activations are fired and<br>
not all. Due to the upper time bound?<br>
<br>
Thanks again,<br>
<br>
Philipp<br>
<br>
<br>
2012/1/30 Wolfgang Laun &lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;:<br>
<div class="HOEnZb"><div class="h5">&gt; Does the doSomething() update or retract any EventObject facts and notify<br>
&gt; the Drools engine accordingly?<br>
&gt;<br>
&gt; (So far: Neither using the same class for the &quot;create&quot; and the &quot;delete&quot;<br>
&gt; events nor<br>
&gt; using a map (i.e., &quot;data&quot;) for all properties is helping w.r.t. speed.)<br>
&gt;<br>
&gt; -W<br>
&gt;<br>
&gt;<br>
&gt; On 30 January 2012 15:07, Philipp Herzig &lt;<a href="mailto:pherzig@googlemail.com">pherzig@googlemail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Sure, here it is. Sorry for any inconvienience!<br>
&gt;&gt;<br>
&gt;&gt; rule &quot;new_intent&quot;<br>
&gt;&gt; timer (20s)<br>
&gt;&gt; when<br>
&gt;&gt;      $evt : EventObject(data[&#39;type&#39;]==&#39;create&#39;) from entry-point<br>
&gt;&gt; eventstream<br>
&gt;&gt;      not ( EventObject(data[&#39;type&#39;]==&#39;delete&#39;,<br>
&gt;&gt; data[&#39;mrid&#39;]==$evt.data[&#39;mrid&#39;], data[&#39;userid&#39;]==$evt.data[&#39;userid&#39;])<br>
&gt;&gt; from entry-point eventstream)<br>
&gt;&gt; then<br>
&gt;&gt;  SomeAPI.getInstance().doSomething();<br>
&gt;&gt; end<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Thank you,<br>
&gt;&gt;<br>
&gt;&gt; Philipp<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; 2012/1/30 Michael Anstis &lt;<a href="mailto:michael.anstis@gmail.com">michael.anstis@gmail.com</a>&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; It&#39;s going to help (probably) if you include the definition of your rule<br>
&gt;&gt; &gt; (or rules).<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 2012/1/30 Philipp Herzig &lt;<a href="mailto:pherzig@googlemail.com">pherzig@googlemail.com</a>&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Dear Community,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Drools is pretty fast regarding all my use cases. However, today I have<br>
&gt;&gt; &gt;&gt; found a problem where I cannot find any solution. Hopefully someone of you<br>
&gt;&gt; &gt;&gt; can help.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; 1. I have a rule with a @timer(10s) attribute (should be 24h later on<br>
&gt;&gt; &gt;&gt; but doesn&#39;t matter). This rule is activated when a &quot;create&quot; event occurs and<br>
&gt;&gt; &gt;&gt; invalidated once a &quot;delete&quot; event occurs within the timeframe of @timer.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; 2. I have approx. 9000 &quot;create&quot; events which are bulk loaded into the<br>
&gt;&gt; &gt;&gt; working memory and creating activations for the rule above.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; 3. I have approx. 2000 &quot;delete&quot; events which are bulk loaded into my<br>
&gt;&gt; &gt;&gt; entry-point cancelling the respective activations from step (2)<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; 4. After the timer expired, the first activation is fired correctly.<br>
&gt;&gt; &gt;&gt; However, all other activations are fired with some noticeable delay<br>
&gt;&gt; &gt;&gt; (actually it needs 20-30minutes until all activations are fired).<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Do you have an idea what the problem with the timer might be?<br>
&gt;&gt; &gt;&gt; Unfortunately, I have neither an idea how the scheduler in the background<br>
&gt;&gt; &gt;&gt; works nor which class I should start looking at.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; BTW: For testing purpose I switched step (2) &amp; (3), that is, &quot;delete&quot;<br>
&gt;&gt; &gt;&gt; events are inserted before the &quot;create&quot; events and removed the timer<br>
&gt;&gt; &gt;&gt; attribute which is obviously the same logic. It performs lightning fast in<br>
&gt;&gt; &gt;&gt; this case... (all remaining activations are fired within 5<br>
&gt;&gt; &gt;&gt; seconds). However, insertinging my &quot;delete&quot; events before the &quot;create&quot;<br>
&gt;&gt; &gt;&gt; events is ok for testing but not feasible in practice.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; It would be great if some of you has an idea or point to start within<br>
&gt;&gt; &gt;&gt; the code.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Thanks in advance,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Philipp<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; rules-users mailing list<br>
&gt;&gt; &gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; &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; &gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; rules-users mailing list<br>
&gt;&gt; &gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&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; &gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; --------------------------------------------<br>
&gt;&gt; Philipp Herzig, M.Sc.<br>
&gt;&gt;<br>
&gt;&gt; Mail: <a href="mailto:pherzig@googlemail.com">pherzig@googlemail.com</a><br>
&gt;&gt; Cell: 0178 - 6156244<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;<br>
&gt;<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>
<br>
<br>
--<br>
--------------------------------------------<br>
Philipp Herzig, M.Sc.<br>
<br>
Mail: <a href="mailto:pherzig@googlemail.com">pherzig@googlemail.com</a><br>
Cell: 0178 - 6156244<br>
<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>