<br><br><div class="gmail_quote">On 30 January 2012 17:18, Philipp Herzig <span dir="ltr"><<a href="mailto:pherzig@googlemail.com">pherzig@googlemail.com</a>></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'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'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 <<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>>:<br>
<div class="HOEnZb"><div class="h5">> Does the doSomething() update or retract any EventObject facts and notify<br>
> the Drools engine accordingly?<br>
><br>
> (So far: Neither using the same class for the "create" and the "delete"<br>
> events nor<br>
> using a map (i.e., "data") for all properties is helping w.r.t. speed.)<br>
><br>
> -W<br>
><br>
><br>
> On 30 January 2012 15:07, Philipp Herzig <<a href="mailto:pherzig@googlemail.com">pherzig@googlemail.com</a>> wrote:<br>
>><br>
>> Sure, here it is. Sorry for any inconvienience!<br>
>><br>
>> rule "new_intent"<br>
>> timer (20s)<br>
>> when<br>
>> $evt : EventObject(data['type']=='create') from entry-point<br>
>> eventstream<br>
>> not ( EventObject(data['type']=='delete',<br>
>> data['mrid']==$evt.data['mrid'], data['userid']==$evt.data['userid'])<br>
>> from entry-point eventstream)<br>
>> then<br>
>> SomeAPI.getInstance().doSomething();<br>
>> end<br>
>><br>
>><br>
>> Thank you,<br>
>><br>
>> Philipp<br>
>><br>
>><br>
>><br>
>><br>
>> 2012/1/30 Michael Anstis <<a href="mailto:michael.anstis@gmail.com">michael.anstis@gmail.com</a>><br>
>> ><br>
>> > It's going to help (probably) if you include the definition of your rule<br>
>> > (or rules).<br>
>> ><br>
>> > 2012/1/30 Philipp Herzig <<a href="mailto:pherzig@googlemail.com">pherzig@googlemail.com</a>><br>
>> >><br>
>> >> Dear Community,<br>
>> >><br>
>> >> Drools is pretty fast regarding all my use cases. However, today I have<br>
>> >> found a problem where I cannot find any solution. Hopefully someone of you<br>
>> >> can help.<br>
>> >><br>
>> >> 1. I have a rule with a @timer(10s) attribute (should be 24h later on<br>
>> >> but doesn't matter). This rule is activated when a "create" event occurs and<br>
>> >> invalidated once a "delete" event occurs within the timeframe of @timer.<br>
>> >><br>
>> >> 2. I have approx. 9000 "create" events which are bulk loaded into the<br>
>> >> working memory and creating activations for the rule above.<br>
>> >><br>
>> >> 3. I have approx. 2000 "delete" events which are bulk loaded into my<br>
>> >> entry-point cancelling the respective activations from step (2)<br>
>> >><br>
>> >> 4. After the timer expired, the first activation is fired correctly.<br>
>> >> However, all other activations are fired with some noticeable delay<br>
>> >> (actually it needs 20-30minutes until all activations are fired).<br>
>> >><br>
>> >><br>
>> >> Do you have an idea what the problem with the timer might be?<br>
>> >> Unfortunately, I have neither an idea how the scheduler in the background<br>
>> >> works nor which class I should start looking at.<br>
>> >><br>
>> >> BTW: For testing purpose I switched step (2) & (3), that is, "delete"<br>
>> >> events are inserted before the "create" events and removed the timer<br>
>> >> attribute which is obviously the same logic. It performs lightning fast in<br>
>> >> this case... (all remaining activations are fired within 5<br>
>> >> seconds). However, insertinging my "delete" events before the "create"<br>
>> >> events is ok for testing but not feasible in practice.<br>
>> >><br>
>> >> It would be great if some of you has an idea or point to start within<br>
>> >> the code.<br>
>> >><br>
>> >> Thanks in advance,<br>
>> >><br>
>> >> Philipp<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>
>> >><br>
>> ><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>
>> ><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>
><br>
><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>
><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>