-
1. Re: KnowledgeBase loading on demand
swiderski.maciej Jul 5, 2012 7:59 AM (in response to lukasz.kozerski)Not sure what you intent to achieve here... if you could elaborate little bit more on the foal would be easier to try to come up with some ideas.
Have you looked and KnowledgeAgent? It allows you to load resources from various sources (like file system, http, etc) that are defined as ChangeSet and reload (or recreate) knowledge base when changes are discovered.
HTH
-
2. Re: KnowledgeBase loading on demand
lukasz.kozerski Jul 5, 2012 8:05 AM (in response to swiderski.maciej)Maciej Swiderski wrote:
Have you looked and KnowledgeAgent? It allows you to load resources from various sources (like file system, http, etc) that are defined as ChangeSet and reload (or recreate) knowledge base when changes are discovered.
Yes, I have. Difference betwean knowledge agent and my idea is that agent reloads KnowledgeBase after new ChangeSet appears, and I want to have (in simple situation) empty knowledge base, and when process starts load defition that is needed.
-
3. Re: KnowledgeBase loading on demand
swiderski.maciej Jul 5, 2012 8:35 AM (in response to lukasz.kozerski)Then you could manually operate on the knowledge base, something like this:
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); // add you process definitions here... kbuilder.add(ResourceFactory.newFileResource(subfile), ResourceType.BPMN2); kbase.addKnowledgePackages(kbuilder.getKnowledgePackages()); // if you like to remove it you can remove the package kbase.removeKnowledgePackage(packageName);
So you can load the process definitions from whatever source you want, if not already supported by ResourceFactory you can implement your own...
Please nore that building knowledge base is considered a heavy operation and should be rather reused instead of rebuilt frequently.
HTH