Hi,
Using a single kbuilder should also work. Beyond that, I don't see anything wrong in your code. You can check for errors in your kbuilder after the packages were added:

        if (kbuilder.hasErrors()){
            Iterator<KnowledgeBuilderError> errors = kbuilder.getErrors().iterator();
            while (errors.hasNext()){
                System.out.println("Error: "+errors.next().getMessage());
            }
            throw new IllegalStateException("Errors during resource compilation");
        }

Could you be more specific about your expectations? i.e: How do you know processes are not being added? Regarding to DSL assets, you are not going to see them in the PKG. DSL and DSLR are used during package compilation, and only the generated rules are added to the resulting package. 


XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


On Sat, Aug 14, 2010 at 8:11 AM, Vignesh <viki.ccc@gmail.com> wrote:

Hi Esteban,

I have added the complete package into the kbuilder using the package url,
Below is the way Im using to add the package,

KnowledgeBuilder kbuilder1 = KnowledgeBuilderFactory.newKnowledgeBuilder();
KnowledgeBuilder kbuilder2 = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder1.add(ResourceFactory.newUrlResource("http://localhost:8983/drools-guvnor/org.drools.guvnor.Guvnor/package/test1/LATEST"),ResourceType.PKG);
kbuilder2.add(ResourceFactory.newUrlResource("http://localhost:8983/drools-guvnor/org.drools.guvnor.Guvnor/package/test2/LATEST"),ResourceType.PKG);
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder1.getKnowledgePackages());
kbase.addKnowledgePackages(kbuilder2.getKnowledgePackages());
StatefulKnowledgeSession wrkMemory = kbase.newStatefulKnowledgeSession();
int i=wrkMemory.fireAllRules();

Let me know whether this approach is fine or if Im missing something here,
provide your comments on the same.

Thanks,
Vignesh
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Firing-Mulitple-packages-tp1127290p1145342.html
Sent from the Drools - User mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users