Did you try using
ResourceFactory.newFileResource("C:\\savedRules\\rule.drl")? A FileResource
is more appropriated for your case I think.By the way, this kind of questions should go in [email protected]. I'm forwarding it now. Best, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com On Mon, Feb 14, 2011 at 8:21 AM, stefano82 <[email protected]> wrote: > > hello, > i devloped a custom rule editor able to create drl file and save them in > file system under a given directory. (e.g. c:\savedRules\rule.drl). > The problem is that once the rule is saved i need to run it with drools > engine. > In my class i try to load rule in this way: > > KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); > > kbuilder.add(ResourceFactory.newClassPathResource("c:\savedRules\rule.drl"), > ResourceType.DRL); > > but its doesn't work. the exception is "rule.drl cannot be opened because > it > does not exist" but it actually exists.... > > What am I doing wrong? there is another way to load rules directly from > file > sistem? > > thanks in advice. > -- > View this message in context: > http://drools-java-rules-engine.46999.n3.nabble.com/Drools-5-load-drl-rule-file-from-file-system-tp2491856p2491856.html > Sent from the Drools - Dev mailing list archive at Nabble.com. > _______________________________________________ > rules-dev mailing list > [email protected] > https://lists.jboss.org/mailman/listinfo/rules-dev >
_______________________________________________ rules-users mailing list [email protected] https://lists.jboss.org/mailman/listinfo/rules-users
