[jboss-user] [jBPM] - Automatically updating knowledgebase & sessions with new process definitions

Affan Dar do-not-reply at jboss.com
Mon Mar 26 17:28:45 EDT 2012


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/defaultPackage/LATEST/ChangeSet.xml http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defaultPackage/LATEST/ChangeSet.xml"));

                              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&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120326/ade22153/attachment-0001.html 


More information about the jboss-user mailing list