[rules-users] looking for more information on drools expert

Edson Tirelli tirelli at post.com
Wed Jul 15 11:25:38 EDT 2009


     Well, I was going to suggest how to do it, but I guess it is a nice
exercise for the avid users. :)

     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.

      Rule spec:

"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."

      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.

      Any takers? ;)

      Cheers,
         Edson

2009/7/15 Wolfgang Laun <wolfgang.laun at gmail.com>

> 2009/7/15 Edson Tirelli <tirelli at 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
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 Edson Tirelli
 JBoss Drools Core Development
 JBoss by Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090715/7de229fb/attachment.html 


More information about the rules-users mailing list