[rules-dev] Performance Question
David Sinclair
dsinclair at chariotsolutions.com
Fri Oct 17 15:09:37 EDT 2008
You could add an attribute on the Line object to mark it as processed or
something when a match is found. You could then write another rule that
looks for unprocessed lines and retracts them.
dave
On Fri, Oct 17, 2008 at 2:56 PM, hare ram <hare.bond at gmail.com> wrote:
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20081017/84f54409/attachment.html
More information about the rules-dev
mailing list