<br>     Well, I was going to suggest how to do it, but I guess it is a nice exercise for the avid users. :)<br><br>     Submit your suggestions to the list people. Lets see what you come up with. It can be implemented as a single rule or as multiple rules. I will send my own suggestion to the list for critics tomorrow. <br>
<br>      Rule spec:<br><br>&quot;When there is an alarm with probable cause 45 for each and every one of the monitored equipments in the network, except the equipment whose index is 0 (zero, i.e. non root equiment), discard all the corresponding alarms and replace them by a single, consolidated alarm.&quot;<br>
<br>      For simplicity, people can use pseudo code in the RHS if they prefer. The LHS of the rule (or rules) is what matters the most for us. The above spec has still some ambiguities, so feel free to interpret them as you like or suggest modifications.<br>
<br>      Any takers? ;)<br><br>      Cheers,<br>         Edson <br><br>2009/7/15 Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;</span><br><div class="gmail_quote">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">2009/7/15 Edson Tirelli &lt;<a href="mailto:tirelli@post.com">tirelli@post.com</a>&gt;:<br>
<div class="im">&gt;<br>
&gt;    Aldian,<br>
&gt;<br>
&gt;    Yes, this is the way to go:<br>
&gt;<br>
&gt; rule &quot;detect and set routers different from root for alarm 45&quot;<br>
&gt; When<br>
&gt;    * All routers which index is different from 0 are raising the alarm 45<br>
&gt;    * There is an alarm $a of numero 45 raised by an equipement $e<br>
&gt; different from the root<br>
&gt; Then<br>
&gt;    * execute some specific code on ($a,$e)<br>
&gt; end<br>
&gt;<br>
&gt;    It would be like this:<br>
&gt;<br>
&gt; when<br>
&gt;     forall( $e1 : Equipment( index != 0 )<br>
&gt;              Alarm( origin == $<a href="http://e1.name" target="_blank">e1.name</a>, probablecause == 45 )  )<br>
&gt;     $e2 : Equipment( index != 0 )<br>
</div>&gt;     $a2 : Alarm( origin == $<a href="http://e2.name" target="_blank">e2.name</a>, probablecause == 45 )<br>
<div class="im">&gt; then<br>
&gt;     // do something with $e2 and $a2<br>
&gt; end<br>
&gt;<br>
<br>
</div>What happens if the RHS contains a retract( $a2 ), which (I think) is<br>
one of the things Aldian intends to do?<br>
<br>
Also, there is the requirement of inserting a summary alarm<br>
replacing all the 45ers on non-root equipments. You may not<br>
want to do this on the RHS, unless you rely on the engine<br>
discarding fact duplicates.<br>
<font color="#888888"><br>
-W<br>
</font><div><div></div><div class="h5"><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><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>