[rules-dev] Performance Question

James C. Owen jco at kbsc.com
Fri Oct 17 15:43:16 EDT 2008


Greetings:

I'm with Mark Proctor on this subject - it's better fitted for the  
Drools programmer (users) list and not for the Drools Developers  
list.  Developers list is for writing the Drools tool itself.

SDG
jco
Senior Consultant / Architect
KnowledgeBased Systems Corporation
http://www.kbsc.com
Co-founder and Director of The October {Technical} Rules Fest -THE  
RuleBased Systems Conference Oct 22-24 Dallas, TX
http://www.OctoberRulesFest.org
"This above all: to thine own self be true,
And it must follow, as the night the day,
Thou canst not then be false to any man."
Hamlet, Act 1, Scene III
http://www-tech.mit.edu/Shakespeare/hamlet/hamlet.1.3.html





On Oct 17, 2008, at 2:28 PM, hare ram wrote:

> There is more to it ,but just to give an idea.
>
> I thought about the idea you have given me, but just did not get an  
> idea of how to implement
>
> Say in the below rules itself
>
> rule "IP Route File rule"
>     salience 2000
>     when
>         Line ( line matches "^.*\s+show\s+ip\s+route\s*$" )
>         Line ( line matches "^.*\s+dest\s+address\s*$ )
>         file : FileFinder()
>
>     then
>         file.setFileType("ip route file");
>         drools.halt();
> end
>
>
> When I encounter a line  "show ip route" in  a file , I know that  
> match occured. But how do I implement it
>
> Did you mean I should  have  written a separate rule like
>
> when
>         Line ( line matches "^.*\s+show\s+ip\s+route\s*$" )
> then
>       update (the above line with proceed==true )
>
>
> In that case will not explode the number of rules (50 * say 3 matches)
>
> Thanks
> Shiva
>
>
>
>
> On Fri, Oct 17, 2008 at 3:20 PM, Greg Barton <greg_barton at yahoo.com>  
> wrote:
> Are you sure you want to use rules for this?  If you're not going to  
> do analysis more complex than what you've described I'd say straight  
> java is a better option.
>
> That being said, this is one thing to try:
>
> 1) Add a "processed" property of type boolean to Line, default value  
> false.
> 2) Set processed = true on Lines that are matched
> 3) Have a low salience rule (lower than all other rules that match a  
> Line) that matches a Line with processed == false and retracts it.   
> It must be low enough priority so it fires after any other rules  
> that could match the Line.
>
> --- On Fri, 10/17/08, hare ram <hare.bond at gmail.com> wrote:
>
> > From: hare ram <hare.bond at gmail.com>
> > Subject: [rules-dev] Performance Question
> > To: rules-dev at lists.jboss.org
> > Date: Friday, October 17, 2008, 1:56 PM
> > Hello all,
> >
> > This is the set of rules i have
> >
> > rule "IP Route File rule"
> >     salience 2000
> >     when
> >         Line ( line matches
> > "^.*\s+show\s+ip\s+route\s*$" )
> >         Line ( line matches
> > "^.*\s+dest\s+address\s*$ )
> >         file : FileFinder()
> >
> >     then
> >         file.setFileType("ip route file");
> >         drools.halt();
> > end
> >
> >
> >
> > All I am doing in rules is, I read each line from the given
> > file, convert
> > them into Line Objects and see if any of my
> > rules matches. There are about 50 such rules, that will
> > help me
> > differentiate what kind of file is present in my input
> > directory.
> >
> > The question I have , is there a way I can know if Line
> > Object matched any
> > of the rules ? If a Line Object is not matched by
> > any of rules, I can just retract that object from the
> > memory and prevent Out
> > of Memory Exception if the file size is huge
> >
> > Thanks
> > Shiva
> > _______________________________________________
> > rules-dev mailing list
> > rules-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-dev
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20081017/04393c82/attachment.html 


More information about the rules-dev mailing list