env = KnowledgeBaseFactory.newEnvironment();
emf = Persistence.createEntityManagerFactory( DROOLS_PERSISTENCE_UNIT_NAME );
env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );
env.set( EnvironmentName.TRANSACTION_MANAGER,
TransactionManagerServices.getTransactionManager() );
env.set( EnvironmentName.GLOBALS, new MapGlobalResolver() );
}