There is a known bug with incremental kbase changes (what happens when drools.agent.newInstance=false) and declared types. Sometime ago someone mentioned a possible workaround. Try to search in the mailing list.<div><br></div>

<div>Best Regards,     <br clear="all"><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>- Developer @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com </a><br>- Blog @ <a href="http://ilesteban.wordpress.com" target="_blank">http://ilesteban.wordpress.com</a><br>


<br><br><div class="gmail_quote">On Tue, Feb 21, 2012 at 12:25 PM, Juanker Atina <span dir="ltr">&lt;<a href="mailto:juankera@gmail.com">juankera@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<span>Hi there,<br><br>I want to work with declared facts, inside drl file, but when i set </span><span><span>drools</span>.agent.newInstance property to false, it seems that drools won&#39;t work with this specific fact.<br>


<br><br>My code stops working when i put this two lines, <br><br></span><span>KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
</span><br><span>aconf.setProperty(&quot;<span>drools</span>.agent.newInstance&quot;, &quot;false&quot;);
</span><br><br><span>And it works fine when i remove these lines.</span><br><br><span><br>So, I&#39;ve read that this property is related to new instances of KnowledgeBase when resources changes... 
</span><br><br><span>c&amp;p from: </span><a href="http://grepcode.com/file/repository.jboss.org/maven2/org.drools/drools-api/5.0.0.M4/org/drools/agent/KnowledgeAgentFactory.java" rel="nofollow" target="_blank"><span>http://grepcode.com/file/repository.jboss.org/maven2/org.<span>drools</span>/<span>drools</span>-api/5.0.0.M4/org/<span>drools</span>/agent/KnowledgeAgentFactory.java</span></a><br>


<br><i><span>aconf.setProperty( &quot;<span>drools</span>.agent.newInstance&quot;,
</span><br><span>                          &quot;true&quot; ); // resource changes results in a new instance of the KnowledgeBase being built, 
</span><br><span>                                    // this cannot currently be set to false for incremental building</span></i><br><br><span>Hence, why is this property changing the behaviour of the rules?<br><br>(See this thread too,</span><span><a href="http://drools.46999.n3.nabble.com/rules-users-Truth-maintenance-and-RHS-variables-tt3722632.html#a3731857" target="_blank">http://drools.46999.n3.nabble.com/rules-users-Truth-maintenance-and-RHS-variables-tt3722632.html#a3731857</a>)</span>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br></div>