Package org.activiti.engine
Class ProcessEngineConfiguration
- java.lang.Object
-
- org.activiti.engine.ProcessEngineConfiguration
-
- Direct Known Subclasses:
ProcessEngineConfigurationImpl
public abstract class ProcessEngineConfiguration extends Object
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:
#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 casecreate-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:
ProcessEngines
-
-
Field Summary
Fields Modifier and Type Field Description protected AsyncExecutorasyncExecutorprotected booleanasyncExecutorActivateprotected intasyncFailedJobWaitTimedefine the default wait time for a failed async job in secondsprotected ClassLoaderclassLoaderprotected Clockclockprotected booleancopyVariablesToLocalForTasksprotected StringdatabaseCatalogdatabase catalog to useprotected StringdatabaseSchemaIn 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 StringdatabaseSchemaUpdateprotected StringdatabaseTablePrefixAllows configuring a database table prefix which is used for all runtime operations of the process engine.protected StringdatabaseTypeprotected StringdatabaseWildcardEscapeCharacterEscape character for doing wildcard searches.protected DataSourcedataSourceprotected StringdataSourceJndiNamestatic StringDB_SCHEMA_UPDATE_CREATE_DROPCreates the schema when the process engine is being created and drops the schema when the process engine is being closed.static StringDB_SCHEMA_UPDATE_FALSEChecks 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 StringDB_SCHEMA_UPDATE_TRUEUpon building of the process engine, a check is performed and an update of the schema is performed if it is necessary.protected StringdefaultCamelContextprotected intdefaultFailedJobWaitTimedefine the default wait time for a failed job in secondsprotected booleanenableProcessDefinitionInfoCacheprotected ActivitiEngineAgendaFactoryengineAgendaFactoryprotected Stringhistoryprotected HistoryLevelhistoryLevelprotected intidBlockSizeprotected booleanisDbHistoryUsedprotected intjdbcDefaultTransactionIsolationLevelprotected StringjdbcDriverprotected intjdbcMaxActiveConnectionsprotected intjdbcMaxCheckoutTimeprotected intjdbcMaxIdleConnectionsprotected intjdbcMaxWaitTimeprotected StringjdbcPasswordprotected intjdbcPingConnectionNotUsedForprotected booleanjdbcPingEnabledprotected StringjdbcPingQueryprotected StringjdbcUrlprotected StringjdbcUsernameprotected booleanjpaCloseEntityManagerprotected ObjectjpaEntityManagerFactoryprotected booleanjpaHandleTransactionprotected StringjpaPersistenceUnitNameprotected intlockTimeAsyncJobWaitTimeDefine the default lock time for an async job in seconds.protected StringmailServerDefaultFromprotected StringmailServerHostprotected StringmailServerPasswordprotected intmailServerPortprotected Map<String,MailServerInfo>mailServersprotected StringmailServerUsernameprotected StringmailSessionJndiprotected Map<String,String>mailSessionsJndistatic StringNO_TENANT_IDThe tenant id indicating 'no tenant'protected ProcessEngineLifecycleListenerprocessEngineLifecycleListenerprotected StringprocessEngineNameprotected booleantablePrefixIsSchemaSet to true in case the defined databaseTablePrefix is a schema-name, instead of an actual table name prefix.protected booleantransactionsExternallyManagedprotected booleanuseClassForNameClassLoadingEither use Class.forName or ClassLoader.loadClass for class loading.protected booleanuseSSLprotected booleanuseTLSprotected StringxmlEncoding
-
Constructor Summary
Constructors Modifier Constructor Description protectedProcessEngineConfiguration()use one of the static createXxxx methods instead
-
Method Summary
-
-
-
Field Detail
-
DB_SCHEMA_UPDATE_FALSE
public static final String 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:
- Constant Field Values
-
DB_SCHEMA_UPDATE_CREATE_DROP
public static final String 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:
- Constant Field Values
-
DB_SCHEMA_UPDATE_TRUE
public static final String 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:
- Constant Field Values
-
NO_TENANT_ID
public static final String NO_TENANT_ID
The tenant id indicating 'no tenant'- See Also:
- Constant Field Values
-
processEngineName
protected String processEngineName
-
idBlockSize
protected int idBlockSize
-
history
protected String history
-
asyncExecutorActivate
protected boolean asyncExecutorActivate
-
mailServerHost
protected String mailServerHost
-
mailServerUsername
protected String mailServerUsername
-
mailServerPassword
protected String mailServerPassword
-
mailServerPort
protected int mailServerPort
-
useSSL
protected boolean useSSL
-
useTLS
protected boolean useTLS
-
mailServerDefaultFrom
protected String mailServerDefaultFrom
-
mailSessionJndi
protected String mailSessionJndi
-
mailServers
protected Map<String,MailServerInfo> mailServers
-
databaseType
protected String databaseType
-
databaseSchemaUpdate
protected String databaseSchemaUpdate
-
jdbcDriver
protected String jdbcDriver
-
jdbcUrl
protected String jdbcUrl
-
jdbcUsername
protected String jdbcUsername
-
jdbcPassword
protected String jdbcPassword
-
dataSourceJndiName
protected String dataSourceJndiName
-
isDbHistoryUsed
protected boolean isDbHistoryUsed
-
historyLevel
protected HistoryLevel historyLevel
-
jdbcMaxActiveConnections
protected int jdbcMaxActiveConnections
-
jdbcMaxIdleConnections
protected int jdbcMaxIdleConnections
-
jdbcMaxCheckoutTime
protected int jdbcMaxCheckoutTime
-
jdbcMaxWaitTime
protected int jdbcMaxWaitTime
-
jdbcPingEnabled
protected boolean jdbcPingEnabled
-
jdbcPingQuery
protected String jdbcPingQuery
-
jdbcPingConnectionNotUsedFor
protected int jdbcPingConnectionNotUsedFor
-
jdbcDefaultTransactionIsolationLevel
protected int jdbcDefaultTransactionIsolationLevel
-
dataSource
protected DataSource dataSource
-
transactionsExternallyManaged
protected boolean transactionsExternallyManaged
-
jpaPersistenceUnitName
protected String jpaPersistenceUnitName
-
jpaEntityManagerFactory
protected Object jpaEntityManagerFactory
-
jpaHandleTransaction
protected boolean jpaHandleTransaction
-
jpaCloseEntityManager
protected boolean jpaCloseEntityManager
-
clock
protected Clock clock
-
asyncExecutor
protected AsyncExecutor asyncExecutor
-
lockTimeAsyncJobWaitTime
protected int lockTimeAsyncJobWaitTime
Define 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 defaultFailedJobWaitTime
define the default wait time for a failed job in seconds
-
asyncFailedJobWaitTime
protected int asyncFailedJobWaitTime
define the default wait time for a failed async job in seconds
-
databaseTablePrefix
protected String 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
protected String 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
protected String databaseCatalog
database catalog to use
-
databaseSchema
protected String 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 tablePrefixIsSchema
Set 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
protected String xmlEncoding
-
defaultCamelContext
protected String defaultCamelContext
-
classLoader
protected ClassLoader classLoader
-
useClassForNameClassLoading
protected boolean useClassForNameClassLoading
Either use Class.forName or ClassLoader.loadClass for class loading. See http://forums.activiti.org/content/reflectutilloadclass-and-custom- classloader
-
processEngineLifecycleListener
protected ProcessEngineLifecycleListener processEngineLifecycleListener
-
enableProcessDefinitionInfoCache
protected boolean enableProcessDefinitionInfoCache
-
engineAgendaFactory
protected ActivitiEngineAgendaFactory engineAgendaFactory
-
copyVariablesToLocalForTasks
protected boolean copyVariablesToLocalForTasks
-
-
Method Detail
-
buildProcessEngine
public abstract ProcessEngine buildProcessEngine()
-
createProcessEngineConfigurationFromResourceDefault
public static ProcessEngineConfiguration 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
public static ProcessEngineConfiguration createStandaloneProcessEngineConfiguration()
-
createStandaloneInMemProcessEngineConfiguration
public static ProcessEngineConfiguration createStandaloneInMemProcessEngineConfiguration()
-
getRepositoryService
public abstract RepositoryService getRepositoryService()
-
getRuntimeService
public abstract RuntimeService getRuntimeService()
-
getTaskService
public abstract TaskService getTaskService()
-
getHistoryService
public abstract HistoryService getHistoryService()
-
getManagementService
public abstract ManagementService getManagementService()
-
getProcessEngineConfiguration
public abstract ProcessEngineConfiguration getProcessEngineConfiguration()
-
getUserGroupManager
public abstract UserGroupManager getUserGroupManager()
-
getIntegrationContextService
public abstract IntegrationContextService getIntegrationContextService()
-
getIntegrationContextManager
public abstract IntegrationContextManager getIntegrationContextManager()
-
getProcessEngineName
public String getProcessEngineName()
-
setProcessEngineName
public ProcessEngineConfiguration setProcessEngineName(String processEngineName)
-
getIdBlockSize
public int getIdBlockSize()
-
setIdBlockSize
public ProcessEngineConfiguration setIdBlockSize(int idBlockSize)
-
getHistory
public String getHistory()
-
setHistory
public ProcessEngineConfiguration setHistory(String history)
-
getMailServerHost
public String getMailServerHost()
-
setMailServerHost
public ProcessEngineConfiguration setMailServerHost(String mailServerHost)
-
getMailServerUsername
public String getMailServerUsername()
-
setMailServerUsername
public ProcessEngineConfiguration setMailServerUsername(String mailServerUsername)
-
getMailServerPassword
public String getMailServerPassword()
-
setMailServerPassword
public ProcessEngineConfiguration setMailServerPassword(String mailServerPassword)
-
getMailSessionJndi
public String getMailSessionJndi()
-
setMailSessionJndi
public ProcessEngineConfiguration setMailSessionJndi(String mailSessionJndi)
-
getMailServerPort
public int getMailServerPort()
-
setMailServerPort
public ProcessEngineConfiguration setMailServerPort(int mailServerPort)
-
getMailServerUseSSL
public boolean getMailServerUseSSL()
-
setMailServerUseSSL
public ProcessEngineConfiguration setMailServerUseSSL(boolean useSSL)
-
getMailServerUseTLS
public boolean getMailServerUseTLS()
-
setMailServerUseTLS
public ProcessEngineConfiguration setMailServerUseTLS(boolean useTLS)
-
getMailServerDefaultFrom
public String getMailServerDefaultFrom()
-
setMailServerDefaultFrom
public ProcessEngineConfiguration setMailServerDefaultFrom(String mailServerDefaultFrom)
-
getMailServer
public MailServerInfo getMailServer(String tenantId)
-
getMailServers
public Map<String,MailServerInfo> getMailServers()
-
setMailServers
public ProcessEngineConfiguration setMailServers(Map<String,MailServerInfo> mailServers)
-
setMailSessionsJndi
public ProcessEngineConfiguration setMailSessionsJndi(Map<String,String> mailSessionsJndi)
-
getDatabaseType
public String getDatabaseType()
-
setDatabaseType
public ProcessEngineConfiguration setDatabaseType(String databaseType)
-
getDatabaseSchemaUpdate
public String getDatabaseSchemaUpdate()
-
setDatabaseSchemaUpdate
public ProcessEngineConfiguration setDatabaseSchemaUpdate(String databaseSchemaUpdate)
-
getDataSource
public DataSource getDataSource()
-
setDataSource
public ProcessEngineConfiguration setDataSource(DataSource dataSource)
-
getJdbcDriver
public String getJdbcDriver()
-
setJdbcDriver
public ProcessEngineConfiguration setJdbcDriver(String jdbcDriver)
-
getJdbcUrl
public String getJdbcUrl()
-
setJdbcUrl
public ProcessEngineConfiguration setJdbcUrl(String jdbcUrl)
-
getJdbcUsername
public String getJdbcUsername()
-
setJdbcUsername
public ProcessEngineConfiguration setJdbcUsername(String jdbcUsername)
-
getJdbcPassword
public String getJdbcPassword()
-
setJdbcPassword
public ProcessEngineConfiguration setJdbcPassword(String jdbcPassword)
-
isTransactionsExternallyManaged
public boolean isTransactionsExternallyManaged()
-
setTransactionsExternallyManaged
public ProcessEngineConfiguration setTransactionsExternallyManaged(boolean transactionsExternallyManaged)
-
getHistoryLevel
public HistoryLevel getHistoryLevel()
-
setHistoryLevel
public ProcessEngineConfiguration setHistoryLevel(HistoryLevel historyLevel)
-
isDbHistoryUsed
public boolean isDbHistoryUsed()
-
setDbHistoryUsed
public ProcessEngineConfiguration setDbHistoryUsed(boolean isDbHistoryUsed)
-
getJdbcMaxActiveConnections
public int getJdbcMaxActiveConnections()
-
setJdbcMaxActiveConnections
public ProcessEngineConfiguration setJdbcMaxActiveConnections(int jdbcMaxActiveConnections)
-
getJdbcMaxIdleConnections
public int getJdbcMaxIdleConnections()
-
setJdbcMaxIdleConnections
public ProcessEngineConfiguration setJdbcMaxIdleConnections(int jdbcMaxIdleConnections)
-
getJdbcMaxCheckoutTime
public int getJdbcMaxCheckoutTime()
-
setJdbcMaxCheckoutTime
public ProcessEngineConfiguration setJdbcMaxCheckoutTime(int jdbcMaxCheckoutTime)
-
getJdbcMaxWaitTime
public int getJdbcMaxWaitTime()
-
setJdbcMaxWaitTime
public ProcessEngineConfiguration setJdbcMaxWaitTime(int jdbcMaxWaitTime)
-
isJdbcPingEnabled
public boolean isJdbcPingEnabled()
-
setJdbcPingEnabled
public ProcessEngineConfiguration setJdbcPingEnabled(boolean jdbcPingEnabled)
-
getJdbcPingQuery
public String getJdbcPingQuery()
-
setJdbcPingQuery
public ProcessEngineConfiguration setJdbcPingQuery(String jdbcPingQuery)
-
getJdbcPingConnectionNotUsedFor
public int getJdbcPingConnectionNotUsedFor()
-
setJdbcPingConnectionNotUsedFor
public ProcessEngineConfiguration setJdbcPingConnectionNotUsedFor(int jdbcPingNotUsedFor)
-
getJdbcDefaultTransactionIsolationLevel
public int getJdbcDefaultTransactionIsolationLevel()
-
setJdbcDefaultTransactionIsolationLevel
public ProcessEngineConfiguration setJdbcDefaultTransactionIsolationLevel(int jdbcDefaultTransactionIsolationLevel)
-
isAsyncExecutorActivate
public boolean isAsyncExecutorActivate()
-
setAsyncExecutorActivate
public ProcessEngineConfiguration setAsyncExecutorActivate(boolean asyncExecutorActivate)
-
getClassLoader
public ClassLoader getClassLoader()
-
setClassLoader
public ProcessEngineConfiguration setClassLoader(ClassLoader classLoader)
-
isUseClassForNameClassLoading
public boolean isUseClassForNameClassLoading()
-
setUseClassForNameClassLoading
public ProcessEngineConfiguration setUseClassForNameClassLoading(boolean useClassForNameClassLoading)
-
getJpaEntityManagerFactory
public Object getJpaEntityManagerFactory()
-
setJpaEntityManagerFactory
public ProcessEngineConfiguration setJpaEntityManagerFactory(Object jpaEntityManagerFactory)
-
isJpaHandleTransaction
public boolean isJpaHandleTransaction()
-
setJpaHandleTransaction
public ProcessEngineConfiguration setJpaHandleTransaction(boolean jpaHandleTransaction)
-
isJpaCloseEntityManager
public boolean isJpaCloseEntityManager()
-
setJpaCloseEntityManager
public ProcessEngineConfiguration setJpaCloseEntityManager(boolean jpaCloseEntityManager)
-
getJpaPersistenceUnitName
public String getJpaPersistenceUnitName()
-
setJpaPersistenceUnitName
public ProcessEngineConfiguration setJpaPersistenceUnitName(String jpaPersistenceUnitName)
-
getDataSourceJndiName
public String getDataSourceJndiName()
-
setDataSourceJndiName
public ProcessEngineConfiguration setDataSourceJndiName(String dataSourceJndiName)
-
getDefaultCamelContext
public String getDefaultCamelContext()
-
setDefaultCamelContext
public ProcessEngineConfiguration setDefaultCamelContext(String defaultCamelContext)
-
setProcessEngineLifecycleListener
public ProcessEngineConfiguration setProcessEngineLifecycleListener(ProcessEngineLifecycleListener processEngineLifecycleListener)
-
getProcessEngineLifecycleListener
public ProcessEngineLifecycleListener getProcessEngineLifecycleListener()
-
getDatabaseTablePrefix
public String getDatabaseTablePrefix()
-
setDatabaseTablePrefix
public ProcessEngineConfiguration setDatabaseTablePrefix(String databaseTablePrefix)
-
setTablePrefixIsSchema
public ProcessEngineConfiguration setTablePrefixIsSchema(boolean tablePrefixIsSchema)
-
isTablePrefixIsSchema
public boolean isTablePrefixIsSchema()
-
getDatabaseWildcardEscapeCharacter
public String getDatabaseWildcardEscapeCharacter()
-
setDatabaseWildcardEscapeCharacter
public ProcessEngineConfiguration setDatabaseWildcardEscapeCharacter(String databaseWildcardEscapeCharacter)
-
getDatabaseCatalog
public String getDatabaseCatalog()
-
setDatabaseCatalog
public ProcessEngineConfiguration setDatabaseCatalog(String databaseCatalog)
-
getDatabaseSchema
public String getDatabaseSchema()
-
setDatabaseSchema
public ProcessEngineConfiguration setDatabaseSchema(String databaseSchema)
-
getXmlEncoding
public String getXmlEncoding()
-
setXmlEncoding
public ProcessEngineConfiguration setXmlEncoding(String xmlEncoding)
-
getClock
public Clock getClock()
-
setClock
public ProcessEngineConfiguration setClock(Clock clock)
-
getAsyncExecutor
public AsyncExecutor getAsyncExecutor()
-
setAsyncExecutor
public ProcessEngineConfiguration setAsyncExecutor(AsyncExecutor asyncExecutor)
-
getLockTimeAsyncJobWaitTime
public int getLockTimeAsyncJobWaitTime()
-
setLockTimeAsyncJobWaitTime
public ProcessEngineConfiguration setLockTimeAsyncJobWaitTime(int lockTimeAsyncJobWaitTime)
-
getDefaultFailedJobWaitTime
public int getDefaultFailedJobWaitTime()
-
setDefaultFailedJobWaitTime
public ProcessEngineConfiguration setDefaultFailedJobWaitTime(int defaultFailedJobWaitTime)
-
getAsyncFailedJobWaitTime
public int getAsyncFailedJobWaitTime()
-
setAsyncFailedJobWaitTime
public ProcessEngineConfiguration setAsyncFailedJobWaitTime(int asyncFailedJobWaitTime)
-
isEnableProcessDefinitionInfoCache
public boolean isEnableProcessDefinitionInfoCache()
-
setEnableProcessDefinitionInfoCache
public ProcessEngineConfiguration setEnableProcessDefinitionInfoCache(boolean enableProcessDefinitionInfoCache)
-
setCopyVariablesToLocalForTasks
public ProcessEngineConfiguration setCopyVariablesToLocalForTasks(boolean copyVariablesToLocalForTasks)
-
isCopyVariablesToLocalForTasks
public boolean isCopyVariablesToLocalForTasks()
-
setEngineAgendaFactory
public void setEngineAgendaFactory(ActivitiEngineAgendaFactory engineAgendaFactory)
-
getEngineAgendaFactory
public ActivitiEngineAgendaFactory getEngineAgendaFactory()
-
-