Affan Dar [
https://community.jboss.org/people/affandar] created the discussion
"Automatically updating knowledgebase & sessions with new process
definitions"
To view the discussion, visit:
https://community.jboss.org/message/726466#726466
--------------------------------------------------------------
Hello folks, I have guvnor setup as my process 'definitions' editor using
jackrabbit underneath as the JCR. Also, in my code I am creating the knowledgebase using
this repository like so:
'''
KnowledgeAgentConfiguration kaconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
kaconf.setProperty(
"drools.agent.scanDirectories", "true" );
kaconf.setProperty( "drools.agent.scanResources",
"true" );
kaconf.setProperty( "drools.agent.newInstance",
"false" );
// Set the interval on the ResourceChangeScannerService if
the default of 60s is not desirable.
ResourceChangeScannerConfiguration sconf =
ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
sconf.setProperty(
"drools.resource.scanner.interval", "15" ); // set the disk scanning
interval to 30s, default is 60s
ResourceFactory.getResourceChangeScannerService().configure(
sconf );
ResourceFactory.getResourceChangeNotifierService().start();
ResourceFactory.getResourceChangeScannerService().start();
KnowledgeAgent ka =
KnowledgeAgentFactory.newKnowledgeAgent("workflowknowledgeagent", kaconf);
ka.applyChangeSet(ResourceFactory.newUrlResource(
"
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defa...
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defa...;
KnowledgeBase kb = ka.getKnowledgeBase();
'''
This is working fine but when I add or remove a process definition using guvnor and
rebuild the package, the change does not automagically show up in the knowledgebase that
was created towards the end of the snippet above. With 'newInstance' set to false
I was hoping this would happne automatically (and also the ksessions created off of this
knowledgebase will get updated as well).
Is this expected behavior or am I missing something?
Thanks!
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/726466#726466]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]