Source:
<code>public static StatefulKnowledgeSession newStatefulKnowledgeSession(KieBase kbase) { RuntimeEnvironmentBuilder builder = null; if ( usePersistence ) { Properties properties = new Properties(); properties.put("driverClassName", "org.h2.Driver"); properties.put("className", "org.h2.jdbcx.JdbcDataSource"); properties.put("user", "sa"); properties.put("password", ""); properties.put("url", "jdbc:h2:tcp://localhost/~/jbpm-db"); properties.put("datasourceName", "jdbc/jbpm-ds"); PersistenceUtil.setupPoolingDataSource(properties); Map<String, String> map = new HashMap<String, String>(); map.put("hibernate.dialect", "org.hibernate.dialect.H2Dialect"); EntityManagerFactory emf = Persistence.createEntityManagerFactory(properties.getProperty("persistence.persistenceunit.name", "org.jbpm.persistence.jpa"), map); builder = RuntimeEnvironmentBuilder.Factory.get() .newDefaultBuilder() .entityManagerFactory(emf) .addEnvironmentEntry(EnvironmentName.TRANSACTION_MANAGER, com.arjuna.ats.jta.TransactionManager.transactionManager()); } else { builder = RuntimeEnvironmentBuilder.Factory.get() .newDefaultInMemoryBuilder(); } <START> builder.knowledgeBase(kbase); <END> RuntimeManager manager = RuntimeManagerFactory.Factory.get().newSingletonRuntimeManager(builder.get()); return (StatefulKnowledgeSession) manager.getRuntimeEngine(EmptyContext.get()).getKieSession(); }</code><technical_language>I in droolsjbpm-tools DeploymentDescriptor descriptor = new DeploymentDescriptorManager().getDefaultDescriptor().getBuilder().auditMode(AuditMode.NONE).get(); builder.addEnvironmentEntry("KieDeploymentDescriptor", descriptor); is triggered if usePersistence == false, this is true. I reckon is for users manually change in code. needs added well</technical_language>

Target:
public static StatefulKnowledgeSession newStatefulKnowledgeSession(KieBase kbase) { RuntimeEnvironmentBuilder builder = null; if ( usePersistence ) { Properties properties = new Properties(); properties.put("driverClassName", "org.h2.Driver"); properties.put("className", "org.h2.jdbcx.JdbcDataSource"); properties.put("user", "sa"); properties.put("password", ""); properties.put("url", "jdbc:h2:tcp://localhost/~/jbpm-db"); properties.put("datasourceName", "jdbc/jbpm-ds"); PersistenceUtil.setupPoolingDataSource(properties); Map<String, String> map = new HashMap<String, String>(); map.put("hibernate.dialect", "org.hibernate.dialect.H2Dialect"); EntityManagerFactory emf = Persistence.createEntityManagerFactory(properties.getProperty("persistence.persistenceunit.name", "org.jbpm.persistence.jpa"), map); builder = RuntimeEnvironmentBuilder.Factory.get() .newDefaultBuilder() .entityManagerFactory(emf); } else { builder = RuntimeEnvironmentBuilder.Factory.get() .newDefaultInMemoryBuilder(); DeploymentDescriptor descriptor = new DeploymentDescriptorManager().getDefaultDescriptor().getBuilder().auditMode(AuditMode.NONE).get(); builder.addEnvironmentEntry("KieDeploymentDescriptor", descriptor); } builder.knowledgeBase(kbase); RuntimeManager manager = RuntimeManagerFactory.Factory.get().newSingletonRuntimeManager(builder.get()); return (StatefulKnowledgeSession) manager.getRuntimeEngine(EmptyContext.get()).getKieSession(); }