[rules-dev] JBRULES-3143: Knowledge Agent does not handle multiple packages in Builder output from single resource

Wolfgang Laun wolfgang.laun at gmail.com
Sat Jul 16 11:14:58 EDT 2011


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.

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.

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.

*But many incremental builds (property drools.agent.newInstance set to
false) fail nevertheless.*

There is no way this can be fixed in KAagent alone, if at all. KAagent's
capability of doing incremental build was based on certain (shaky)
assumptions originally, and the aforementioned change to the PBuilder has
added new catches.

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'm not sure whether this is really necessary, but type
handling (TypeDeclarationDescr) would have to be modified.

Cheers
Wolfgang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20110716/5912973d/attachment.html 


More information about the rules-dev mailing list