public abstract class ProcessEngineConfiguration extends Object implements EngineServices
Most common is to create a process engine based on the default configuration file:
ProcessEngine processEngine = ProcessEngineConfiguration .createProcessEngineConfigurationFromResourceDefault() .buildProcessEngine();
To create a process engine programatic, 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 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();
ProcessEngines
Modifier and Type | Field and Description |
---|---|
protected String |
activityFontName |
protected String |
annotationFontName |
protected org.activiti.engine.impl.asyncexecutor.AsyncExecutor |
asyncExecutor |
protected boolean |
asyncExecutorActivate |
protected boolean |
asyncExecutorEnabled |
protected int |
asyncFailedJobWaitTime
define the default wait time for a failed async job in seconds
|
protected ClassLoader |
classLoader |
protected Clock |
clock |
protected String |
databaseCatalog
database catalog to use
|
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://activiti.atlassian.net/browse/ACT-1220,
https://activiti.atlassian.net/browse/ACT-1062
|
protected String |
databaseSchemaUpdate |
protected String |
databaseTablePrefix
Allows configuring a database table prefix which is used for all runtime operations of the process engine.
|
protected String |
databaseType |
protected String |
databaseWildcardEscapeCharacter
Escape character for doing wildcard searches.
|
protected DataSource |
dataSource |
protected String |
dataSourceJndiName |
static 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.
|
static 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.
|
static 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.
|
protected String |
defaultCamelContext |
protected int |
defaultFailedJobWaitTime
define the default wait time for a failed job in seconds
|
protected boolean |
enableProcessDefinitionInfoCache |
protected String |
history |
protected org.activiti.engine.impl.history.HistoryLevel |
historyLevel |
protected int |
idBlockSize |
protected boolean |
isCreateDiagramOnDeploy |
protected boolean |
isDbHistoryUsed |
protected boolean |
isDbIdentityUsed |
protected int |
jdbcDefaultTransactionIsolationLevel |
protected String |
jdbcDriver |
protected int |
jdbcMaxActiveConnections |
protected int |
jdbcMaxCheckoutTime |
protected int |
jdbcMaxIdleConnections |
protected int |
jdbcMaxWaitTime |
protected String |
jdbcPassword |
protected int |
jdbcPingConnectionNotUsedFor |
protected boolean |
jdbcPingEnabled |
protected String |
jdbcPingQuery |
protected String |
jdbcUrl |
protected String |
jdbcUsername |
protected org.activiti.engine.impl.jobexecutor.JobExecutor |
jobExecutor |
protected boolean |
jobExecutorActivate |
protected boolean |
jpaCloseEntityManager |
protected Object |
jpaEntityManagerFactory |
protected boolean |
jpaHandleTransaction |
protected String |
jpaPersistenceUnitName |
protected String |
labelFontName |
protected int |
lockTimeAsyncJobWaitTime
Define the default lock time for an async job in seconds.
|
protected String |
mailServerDefaultFrom |
protected String |
mailServerHost |
protected String |
mailServerPassword |
protected int |
mailServerPort |
protected Map<String,MailServerInfo> |
mailServers |
protected String |
mailServerUsername |
protected String |
mailSessionJndi |
protected Map<String,String> |
mailSessionsJndi |
static String |
NO_TENANT_ID
The tenant id indicating 'no tenant'
|
protected org.activiti.image.ProcessDiagramGenerator |
processDiagramGenerator
process diagram generator.
|
protected ProcessEngineLifecycleListener |
processEngineLifecycleListener |
protected String |
processEngineName |
protected boolean |
tablePrefixIsSchema
Set to true in case the defined databaseTablePrefix is a schema-name, instead of an actual table name
prefix.
|
protected boolean |
transactionsExternallyManaged |
protected boolean |
useClassForNameClassLoading
Either use Class.forName or ClassLoader.loadClass for class loading.
|
protected boolean |
useSSL |
protected boolean |
useTLS |
protected String |
xmlEncoding |
Modifier | Constructor and Description |
---|---|
protected |
ProcessEngineConfiguration()
use one of the static createXxxx methods instead
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDynamicBpmnService, getFormService, getHistoryService, getIdentityService, getManagementService, getProcessEngineConfiguration, getRepositoryService, getRuntimeService, getTaskService
public static final String DB_SCHEMA_UPDATE_FALSE
public static final String DB_SCHEMA_UPDATE_CREATE_DROP
public static final String DB_SCHEMA_UPDATE_TRUE
public static final String NO_TENANT_ID
protected String processEngineName
protected int idBlockSize
protected String history
protected boolean jobExecutorActivate
protected boolean asyncExecutorEnabled
protected boolean asyncExecutorActivate
protected String mailServerHost
protected String mailServerUsername
protected String mailServerPassword
protected int mailServerPort
protected boolean useSSL
protected boolean useTLS
protected String mailServerDefaultFrom
protected String mailSessionJndi
protected Map<String,MailServerInfo> mailServers
protected String databaseType
protected String databaseSchemaUpdate
protected String jdbcDriver
protected String jdbcUrl
protected String jdbcUsername
protected String jdbcPassword
protected String dataSourceJndiName
protected boolean isDbIdentityUsed
protected boolean isDbHistoryUsed
protected org.activiti.engine.impl.history.HistoryLevel historyLevel
protected int jdbcMaxActiveConnections
protected int jdbcMaxIdleConnections
protected int jdbcMaxCheckoutTime
protected int jdbcMaxWaitTime
protected boolean jdbcPingEnabled
protected String jdbcPingQuery
protected int jdbcPingConnectionNotUsedFor
protected int jdbcDefaultTransactionIsolationLevel
protected DataSource dataSource
protected boolean transactionsExternallyManaged
protected String jpaPersistenceUnitName
protected Object jpaEntityManagerFactory
protected boolean jpaHandleTransaction
protected boolean jpaCloseEntityManager
protected Clock clock
protected org.activiti.engine.impl.jobexecutor.JobExecutor jobExecutor
protected org.activiti.engine.impl.asyncexecutor.AsyncExecutor asyncExecutor
protected int lockTimeAsyncJobWaitTime
protected int defaultFailedJobWaitTime
protected int asyncFailedJobWaitTime
protected org.activiti.image.ProcessDiagramGenerator processDiagramGenerator
protected String databaseTablePrefix
DB_SCHEMA_UPDATE_CREATE_DROP
or DB_SCHEMA_UPDATE_TRUE
, activiti will create the database tables
using the default names, regardless of the prefix configured here.protected String databaseWildcardEscapeCharacter
protected String databaseCatalog
protected String databaseSchema
protected boolean tablePrefixIsSchema
protected boolean isCreateDiagramOnDeploy
protected String xmlEncoding
protected String defaultCamelContext
protected String activityFontName
protected String labelFontName
protected String annotationFontName
protected ClassLoader classLoader
protected boolean useClassForNameClassLoading
protected ProcessEngineLifecycleListener processEngineLifecycleListener
protected boolean enableProcessDefinitionInfoCache
protected ProcessEngineConfiguration()
public abstract ProcessEngine buildProcessEngine()
public static ProcessEngineConfiguration createProcessEngineConfigurationFromResourceDefault()
public static ProcessEngineConfiguration createProcessEngineConfigurationFromResource(String resource)
public static ProcessEngineConfiguration createProcessEngineConfigurationFromResource(String resource, String beanName)
public static ProcessEngineConfiguration createProcessEngineConfigurationFromInputStream(InputStream inputStream)
public static ProcessEngineConfiguration createProcessEngineConfigurationFromInputStream(InputStream inputStream, String beanName)
public static ProcessEngineConfiguration createStandaloneProcessEngineConfiguration()
public static ProcessEngineConfiguration createStandaloneInMemProcessEngineConfiguration()
public String getProcessEngineName()
public ProcessEngineConfiguration setProcessEngineName(String processEngineName)
public int getIdBlockSize()
public ProcessEngineConfiguration setIdBlockSize(int idBlockSize)
public String getHistory()
public ProcessEngineConfiguration setHistory(String history)
public String getMailServerHost()
public ProcessEngineConfiguration setMailServerHost(String mailServerHost)
public String getMailServerUsername()
public ProcessEngineConfiguration setMailServerUsername(String mailServerUsername)
public String getMailServerPassword()
public ProcessEngineConfiguration setMailServerPassword(String mailServerPassword)
public String getMailSessionJndi()
public ProcessEngineConfiguration setMailSessionJndi(String mailSessionJndi)
public int getMailServerPort()
public ProcessEngineConfiguration setMailServerPort(int mailServerPort)
public boolean getMailServerUseSSL()
public ProcessEngineConfiguration setMailServerUseSSL(boolean useSSL)
public boolean getMailServerUseTLS()
public ProcessEngineConfiguration setMailServerUseTLS(boolean useTLS)
public String getMailServerDefaultFrom()
public ProcessEngineConfiguration setMailServerDefaultFrom(String mailServerDefaultFrom)
public MailServerInfo getMailServer(String tenantId)
public Map<String,MailServerInfo> getMailServers()
public ProcessEngineConfiguration setMailServers(Map<String,MailServerInfo> mailServers)
public ProcessEngineConfiguration setMailSessionsJndi(Map<String,String> mailSessionsJndi)
public String getDatabaseType()
public ProcessEngineConfiguration setDatabaseType(String databaseType)
public String getDatabaseSchemaUpdate()
public ProcessEngineConfiguration setDatabaseSchemaUpdate(String databaseSchemaUpdate)
public DataSource getDataSource()
public ProcessEngineConfiguration setDataSource(DataSource dataSource)
public String getJdbcDriver()
public ProcessEngineConfiguration setJdbcDriver(String jdbcDriver)
public String getJdbcUrl()
public ProcessEngineConfiguration setJdbcUrl(String jdbcUrl)
public String getJdbcUsername()
public ProcessEngineConfiguration setJdbcUsername(String jdbcUsername)
public String getJdbcPassword()
public ProcessEngineConfiguration setJdbcPassword(String jdbcPassword)
public boolean isTransactionsExternallyManaged()
public ProcessEngineConfiguration setTransactionsExternallyManaged(boolean transactionsExternallyManaged)
public org.activiti.engine.impl.history.HistoryLevel getHistoryLevel()
public ProcessEngineConfiguration setHistoryLevel(org.activiti.engine.impl.history.HistoryLevel historyLevel)
public boolean isDbIdentityUsed()
public ProcessEngineConfiguration setDbIdentityUsed(boolean isDbIdentityUsed)
public boolean isDbHistoryUsed()
public ProcessEngineConfiguration setDbHistoryUsed(boolean isDbHistoryUsed)
public int getJdbcMaxActiveConnections()
public ProcessEngineConfiguration setJdbcMaxActiveConnections(int jdbcMaxActiveConnections)
public int getJdbcMaxIdleConnections()
public ProcessEngineConfiguration setJdbcMaxIdleConnections(int jdbcMaxIdleConnections)
public int getJdbcMaxCheckoutTime()
public ProcessEngineConfiguration setJdbcMaxCheckoutTime(int jdbcMaxCheckoutTime)
public int getJdbcMaxWaitTime()
public ProcessEngineConfiguration setJdbcMaxWaitTime(int jdbcMaxWaitTime)
public boolean isJdbcPingEnabled()
public ProcessEngineConfiguration setJdbcPingEnabled(boolean jdbcPingEnabled)
public String getJdbcPingQuery()
public ProcessEngineConfiguration setJdbcPingQuery(String jdbcPingQuery)
public int getJdbcPingConnectionNotUsedFor()
public ProcessEngineConfiguration setJdbcPingConnectionNotUsedFor(int jdbcPingNotUsedFor)
public int getJdbcDefaultTransactionIsolationLevel()
public ProcessEngineConfiguration setJdbcDefaultTransactionIsolationLevel(int jdbcDefaultTransactionIsolationLevel)
public boolean isJobExecutorActivate()
public ProcessEngineConfiguration setJobExecutorActivate(boolean jobExecutorActivate)
public boolean isAsyncExecutorEnabled()
public ProcessEngineConfiguration setAsyncExecutorEnabled(boolean asyncExecutorEnabled)
public boolean isAsyncExecutorActivate()
public ProcessEngineConfiguration setAsyncExecutorActivate(boolean asyncExecutorActivate)
public ClassLoader getClassLoader()
public ProcessEngineConfiguration setClassLoader(ClassLoader classLoader)
public boolean isUseClassForNameClassLoading()
public ProcessEngineConfiguration setUseClassForNameClassLoading(boolean useClassForNameClassLoading)
public Object getJpaEntityManagerFactory()
public ProcessEngineConfiguration setJpaEntityManagerFactory(Object jpaEntityManagerFactory)
public boolean isJpaHandleTransaction()
public ProcessEngineConfiguration setJpaHandleTransaction(boolean jpaHandleTransaction)
public boolean isJpaCloseEntityManager()
public ProcessEngineConfiguration setJpaCloseEntityManager(boolean jpaCloseEntityManager)
public String getJpaPersistenceUnitName()
public ProcessEngineConfiguration setJpaPersistenceUnitName(String jpaPersistenceUnitName)
public String getDataSourceJndiName()
public ProcessEngineConfiguration setDataSourceJndiName(String dataSourceJndiName)
public String getDefaultCamelContext()
public ProcessEngineConfiguration setDefaultCamelContext(String defaultCamelContext)
public boolean isCreateDiagramOnDeploy()
public ProcessEngineConfiguration setCreateDiagramOnDeploy(boolean createDiagramOnDeploy)
public String getActivityFontName()
public ProcessEngineConfiguration setActivityFontName(String activityFontName)
public ProcessEngineConfiguration setProcessEngineLifecycleListener(ProcessEngineLifecycleListener processEngineLifecycleListener)
public ProcessEngineLifecycleListener getProcessEngineLifecycleListener()
public String getLabelFontName()
public ProcessEngineConfiguration setLabelFontName(String labelFontName)
public String getAnnotationFontName()
public ProcessEngineConfiguration setAnnotationFontName(String annotationFontName)
public String getDatabaseTablePrefix()
public ProcessEngineConfiguration setDatabaseTablePrefix(String databaseTablePrefix)
public ProcessEngineConfiguration setTablePrefixIsSchema(boolean tablePrefixIsSchema)
public boolean isTablePrefixIsSchema()
public String getDatabaseWildcardEscapeCharacter()
public ProcessEngineConfiguration setDatabaseWildcardEscapeCharacter(String databaseWildcardEscapeCharacter)
public String getDatabaseCatalog()
public ProcessEngineConfiguration setDatabaseCatalog(String databaseCatalog)
public String getDatabaseSchema()
public ProcessEngineConfiguration setDatabaseSchema(String databaseSchema)
public String getXmlEncoding()
public ProcessEngineConfiguration setXmlEncoding(String xmlEncoding)
public Clock getClock()
public ProcessEngineConfiguration setClock(Clock clock)
public org.activiti.image.ProcessDiagramGenerator getProcessDiagramGenerator()
public ProcessEngineConfiguration setProcessDiagramGenerator(org.activiti.image.ProcessDiagramGenerator processDiagramGenerator)
public org.activiti.engine.impl.jobexecutor.JobExecutor getJobExecutor()
public ProcessEngineConfiguration setJobExecutor(org.activiti.engine.impl.jobexecutor.JobExecutor jobExecutor)
public org.activiti.engine.impl.asyncexecutor.AsyncExecutor getAsyncExecutor()
public ProcessEngineConfiguration setAsyncExecutor(org.activiti.engine.impl.asyncexecutor.AsyncExecutor asyncExecutor)
public int getLockTimeAsyncJobWaitTime()
public ProcessEngineConfiguration setLockTimeAsyncJobWaitTime(int lockTimeAsyncJobWaitTime)
public int getDefaultFailedJobWaitTime()
public ProcessEngineConfiguration setDefaultFailedJobWaitTime(int defaultFailedJobWaitTime)
public int getAsyncFailedJobWaitTime()
public ProcessEngineConfiguration setAsyncFailedJobWaitTime(int asyncFailedJobWaitTime)
public boolean isEnableProcessDefinitionInfoCache()
public ProcessEngineConfiguration setEnableProcessDefinitionInfoCache(boolean enableProcessDefinitionInfoCache)
Copyright © 2016 Alfresco. All rights reserved.