Currently the KnowledgeAgent produces an incomplete KnowledgeBase even during the first build from some change set if some resource results in more than one KnowledgePackage object being produced by the PackageBuilder.<br>

<br>I think that the production of more than one KPackage from a single resource by the KBuilder is due to certain type references such as an import plus use in a declare for adding annotations or for permitting a declare/extend of a pojo.<br>

<br>Handling more than one KP as the result of compiling a single resource is not too difficult for the KAgent; an experimental patch has indeed verified that the problem exhibited by JBRULES-3143 can be fixed. All builds for a KAgent configured with property drools.agent.newInstance set to true succeed.<br>

<br><b>But many incremental builds (property drools.agent.newInstance set to false) fail nevertheless.</b><br><br>There is no way this can be fixed in KAagent alone, if at all. KAagent&#39;s capability of doing incremental build was based on certain (shaky) assumptions originally, and the aforementioned change to the PBuilder has added new catches.<br>
<br>That the PBuilder produces more than one KPackage is due to the code dealing with type declarations from a namespace different from the one of the hosting package. I&#39;m not sure whether this is really necessary, but type handling (TypeDeclarationDescr) would have to be modified.<br>
<br>Cheers<br>Wolfgang<br><br><br><br>
<br><br><br><br><br>