2009/7/15 Edson Tirelli <tirelli(a)post.com>:
Aldian,
Yes, this is the way to go:
rule "detect and set routers different from root for alarm 45"
When
* All routers which index is different from 0 are raising the alarm 45
* There is an alarm $a of numero 45 raised by an equipement $e
different from the root
Then
* execute some specific code on ($a,$e)
end
It would be like this:
when
forall( $e1 : Equipment( index != 0 )
Alarm( origin == $e1.name, probablecause == 45 ) )
$e2 : Equipment( index != 0 )
$a2 : Alarm( origin == $e2.name, probablecause == 45 )
then
// do something with $e2 and $a2
end
What happens if the RHS contains a retract( $a2 ), which (I think) is
one of the things Aldian intends to do?
Also, there is the requirement of inserting a summary alarm
replacing all the 45ers on non-root equipments. You may not
want to do this on the RHS, unless you rely on the engine
discarding fact duplicates.
-W