Hi Ben, The kbase that is passed into KnowledgeAgentFactory.newKnowledgeAgent is used to configure the KnowledgeAgent that is created. The KnowledgeAgentFactory reads the current contents of the KnowledgeBase and the configuration of the KnowledgeBase and ensures that future KnowledgeBases are set up with the same configuration.
This is useful for setting properties that are specific to a KnowledgeBase which you can not set using the KnowledgeAgentConfiguration class. Please note the differences between the configuration options on the following 2 interfaces: http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/apidocs/org/drools/KnowledgeBaseConfiguration.html http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/apidocs/org/drools/agent/KnowledgeAgentConfiguration.html I believe the reason why your rules are not executing when you get a session from the kbase that you provided to the KnowledgeAgentFactory is because the kbase provided to the KnowledgeAgentFactory is not modified when the agent is built. Once the agent is built you should use agent.getKnowledgeBase().newStatefulKnowledgeSession() You can read more about how to configure KnowledgeAgents in the documentation section 3.2.6: http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-expert/html/ch03.html#d0e1123 The details I mention above are in the text between Example 3.20 and Example 3.22. Hope this helps, Steve [email protected] wrote on 05/26/2010 10:26:17 AM: > From: > > Mohamed BEN AYED <[email protected]> > > To: > > [email protected] > > Date: > > 05/26/2010 10:28 AM > > Subject: > > Re: [rules-dev] KnowledgeBaseEvent on KnowledgeAgent > > Sent by: > > [email protected] > > > drools 5.0 > -- > View this message in context: http://drools-java-rules-engine. > 46999.n3.nabble.com/KnowledgeBaseEvent-on-KnowledgeAgent-tp842269p845146.html > Sent from the Drools - Dev mailing list archive at Nabble.com. > _______________________________________________ > rules-dev mailing list > [email protected] > https://lists.jboss.org/mailman/listinfo/rules-dev
_______________________________________________ rules-dev mailing list [email protected] https://lists.jboss.org/mailman/listinfo/rules-dev
