08-05-2014 05:45 AM
ProcessEngineConfiguration standAloneProcessConfig = (StandaloneProcessEngineConfiguration)ProcessEngineConfiguration
.createStandaloneProcessEngineConfiguration();
standAloneProcessConfig.setJdbcDriver(JDBC_DRIVER);
standAloneProcessConfig.setJdbcPassword(JDBC_PWD);
standAloneProcessConfig.setJdbcUrl(JDBC_URL);
standAloneProcessConfig.setJdbcUsername(JDBC_USERNAME);
standAloneProcessConfig.setDatabaseType(DB_TYPE);
standAloneProcessConfig.setDatabaseSchemaUpdate("true");
ProcessEngine processEngine = standAloneProcessConfig.buildProcessEngine();
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<property name="databaseType" value="mssql" />
<property name="databaseSchemaUpdate" value="true" />
<property name="jobExecutorActivate" value="true" />
<property name="enableDatabaseEventLogging" value="true" />
<property name="customFormTypes">
<list>
<bean class="org.activiti.explorer.form.UserFormType"/>
<bean class="org.activiti.explorer.form.ProcessDefinitionFormType"/>
<bean class="org.activiti.explorer.form.MonthFormType"/>
</list>
</property>
</bean>
protected void initIdGenerator() {
if (idGenerator==null) {
CommandExecutor idGeneratorCommandExecutor = null;
if (idGeneratorDataSource!=null) {
ProcessEngineConfigurationImpl processEngineConfiguration = new StandaloneProcessEngineConfiguration();
processEngineConfiguration.setDataSource(idGeneratorDataSource);
processEngineConfiguration.setDatabaseSchemaUpdate(DB_SCHEMA_UPDATE_FALSE);
processEngineConfiguration.init();
idGeneratorCommandExecutor = processEngineConfiguration.getCommandExecutor();
} else if (idGeneratorDataSourceJndiName!=null) {
ProcessEngineConfigurationImpl processEngineConfiguration = new StandaloneProcessEngineConfiguration();
processEngineConfiguration.setDataSourceJndiName(idGeneratorDataSourceJndiName);
processEngineConfiguration.setDatabaseSchemaUpdate(DB_SCHEMA_UPDATE_FALSE);
processEngineConfiguration.init();
idGeneratorCommandExecutor = processEngineConfiguration.getCommandExecutor();
} else {
idGeneratorCommandExecutor = getCommandExecutor();
}
08-06-2014 12:58 AM
# Is the above hard coding reason for database schema not getting createdNo, it should work exactly as it is described in the user guide. There should be another reason why DB tables are not created.
# Is this the intended behavior that we don't want the database creation to happen automatically when Process Engine is created by SpringYour code snippet is from Id generator init. By default it takes config from processEngineConfiguration.
protected String databaseSchemaUpdate = DB_SCHEMA_UPDATE_FALSE;
# Can we override this behaviorYes, you can override the behavior, but I think it make sense to keep it as it is.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.