// serialize session and rulebase out
ByteArrayOutputStream baos = new ByteArrayOutputStream();
StatefulKnowledgeSessionImpl ksession = new StatefulKnowledgeSessionImpl( (ReteooStatefulSession) session );
Marshaller marshaller = MarshallerFactory.newMarshaller( ksession.getKnowledgeBase() );
marshaller.marshall( baos,
ksession );
baos.close();
GlobalResolver resolver = session.getGlobalResolver();
byte[] serializedRulebase = DroolsStreamUtils.streamOut( ruleBase );