On 30 Jun 2014, at 04:20, Chris B <sunnyca...@gmail.com> wrote:

> I am using 6.0.1 and having difficulties in kmodule.xml.
> 
> My goal is to have a directory where I can keep putting new rules which
> should be automatically picked up.
This is not possible. When you want to do an update you will need to build a 
new kjar and add that to the KieRepository and then call updatetoVersion() on 
the kiecontainer.

What you can do is put your drl files (not on the class path) somewhere and 
setup a file scanner. Then create KieModules in memory, incrementally yourself. 
Some examples of how to use the programmatic KieBuilder api:
https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/integrationtests/IncrementalCompilationTest.java

Mark

> But looks like drools is looking in the jar file for new rules.
> What should be my entries.
> 
> My current kmodule.xml
> ###################
> <?xml version="1.0" encoding="UTF-8"?>
> <kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule";>
>    <kbase name="rules" packages="DRL" eventProcessingMode="stream">
>        <ksession name="ksession-rules"/>
>    </kbase>
> </kmodule>
> 
> 
> 
> My pom.properties
> ####################
> #Generated by Maven
> #Wed Jun 25 17:53:00 PDT 2014
> version=0.0.1
> groupId=com.myc
> artifactId=MyProject
> 
> 
> 
> The output which I am getting
> #####################
> 2014-06-29 16:45:08 o.d.c.k.b.i.ClasspathKieProject [INFO] Found kmodule:
> jar:file:/home/chrism/apache-storm-0.9.1-incubating/lib/MyProject-0.0.1.jar!/META-INF/kmodule.xml
> 2014-06-29 16:45:08 o.d.c.k.b.i.ClasspathKieProject [DEBUG] KieModule URL
> type=jar
> url=/home/chrism/apache-storm-0.9.1-incubating/lib/MyProject-0.0.1.jar
> 2014-06-29 16:45:08 o.d.c.k.b.i.ClasspathKieProject [DEBUG] Found and used
> pom.properties META-INF/maven/com.myc/MyProject/pom.properties
> 2014-06-29 16:45:08 o.d.c.k.b.i.ClasspathKieProject [DEBUG] Discovered
> classpath module com.myc:MyProject:0.0.1
> 2014-06-29 16:45:09 o.d.c.k.b.i.KieRepositoryImpl [INFO] KieModule was
> added:ZipKieModule[
> ReleaseId=com.myc:MyProject:0.0.1file=/home/chrism/apache-storm-0.9.1-incubating/lib/MyProject-0.0.1.jar]
> 2014-06-29 16:45:09 o.d.c.k.b.i.ClasspathKieProject [INFO] Found kmodule:
> jar:file:/home/chrism/apache-storm-0.9.1-incubating/lib/MyProject-0.0.1.jar!/META-INF/kmodule.xml
> 2014-06-29 16:45:09 o.d.c.k.b.i.ClasspathKieProject [DEBUG] KieModule URL
> type=jar
> url=/home/chrism/apache-storm-0.9.1-incubating/lib/MyProject-0.0.1.jar
> 2014-06-29 16:45:09 o.d.c.k.b.i.ClasspathKieProject [DEBUG] Found and used
> pom.properties META-INF/maven/com.myc/MyProject/pom.properties
> 2014-06-29 16:45:09 o.d.c.k.b.i.ClasspathKieProject [DEBUG] Discovered
> classpath module com.myc:MyProject:0.0.1
> 2014-06-29 16:45:09 o.d.c.k.b.i.KieRepositoryImpl [INFO] KieModule was
> added:ZipKieModule[
> ReleaseId=com.myc:MyProject:0.0.1file=/home/chrism/apache-storm-0.9.1-incubating/lib/MyProject-0.0.1.jar]
> 2014-06-29 16:45:09 o.d.c.k.b.i.AbstractKieModule [WARN] No files found for
> KieBase rules
> 
> 
> 
> 
> ----------------------------
> 
> As above it is not able to read the rules as the rules are located in the
> filesystem somewhere else like in /a/b/c directory and it is in the
> classpath, but not being read as it seems to be only looking in jar file
> 
> 
> Any help greatly appreciated.
> 
> 
> 
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/kbase-using-kie-tp4030187.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users


_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to