<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> && 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> && 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 "matches" operator to compare equal strings. Not sure if that is what you want, because "==" has different semantics and better performance than "matches" if what you really want is compare equality. Remember that in regexps, some characters have special meaning, for instance, "." is a wildcard for any character. Meaning:<br>
<br>"abc" matches "a.c" -> true<br>"abc" == "a.c" -> false<br><br> Cheers,<br> Edson<br><br><br><br><div class="gmail_quote">2009/7/16 Gab Aldian <span dir="ltr"><<a href="http://aldian.gp">aldian.gp</a>@<a href="http://gmail.com">gmail.com</a>></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>