Collection<KnowledgePackage> kpkgs = SerializationHelper.serializeObject( kbuilder.getKnowledgePackages() );
kbase.addKnowledgePackages( kpkgs );
kbase = SerializationHelper.serializeObject( kbase );
Environment env = EnvironmentFactory.newEnvironment();
env.set( EnvironmentName.OBJECT_MARSHALLING_STRATEGIES, new ObjectMarshallingStrategy[]{
new IdentityPlaceholderResolverStrategy( ClassObjectMarshallingStrategyAcceptor.DEFAULT )} );
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession( null, env );
List results = new ArrayList();
ksession.setGlobal( "results",
results );