<br>   Very good! :)<br><br>   Just FYI, in the case of accumulate, you could also use the collectList() function to simplify your rule. This:<br><br>        $alarmList : LinkedList() <br>                        from accumulate (  ($e : Element(parentindex!=0) and<br>
                                          $a : Alarm( origin matches $<a href="http://e.name">e.name</a> &amp;&amp; probablecause==45)),<br>                                          init( LinkedList alarmList = new LinkedList();),<br>
                                          action( alarmList.add($a);),<br>                                          reverse( alarmList.remove($a);),<br>                                          result( alarmList ) );<br>   Is the same as:<br>
<br>        $alarmList : List() <br>                        from accumulate (  ($e : Element(parentindex!=0) and<br>                                          $a : Alarm( origin matches $<a href="http://e.name">e.name</a> &amp;&amp; probablecause==45)),<br>
                                          collectList( $a ) );<br><br>   Also, you can always implement your own functions for accumulate:<br><br><a href="http://blog.athico.com/2009/06/how-to-implement-accumulate-functions.html">http://blog.athico.com/2009/06/how-to-implement-accumulate-functions.html</a><br>
<br>   Finally, I see you are using &quot;matches&quot; operator to compare equal strings. Not sure if that is what you want, because &quot;==&quot; has different semantics and better performance than &quot;matches&quot; if what you really want is compare equality. Remember that in regexps, some characters have special meaning, for instance, &quot;.&quot; is a wildcard for any character. Meaning:<br>
<br>&quot;abc&quot; matches &quot;a.c&quot; -&gt; true<br>&quot;abc&quot; == &quot;a.c&quot; -&gt; false<br><br>   Cheers,<br>       Edson<br><br><br><br><div class="gmail_quote">2009/7/16 Gab Aldian <span dir="ltr">&lt;<a href="http://aldian.gp">aldian.gp</a>@<a href="http://gmail.com">gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">After some more investigation, I managed also to make it work with<br>
collect: <a href="http://drools.pastebin.com/m14f0e329" target="_blank">http://drools.pastebin.com/m14f0e329</a><br>
<br>
I would rather not multiplicate rules, because we probably will have<br>
dozens for our system which is very big and can supervise around a<br>
thousand equipements in some cases<br>
<br>
Thank you very much for the advices<br>
<div><div></div><div class="h5"><br>
Aldian<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="http://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">http://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>