Someone mentioned me the problem some time ago. I have a fix for it in my local repo, butI was waiting for the trunk to be stable to test it.
Hi all,I am trying to use a Knowledge Agent in 5.1.1 with a change set with a few different packages and resource types in it, and I am running into a problem where it is not adding all the packages. Looking at the code I can see that KnowledegeAgentImpl.createPackageFromResource has the following code when it loads a resource:if (kbuilder.getKnowledgePackages().iterator().hasNext()) {
return (KnowledgePackageImp) kbuilder.getKnowledgePackages().iterator().next();
}
and KnowledgeBuilderImpl.getKnowledgePackages does the following:
Package[] pkgs = pkgBuilder.getPackages();
List<KnowledgePackage> list = new ArrayList<KnowledgePackage>( pkgs.length );
and PackageBuilder.getPackages does the following:
for ( PackageRegistry pkgRegistry : this.pkgRegistryMap.values() ) {
Package pkg = pkgRegistry.getPackage();
// add package to array
}
pkgRegistryMap is implemented as a HashMap however so the order the packages are returned in is not guaranteed. I seem to be hitting this problem.This is a hard one to create a unit test for so I wanted to check that my analysis is correct before raising a bug. Perhaps using a LinkedHashMap or similar would fix it?thanksSteve
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users