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? Is there another way to load rules directly from file system?
kbuilder.add(ResourceFactory.newClassPathResource("c:\\savedRules\\rule.drl"), ResourceType.DRL);
– Augusto