Hi,
Are you setting drools.agent.newInstance to false? If not, when the kbase is rebuild, a new instance is created, so the kbase variable you have  "outside" the agent is obsolete. You need to use kagent.getKnowledgeBase().  

Best,

On Wed, May 26, 2010 at 4:58 AM, Mohamed BEN AYED <mohamed.ensi@gmail.com> wrote:

Hi,

I started ResourceFactory (Listener & Notifier)

when I look to the parameters of KnowledgeAgent, I foun 3: (name,
KnowledgeBase, KnowledgeAgentConfiguration). this is fine.

Normally, when I give a KnowledgeBase to th KnowledgeAgent, it will save the
knowledgeBAse built from KnowledgeAgent to the KnowledgeBases given in
parameter.

I give an example:
 KnowledgeBase kbase=KnowledgeBaseFactory.newKnowledgeBase(); //here I
instanciate a KnowledgeBase

KnowledgeAgent  agent =
KnowledgeAgentFactory.newKnowledgeAgent("myagent",kbase,aconf); // My
KnowledgeBase was given as a parameter

StatefulKnowledgeSession session =kbase.newStatefulKnowledgeSession(); // I
will create a session from the Kbase.

the problem is the KnowledgeBAse is empty, I doesn't contain the base built

I hope you understand the problem

--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/KnowledgeBaseEvent-on-KnowledgeAgent-tp842269p844280.html
Sent from the Drools - Dev mailing list archive at Nabble.com.
_______________________________________________
rules-dev mailing list
rules-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev



--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti