tkobayas commented on issue #6269: URL: https://github.com/apache/incubator-kie-drools/issues/6269#issuecomment-2693791974
A. During the build, firstly, it goes through `CompositeKnowledgeBuilderImpl.buildProcesses. ClassTypeResolver` is created for the bpmn process. The `ClassTypeResolver` has only one import for `com.sample.*` as its own package (plus some default imports). The `ClassTypeResolver` is owned by `MVELKnowledgePackageImpl` for `com.sample`. The `MVELKnowledgePackageImpl` is wrapped by `PackageRegistry` and enlisted in `PackageRegistryManagerImpl.pkgRegistryMap`. B. Then, it goes through `ModelBuilderImpl.doSecondBuildStep`. In `DeclaredTypeCompilationPhase.process` -> `IteratingPhase.process` -> `pkgRegistryManager.getOrCreatePackageRegistry`, it picks up the `PackageRegistry` which doesn't contain import `com.sample.DroolsTest.Message`, hence results in the issue. If the project doesn't have a bpmn file, Step A doesn't happen, so Step B creates `PackageRegistry` for `com.sample` for the first time. It uses a `packageDescr` of the drl file, so import `com.sample.DroolsTest.Message` is properly added. Probably a fix would be to merge the package information of processes and rules in the Step B. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
