<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><div><div><div><div><div>Greetings:</div><div><br></div><div>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. &nbsp;Developers list is for writing the Drools tool itself.</div><div><br></div><div>SDG</div><div>jco</div><div>Senior Consultant / Architect</div><div>KnowledgeBased Systems Corporation</div><div><div><a href="http://www.kbsc.com">http://www.kbsc.com</a></div><div><div><div>Co-founder and Director of The October {Technical} Rules Fest&nbsp;-THE RuleBased Systems Conference Oct 22-24 Dallas, TX</div><div><a href="http://www.OctoberRulesFest.org">http://www.OctoberRulesFest.org</a></div></div></div></div><div>"This above all: to thine own self be true,<div>And it must follow, as the night the day,</div><div>Thou canst not then be false to any man."</div><div>Hamlet, Act 1, Scene III</div><div><a href="http://www-tech.mit.edu/Shakespeare/hamlet/hamlet.1.3.html">http://www-tech.mit.edu/Shakespeare/hamlet/hamlet.1.3.html</a></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div><br></div></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"> </div><br><div><div>On Oct 17, 2008, at 2:28 PM, hare ram wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">There is more to it ,but just to give an idea. <br><br>I thought about the idea you have given me, but just did not get an idea of how to implement<br> <br> Say in the below rules itself<br> <br> rule "IP Route File rule"<br> &nbsp;&nbsp;&nbsp; salience 2000<br> &nbsp;&nbsp;&nbsp; when<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Line ( line matches "^.*\s+show\s+ip\s+route\s*$" )<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Line ( line matches "^.*\s+dest\s+address\s*$ )<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; file : FileFinder()<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br> &nbsp;&nbsp;&nbsp; then <br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; file.setFileType("ip route file");<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; drools.halt();<br> end<br> <br> <br> When I encounter a line&nbsp; "show ip route" in&nbsp; a file , I know that match occured. But how do I implement it<br> <br> Did you mean I should&nbsp; have&nbsp; written a separate rule like<br> <br> when<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Line ( line matches "^.*\s+show\s+ip\s+route\s*$" )<br> then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; update (the above line with proceed==true )<br><br><br>In that case will not explode the number of rules (50 * say 3 matches)<br><br>Thanks<br>Shiva<br><br><br> <br><br><div class="gmail_quote">On Fri, Oct 17, 2008 at 3:20 PM, Greg Barton <span dir="ltr">&lt;<a href="mailto:greg_barton@yahoo.com" target="_blank">greg_barton@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Are you sure you want to use rules for this? &nbsp;If you're not going to do analysis more complex than what you've described I'd say straight java is a better option.<br> <br> That being said, this is one thing to try:<br> <br> 1) Add a "processed" property of type boolean to Line, default value false.<br> 2) Set processed = true on Lines that are matched<br> 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. &nbsp;It must be low enough priority so it fires after any other rules that could match the Line.<br> <br> --- On Fri, 10/17/08, hare ram &lt;<a href="mailto:hare.bond@gmail.com" target="_blank">hare.bond@gmail.com</a>> wrote:<br> <br> > From: hare ram &lt;<a href="mailto:hare.bond@gmail.com" target="_blank">hare.bond@gmail.com</a>><br> > Subject: [rules-dev] Performance Question<br> > To: <a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br> > Date: Friday, October 17, 2008, 1:56 PM<br> <div><div></div><div>> Hello all,<br> ><br> > This is the set of rules i have<br> ><br> > rule "IP Route File rule"<br> > &nbsp; &nbsp; salience 2000<br> > &nbsp; &nbsp; when<br> > &nbsp; &nbsp; &nbsp; &nbsp; Line ( line matches<br> > "^.*\s+show\s+ip\s+route\s*$" )<br> > &nbsp; &nbsp; &nbsp; &nbsp; Line ( line matches<br> > "^.*\s+dest\s+address\s*$ )<br> > &nbsp; &nbsp; &nbsp; &nbsp; file : FileFinder()<br> ><br> > &nbsp; &nbsp; then<br> > &nbsp; &nbsp; &nbsp; &nbsp; file.setFileType("ip route file");<br> > &nbsp; &nbsp; &nbsp; &nbsp; drools.halt();<br> > end<br> ><br> ><br> ><br> > All I am doing in rules is, I read each line from the given<br> > file, convert<br> > them into Line Objects and see if any of my<br> > rules matches. There are about 50 such rules, that will<br> > help me<br> > differentiate what kind of file is present in my input<br> > directory.<br> ><br> > The question I have , is there a way I can know if Line<br> > Object matched any<br> > of the rules ? If a Line Object is not matched by<br> > any of rules, I can just retract that object from the<br> > memory and prevent Out<br> > of Memory Exception if the file size is huge<br> ><br> > Thanks<br> > Shiva<br> </div></div><div>> _______________________________________________<br> > rules-dev mailing list<br> > <a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br> > <a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br> <br> </div><div>__________________________________________________<br> Do You Yahoo!?<br> Tired of spam? &nbsp;Yahoo! Mail has the best spam protection around<br> <a href="http://mail.yahoo.com" target="_blank">http://mail.yahoo.com</a><br> </div><div><div></div><div>_______________________________________________<br> rules-dev mailing list<br> <a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br> <a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br> </div></div></blockquote></div><br></div> _______________________________________________<br>rules-dev mailing list<br><a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/rules-dev<br></blockquote></div><br></body></html>