[rules-dev] KnowledgeBaseEvent on KnowledgeAgent

Esteban Aliverti esteban.aliverti at gmail.com
Wed May 26 08:36:46 EDT 2010


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 at 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 at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>



-- 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20100526/59dc4c3d/attachment-0001.html 


More information about the rules-dev mailing list