KModuleCache.Builder _kmoduleCacheBuilder = createCacheBuilder();
CompilationData.Builder _compData = createCompilationData();
for ( KiePackage kPkg : kBuilder.getKnowledgePackages() ) {
PackageRegistry pkgRegistry = pkgRegistryMap.get( kPkg.getName() );
JavaDialectRuntimeData runtimeData = (JavaDialectRuntimeData) pkgRegistry.getDialectRuntimeRegistry().getDialectData( "java" );
List<String> types = new ArrayList<String>();
for ( FactType factType : kPkg.getFactTypes() ) {
Class< ? > typeClass = ((ClassDefinition) factType).getDefinedClass();
TypeDeclaration typeDeclaration = pkgRegistry.getPackage().getTypeDeclaration( typeClass );
if ( typeDeclaration != null ) {
typeDeclarations.put( typeClass.getName(), typeDeclaration );
}
String className = factType.getName();
String internalName = className.replace('.', '/') + ".class";
byte[] bytes = runtimeData.getBytecode(internalName);
trgMfs.write( internalName, bytes, true );
types.add( internalName );
}
addToCompilationData( _compData, runtimeData, types );