builder.getErrors().getErrors() );
final Package newPkg = SerializationHelper.serializeObject( pkg );
final Rule newRule = newPkg.getRule( "rule-1" );
final ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase();
// It's been serialised so we have to simulate the re-wiring process
newPkg.getDialectRuntimeRegistry().onAdd( ruleBase.getRootClassLoader() );
newPkg.getDialectRuntimeRegistry().onBeforeExecute();
ruleBase.getGlobals().put( "map",
Map.class );
final WorkingMemory workingMemory = ruleBase.newStatefulSession();
final HashMap map = new HashMap();
workingMemory.setGlobal( "map",
map );