提交 11774d22 编写于 作者: J Joram Barrez

Fixing some typo's + adding a 'createDbSqlSessionFactory' such that subclasses can easily extend

上级 6545434c
......@@ -33,10 +33,14 @@ public interface DelegateExecution extends VariableScope {
/** Reference to the overall process instance */
String getProcessInstanceId();
/**
* The 'root' process instance. When using call activity for example, the processInstance
* set will not always be the root. This method returns the topmost process instance.
*/
String getRootProcessInstanceId();
/**
* The {@link ExecutionListener#EVENTNAME_START event name} in case this execution is passed in for an {@link ExecutionListener}
* Will contain the event name in case this execution is passed in for an {@link ExecutionListener}.
*/
String getEventName();
......@@ -70,8 +74,14 @@ public interface DelegateExecution extends VariableScope {
*/
String getTenantId();
/**
* The BPMN element where the execution currently is at.
*/
FlowElement getCurrentFlowElement();
/**
* Change the current BPMN element the execution is at.
*/
void setCurrentFlowElement(FlowElement flowElement);
/* Execution management */
......
......@@ -74,7 +74,7 @@ public class ProcessEngineImpl implements ProcessEngine {
this.sessionFactories = processEngineConfiguration.getSessionFactories();
this.transactionContextFactory = processEngineConfiguration.getTransactionContextFactory();
if (processEngineConfiguration.isUsingRelationalDatabase()) {
if (processEngineConfiguration.isUsingRelationalDatabase() && processEngineConfiguration.getDatabaseSchemaUpdate() != null) {
commandExecutor.execute(processEngineConfiguration.getSchemaCommandConfig(), new SchemaOperationsProcessEngineBuild());
}
......
......@@ -902,9 +902,8 @@ public abstract class ProcessEngineConfigurationImpl extends ProcessEngineConfig
if (sqlSessionFactory == null) {
InputStream inputStream = null;
try {
inputStream = getMyBatisXmlConfigurationSteam();
inputStream = getMyBatisXmlConfigurationStream();
// update the jdbc parameters to the configured ones...
Environment environment = new Environment("default", transactionFactory, dataSource);
Reader reader = new InputStreamReader(inputStream);
Properties properties = new Properties();
......@@ -971,7 +970,7 @@ public abstract class ProcessEngineConfigurationImpl extends ProcessEngineConfig
return ReflectUtil.getResourceAsStream(resource);
}
protected InputStream getMyBatisXmlConfigurationSteam() {
protected InputStream getMyBatisXmlConfigurationStream() {
return getResourceAsStream(DEFAULT_MYBATIS_MAPPING_FILE);
}
......@@ -1065,21 +1064,7 @@ public abstract class ProcessEngineConfigurationImpl extends ProcessEngineConfig
sessionFactories = new HashMap<Class<?>, SessionFactory>();
if (usingRelationalDatabase) {
if (dbSqlSessionFactory == null) {
dbSqlSessionFactory = new DbSqlSessionFactory();
}
dbSqlSessionFactory.setDatabaseType(databaseType);
dbSqlSessionFactory.setIdGenerator(idGenerator);
dbSqlSessionFactory.setSqlSessionFactory(sqlSessionFactory);
dbSqlSessionFactory.setDbIdentityUsed(isDbIdentityUsed);
dbSqlSessionFactory.setDbHistoryUsed(isDbHistoryUsed);
dbSqlSessionFactory.setDatabaseTablePrefix(databaseTablePrefix);
dbSqlSessionFactory.setTablePrefixIsSchema(tablePrefixIsSchema);
dbSqlSessionFactory.setDatabaseCatalog(databaseCatalog);
dbSqlSessionFactory.setDatabaseSchema(databaseSchema);
dbSqlSessionFactory.setBulkInsertEnabled(isBulkInsertEnabled, databaseType);
dbSqlSessionFactory.setMaxNrOfStatementsInBulkInsert(maxNrOfStatementsInBulkInsert);
addSessionFactory(dbSqlSessionFactory);
initDbSqlSessionFactory();
}
addSessionFactory(new GenericManagerFactory(EntityCache.class, EntityCacheImpl.class));
......@@ -1092,6 +1077,28 @@ public abstract class ProcessEngineConfigurationImpl extends ProcessEngineConfig
}
}
protected void initDbSqlSessionFactory() {
if (dbSqlSessionFactory == null) {
dbSqlSessionFactory = createDbSqlSessionFactory();
}
dbSqlSessionFactory.setDatabaseType(databaseType);
dbSqlSessionFactory.setIdGenerator(idGenerator);
dbSqlSessionFactory.setSqlSessionFactory(sqlSessionFactory);
dbSqlSessionFactory.setDbIdentityUsed(isDbIdentityUsed);
dbSqlSessionFactory.setDbHistoryUsed(isDbHistoryUsed);
dbSqlSessionFactory.setDatabaseTablePrefix(databaseTablePrefix);
dbSqlSessionFactory.setTablePrefixIsSchema(tablePrefixIsSchema);
dbSqlSessionFactory.setDatabaseCatalog(databaseCatalog);
dbSqlSessionFactory.setDatabaseSchema(databaseSchema);
dbSqlSessionFactory.setBulkInsertEnabled(isBulkInsertEnabled, databaseType);
dbSqlSessionFactory.setMaxNrOfStatementsInBulkInsert(maxNrOfStatementsInBulkInsert);
addSessionFactory(dbSqlSessionFactory);
}
protected DbSqlSessionFactory createDbSqlSessionFactory() {
return new DbSqlSessionFactory();
}
protected void addSessionFactory(SessionFactory sessionFactory) {
sessionFactories.put(sessionFactory.getSessionType(), sessionFactory);
}
......
......@@ -14,6 +14,7 @@ package org.activiti.engine.impl.db;
/**
* @author Tom Baeyens
* @author Joram Barrez
*/
public interface Entity {
......
......@@ -17,7 +17,6 @@ import java.util.Date;
import java.util.List;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.VariableScope;
import org.activiti.engine.impl.db.Entity;
import org.activiti.engine.impl.db.HasRevision;
import org.activiti.engine.runtime.Execution;
......@@ -31,7 +30,7 @@ import org.activiti.engine.runtime.ProcessInstance;
* @author Joram Barrez
*/
public interface ExecutionEntity extends VariableScope, DelegateExecution, Execution, ProcessInstance, Entity, HasRevision {
public interface ExecutionEntity extends DelegateExecution, Execution, ProcessInstance, Entity, HasRevision {
void setBusinessKey(String businessKey);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册