Package org.activiti.engine
Class ProcessEngineConfiguration
java.lang.Object
org.activiti.engine.ProcessEngineConfiguration
- Direct Known Subclasses:
ProcessEngineConfigurationImpl
Configuration information from which a process engine can be build.
Most common is to create a process engine based on the default configuration file:
ProcessEngine processEngine = ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault().buildProcessEngine();
To create a process engine programmatic, without a configuration file, the first option is createStandaloneProcessEngineConfiguration()
ProcessEngine processEngine = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration().buildProcessEngine();This creates a new process engine with all the defaults to connect to a remote h2 database (jdbc:h2:tcp://localhost/activiti) in standalone mode. Standalone mode means that Activiti will manage the transactions on the JDBC connections that it creates. One transaction per service method. For a description of how to write the configuration files, see the userguide.
The second option is great for testing:
invalid reference
#createStandalonInMemeProcessEngineConfiguration()
ProcessEngine processEngine = ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration().buildProcessEngine();This creates a new process engine with all the defaults to connect to an memory h2 database (jdbc:h2:tcp://localhost/activiti) in standalone mode. The DB schema strategy default is in this case
create-drop. Standalone mode means that Activiti will manage the transactions on the JDBC connections that it creates. One transaction per service method.
On all forms of creating a process engine, you can first customize the configuration before calling the buildProcessEngine() method by calling any of the setters like this:
ProcessEngine processEngine = ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault().setMailServerHost("gmail.com").setJdbcUsername("mickey").setJdbcPassword("mouse")
.buildProcessEngine();
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AsyncExecutorprotected booleanprotected intdefine the default wait time for a failed async job in secondsprotected ClassLoaderprotected Clockprotected booleanprotected Stringdatabase catalog to useprotected StringIn some situations you want to set the schema to use for table checks / generation if the database metadata doesn't return that correctly, see https://jira.codehaus.org/browse/ACT-1220, https://jira.codehaus.org/browse/ACT-1062protected Stringprotected StringAllows configuring a database table prefix which is used for all runtime operations of the process engine.protected Stringprotected StringEscape character for doing wildcard searches.protected DataSourceprotected Stringstatic final StringCreates the schema when the process engine is being created and drops the schema when the process engine is being closed.static final StringChecks the version of the DB schema against the library when the process engine is being created and throws an exception if the versions don't match.static final StringUpon building of the process engine, a check is performed and an update of the schema is performed if it is necessary.protected Stringprotected intdefine the default wait time for a failed job in secondsprotected booleanprotected booleanprotected ActivitiEngineAgendaFactoryprotected Stringprotected HistoryLevelprotected intprotected booleanprotected intprotected Stringprotected intprotected intprotected intprotected intprotected Stringprotected intprotected booleanprotected Stringprotected Stringprotected Stringprotected booleanprotected Objectprotected booleanprotected Stringprotected intDefine the default lock time for an async job in seconds.protected Stringprotected Stringprotected Stringprotected intprotected Map<String, MailServerInfo> protected Stringprotected Stringstatic final StringThe tenant id indicating 'no tenant'protected ProcessEngineLifecycleListenerprotected Stringprotected booleanSet to true in case the defined databaseTablePrefix is a schema-name, instead of an actual table name prefix.protected booleanprotected booleanEither use Class.forName or ClassLoader.loadClass for class loading.protected booleanprotected booleanprotected String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotecteduse one of the static createXxxx methods instead -
Method Summary
Modifier and TypeMethodDescriptionabstract ProcessEnginestatic ProcessEngineConfigurationstatic ProcessEngineConfigurationcreateProcessEngineConfigurationFromInputStream(InputStream inputStream, String beanName) static ProcessEngineConfigurationstatic ProcessEngineConfigurationcreateProcessEngineConfigurationFromResource(String resource, String beanName) static ProcessEngineConfigurationstatic ProcessEngineConfigurationstatic ProcessEngineConfigurationintgetClock()intabstract HistoryServiceintabstract IntegrationContextManagerabstract IntegrationContextServiceintintintintintintintgetMailServer(String tenantId) intbooleanbooleangetMailSessionJndi(String tenantId) abstract ManagementServiceabstract ProcessEngineConfigurationabstract RepositoryServiceabstract RuntimeServiceabstract TaskServiceabstract org.activiti.api.runtime.shared.identity.UserGroupManagerbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleansetAsyncExecutor(AsyncExecutor asyncExecutor) setAsyncExecutorActivate(boolean asyncExecutorActivate) setAsyncFailedJobWaitTime(int asyncFailedJobWaitTime) setClassLoader(ClassLoader classLoader) setCopyVariablesToLocalForTasks(boolean copyVariablesToLocalForTasks) setDatabaseCatalog(String databaseCatalog) setDatabaseSchema(String databaseSchema) setDatabaseSchemaUpdate(String databaseSchemaUpdate) setDatabaseTablePrefix(String databaseTablePrefix) setDatabaseType(String databaseType) setDatabaseWildcardEscapeCharacter(String databaseWildcardEscapeCharacter) setDataSource(DataSource dataSource) setDataSourceJndiName(String dataSourceJndiName) setDbHistoryUsed(boolean isDbHistoryUsed) setDefaultCamelContext(String defaultCamelContext) setDefaultFailedJobWaitTime(int defaultFailedJobWaitTime) setDisableExistingStartEventSubscriptions(boolean disableAllPreviousStartEvents) setEnableProcessDefinitionInfoCache(boolean enableProcessDefinitionInfoCache) voidsetEngineAgendaFactory(ActivitiEngineAgendaFactory engineAgendaFactory) setHistory(String history) setHistoryLevel(HistoryLevel historyLevel) setIdBlockSize(int idBlockSize) setJdbcDefaultTransactionIsolationLevel(int jdbcDefaultTransactionIsolationLevel) setJdbcDriver(String jdbcDriver) setJdbcMaxActiveConnections(int jdbcMaxActiveConnections) setJdbcMaxCheckoutTime(int jdbcMaxCheckoutTime) setJdbcMaxIdleConnections(int jdbcMaxIdleConnections) setJdbcMaxWaitTime(int jdbcMaxWaitTime) setJdbcPassword(String jdbcPassword) setJdbcPingConnectionNotUsedFor(int jdbcPingNotUsedFor) setJdbcPingEnabled(boolean jdbcPingEnabled) setJdbcPingQuery(String jdbcPingQuery) setJdbcUrl(String jdbcUrl) setJdbcUsername(String jdbcUsername) setJpaCloseEntityManager(boolean jpaCloseEntityManager) setJpaEntityManagerFactory(Object jpaEntityManagerFactory) setJpaHandleTransaction(boolean jpaHandleTransaction) setJpaPersistenceUnitName(String jpaPersistenceUnitName) setLockTimeAsyncJobWaitTime(int lockTimeAsyncJobWaitTime) setMailServerDefaultFrom(String mailServerDefaultFrom) setMailServerHost(String mailServerHost) setMailServerPassword(String mailServerPassword) setMailServerPort(int mailServerPort) setMailServers(Map<String, MailServerInfo> mailServers) setMailServerUsername(String mailServerUsername) setMailServerUseSSL(boolean useSSL) setMailServerUseTLS(boolean useTLS) setMailSessionJndi(String mailSessionJndi) setMailSessionsJndi(Map<String, String> mailSessionsJndi) setProcessEngineLifecycleListener(ProcessEngineLifecycleListener processEngineLifecycleListener) setProcessEngineName(String processEngineName) setTablePrefixIsSchema(boolean tablePrefixIsSchema) setTransactionsExternallyManaged(boolean transactionsExternallyManaged) setUseClassForNameClassLoading(boolean useClassForNameClassLoading) setXmlEncoding(String xmlEncoding) boolean
-
Field Details
-
DB_SCHEMA_UPDATE_FALSE
Checks the version of the DB schema against the library when the process engine is being created and throws an exception if the versions don't match.- See Also:
-
DB_SCHEMA_UPDATE_CREATE_DROP
Creates the schema when the process engine is being created and drops the schema when the process engine is being closed.- See Also:
-
DB_SCHEMA_UPDATE_TRUE
Upon building of the process engine, a check is performed and an update of the schema is performed if it is necessary.- See Also:
-
NO_TENANT_ID
The tenant id indicating 'no tenant'- See Also:
-
processEngineName
-
idBlockSize
protected int idBlockSize -
history
-
asyncExecutorActivate
protected boolean asyncExecutorActivate -
mailServerHost
-
mailServerUsername
-
mailServerPassword
-
mailServerPort
protected int mailServerPort -
useSSL
protected boolean useSSL -
useTLS
protected boolean useTLS -
mailServerDefaultFrom
-
mailSessionJndi
-
mailServers
-
mailSessionsJndi
-
databaseType
-
databaseSchemaUpdate
-
jdbcDriver
-
jdbcUrl
-
jdbcUsername
-
jdbcPassword
-
dataSourceJndiName
-
isDbHistoryUsed
protected boolean isDbHistoryUsed -
historyLevel
-
jdbcMaxActiveConnections
protected int jdbcMaxActiveConnections -
jdbcMaxIdleConnections
protected int jdbcMaxIdleConnections -
jdbcMaxCheckoutTime
protected int jdbcMaxCheckoutTime -
jdbcMaxWaitTime
protected int jdbcMaxWaitTime -
jdbcPingEnabled
protected boolean jdbcPingEnabled -
jdbcPingQuery
-
jdbcPingConnectionNotUsedFor
protected int jdbcPingConnectionNotUsedFor -
jdbcDefaultTransactionIsolationLevel
protected int jdbcDefaultTransactionIsolationLevel -
dataSource
-
transactionsExternallyManaged
protected boolean transactionsExternallyManaged -
jpaPersistenceUnitName
-
jpaEntityManagerFactory
-
jpaHandleTransaction
protected boolean jpaHandleTransaction -
jpaCloseEntityManager
protected boolean jpaCloseEntityManager -
clock
-
asyncExecutor
-
disableExistingStartEventSubscriptions
protected boolean disableExistingStartEventSubscriptions -
lockTimeAsyncJobWaitTime
protected int lockTimeAsyncJobWaitTimeDefine the default lock time for an async job in seconds. The lock time is used when creating an async job and when it expires the async executor assumes that the job has failed. It will be retried again. -
defaultFailedJobWaitTime
protected int defaultFailedJobWaitTimedefine the default wait time for a failed job in seconds -
asyncFailedJobWaitTime
protected int asyncFailedJobWaitTimedefine the default wait time for a failed async job in seconds -
databaseTablePrefix
Allows configuring a database table prefix which is used for all runtime operations of the process engine. For example, if you specify a prefix named 'PRE1.', activiti will query for executions in a table named 'PRE1.ACT_RU_EXECUTION_'. NOTE: the prefix is not respected by automatic database schema management. If you useDB_SCHEMA_UPDATE_CREATE_DROPorDB_SCHEMA_UPDATE_TRUE, activiti will create the database tables using the default names, regardless of the prefix configured here.- Since:
- 5.9
-
databaseWildcardEscapeCharacter
Escape character for doing wildcard searches. This will be added at then end of queries that include for example a LIKE clause. For example: SELECT * FROM table WHERE column LIKE '%\%%' ESCAPE '\'; -
databaseCatalog
database catalog to use -
databaseSchema
In some situations you want to set the schema to use for table checks / generation if the database metadata doesn't return that correctly, see https://jira.codehaus.org/browse/ACT-1220, https://jira.codehaus.org/browse/ACT-1062 -
tablePrefixIsSchema
protected boolean tablePrefixIsSchemaSet to true in case the defined databaseTablePrefix is a schema-name, instead of an actual table name prefix. This is relevant for checking if Activiti-tables exist, the databaseTablePrefix will not be used here - since the schema is taken into account already, adding a prefix for the table-check will result in wrong table-names.- Since:
- 5.15
-
xmlEncoding
-
defaultCamelContext
-
classLoader
-
useClassForNameClassLoading
protected boolean useClassForNameClassLoadingEither use Class.forName or ClassLoader.loadClass for class loading. See http://forums.activiti.org/content/reflectutilloadclass-and-custom- classloader -
processEngineLifecycleListener
-
enableProcessDefinitionInfoCache
protected boolean enableProcessDefinitionInfoCache -
engineAgendaFactory
-
copyVariablesToLocalForTasks
protected boolean copyVariablesToLocalForTasks
-
-
Constructor Details
-
ProcessEngineConfiguration
protected ProcessEngineConfiguration()use one of the static createXxxx methods instead
-
-
Method Details
-
buildProcessEngine
-
createProcessEngineConfigurationFromResourceDefault
-
createProcessEngineConfigurationFromResource
public static ProcessEngineConfiguration createProcessEngineConfigurationFromResource(String resource) -
createProcessEngineConfigurationFromResource
public static ProcessEngineConfiguration createProcessEngineConfigurationFromResource(String resource, String beanName) -
createProcessEngineConfigurationFromInputStream
public static ProcessEngineConfiguration createProcessEngineConfigurationFromInputStream(InputStream inputStream) -
createProcessEngineConfigurationFromInputStream
public static ProcessEngineConfiguration createProcessEngineConfigurationFromInputStream(InputStream inputStream, String beanName) -
createStandaloneProcessEngineConfiguration
-
createStandaloneInMemProcessEngineConfiguration
-
getRepositoryService
-
getRuntimeService
-
getTaskService
-
getHistoryService
-
getManagementService
-
getProcessEngineConfiguration
-
getUserGroupManager
public abstract org.activiti.api.runtime.shared.identity.UserGroupManager getUserGroupManager() -
getIntegrationContextService
-
getIntegrationContextManager
-
getProcessEngineName
-
setProcessEngineName
-
getIdBlockSize
public int getIdBlockSize() -
setIdBlockSize
-
getHistory
-
setHistory
-
getMailServerHost
-
setMailServerHost
-
getMailServerUsername
-
setMailServerUsername
-
getMailServerPassword
-
setMailServerPassword
-
getMailSessionJndi
-
setMailSessionJndi
-
getMailServerPort
public int getMailServerPort() -
setMailServerPort
-
getMailServerUseSSL
public boolean getMailServerUseSSL() -
setMailServerUseSSL
-
getMailServerUseTLS
public boolean getMailServerUseTLS() -
setMailServerUseTLS
-
getMailServerDefaultFrom
-
setMailServerDefaultFrom
-
getMailServer
-
getMailServers
-
setMailServers
-
getMailSessionJndi
-
getMailSessionsJndi
-
setMailSessionsJndi
-
getDatabaseType
-
setDatabaseType
-
getDatabaseSchemaUpdate
-
setDatabaseSchemaUpdate
-
getDataSource
-
setDataSource
-
getJdbcDriver
-
setJdbcDriver
-
getJdbcUrl
-
setJdbcUrl
-
getJdbcUsername
-
setJdbcUsername
-
getJdbcPassword
-
setJdbcPassword
-
isTransactionsExternallyManaged
public boolean isTransactionsExternallyManaged() -
setTransactionsExternallyManaged
public ProcessEngineConfiguration setTransactionsExternallyManaged(boolean transactionsExternallyManaged) -
setDisableExistingStartEventSubscriptions
public ProcessEngineConfiguration setDisableExistingStartEventSubscriptions(boolean disableAllPreviousStartEvents) -
shouldDisableExistingStartEventSubscriptions
public boolean shouldDisableExistingStartEventSubscriptions() -
getHistoryLevel
-
setHistoryLevel
-
isDbHistoryUsed
public boolean isDbHistoryUsed() -
setDbHistoryUsed
-
getJdbcMaxActiveConnections
public int getJdbcMaxActiveConnections() -
setJdbcMaxActiveConnections
-
getJdbcMaxIdleConnections
public int getJdbcMaxIdleConnections() -
setJdbcMaxIdleConnections
-
getJdbcMaxCheckoutTime
public int getJdbcMaxCheckoutTime() -
setJdbcMaxCheckoutTime
-
getJdbcMaxWaitTime
public int getJdbcMaxWaitTime() -
setJdbcMaxWaitTime
-
isJdbcPingEnabled
public boolean isJdbcPingEnabled() -
setJdbcPingEnabled
-
getJdbcPingQuery
-
setJdbcPingQuery
-
getJdbcPingConnectionNotUsedFor
public int getJdbcPingConnectionNotUsedFor() -
setJdbcPingConnectionNotUsedFor
-
getJdbcDefaultTransactionIsolationLevel
public int getJdbcDefaultTransactionIsolationLevel() -
setJdbcDefaultTransactionIsolationLevel
public ProcessEngineConfiguration setJdbcDefaultTransactionIsolationLevel(int jdbcDefaultTransactionIsolationLevel) -
isAsyncExecutorActivate
public boolean isAsyncExecutorActivate() -
setAsyncExecutorActivate
-
getClassLoader
-
setClassLoader
-
isUseClassForNameClassLoading
public boolean isUseClassForNameClassLoading() -
setUseClassForNameClassLoading
public ProcessEngineConfiguration setUseClassForNameClassLoading(boolean useClassForNameClassLoading) -
getJpaEntityManagerFactory
-
setJpaEntityManagerFactory
-
isJpaHandleTransaction
public boolean isJpaHandleTransaction() -
setJpaHandleTransaction
-
isJpaCloseEntityManager
public boolean isJpaCloseEntityManager() -
setJpaCloseEntityManager
-
getJpaPersistenceUnitName
-
setJpaPersistenceUnitName
-
getDataSourceJndiName
-
setDataSourceJndiName
-
getDefaultCamelContext
-
setDefaultCamelContext
-
setProcessEngineLifecycleListener
public ProcessEngineConfiguration setProcessEngineLifecycleListener(ProcessEngineLifecycleListener processEngineLifecycleListener) -
getProcessEngineLifecycleListener
-
getDatabaseTablePrefix
-
setDatabaseTablePrefix
-
setTablePrefixIsSchema
-
isTablePrefixIsSchema
public boolean isTablePrefixIsSchema() -
getDatabaseWildcardEscapeCharacter
-
setDatabaseWildcardEscapeCharacter
public ProcessEngineConfiguration setDatabaseWildcardEscapeCharacter(String databaseWildcardEscapeCharacter) -
getDatabaseCatalog
-
setDatabaseCatalog
-
getDatabaseSchema
-
setDatabaseSchema
-
getXmlEncoding
-
setXmlEncoding
-
getClock
-
setClock
-
getAsyncExecutor
-
setAsyncExecutor
-
getLockTimeAsyncJobWaitTime
public int getLockTimeAsyncJobWaitTime() -
setLockTimeAsyncJobWaitTime
-
getDefaultFailedJobWaitTime
public int getDefaultFailedJobWaitTime() -
setDefaultFailedJobWaitTime
-
getAsyncFailedJobWaitTime
public int getAsyncFailedJobWaitTime() -
setAsyncFailedJobWaitTime
-
isEnableProcessDefinitionInfoCache
public boolean isEnableProcessDefinitionInfoCache() -
setEnableProcessDefinitionInfoCache
public ProcessEngineConfiguration setEnableProcessDefinitionInfoCache(boolean enableProcessDefinitionInfoCache) -
setCopyVariablesToLocalForTasks
public ProcessEngineConfiguration setCopyVariablesToLocalForTasks(boolean copyVariablesToLocalForTasks) -
isCopyVariablesToLocalForTasks
public boolean isCopyVariablesToLocalForTasks() -
setEngineAgendaFactory
-
getEngineAgendaFactory
-