public abstract class ProcessEngineConfiguration extends Object
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 boolean |
authorizationEnabled
switch for controlling whether the process engine performs authorization checks.
|
protected ClassLoader |
classLoader |
protected boolean |
createIncidentOnFailedJobEnabled |
protected String |
databaseSchemaUpdate |
protected String |
databaseType |
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 int |
defaultNumberOfRetries |
protected boolean |
hintJobExecutor |
protected String |
history |
static String |
HISTORY_ACTIVITY
Value for
setHistory(String) to ensure that only historic process instances and
historic activity instances are being recorded. |
static String |
HISTORY_AUDIT
Value for
setHistory(String) to ensure that only historic process instances,
historic activity instances and submitted form property values are being recorded. |
static String |
HISTORY_FULL
Value for
setHistory(String) to ensure that all historic information is
being recorded, including the variable updates. |
static String |
HISTORY_NONE
Value for
setHistory(String) to ensure that no history is being recorded. |
static String |
HISTORY_VARIABLE
Deprecated.
|
protected int |
idBlockSize |
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 Integer |
jdbcStatementTimeout
the number of seconds the jdbc driver will wait for a response from the database
|
protected String |
jdbcUrl |
protected String |
jdbcUsername |
protected boolean |
jobExecutorAcquireByDueDate |
protected boolean |
jobExecutorActivate |
protected boolean |
jobExecutorDeploymentAware |
protected boolean |
jobExecutorPreferTimerJobs |
protected boolean |
jpaCloseEntityManager |
protected Object |
jpaEntityManagerFactory |
protected boolean |
jpaHandleTransaction |
protected String |
jpaPersistenceUnitName |
protected String |
mailServerDefaultFrom |
protected String |
mailServerHost |
protected String |
mailServerPassword |
protected int |
mailServerPort |
protected String |
mailServerUsername |
protected String |
processEngineName |
protected boolean |
transactionsExternallyManaged |
protected boolean |
useTLS |
protected ValueTypeResolver |
valueTypeResolver |
Modifier | Constructor and Description |
---|---|
protected |
ProcessEngineConfiguration()
use one of the static createXxxx methods instead
|
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 HISTORY_NONE
setHistory(String)
to ensure that no history is being recorded.public static final String HISTORY_ACTIVITY
setHistory(String)
to ensure that only historic process instances and
historic activity instances are being recorded.
This means no details for those entities.@Deprecated public static final String HISTORY_VARIABLE
setHistory(String)
to ensure that only historic process instances,
historic activity instances and last process variable values are being recorded.
NOTE: This history level has been deprecated. Use level HISTORY_ACTIVITY
instead.
public static final String HISTORY_AUDIT
setHistory(String)
to ensure that only historic process instances,
historic activity instances and submitted form property values are being recorded.public static final String HISTORY_FULL
setHistory(String)
to ensure that all historic information is
being recorded, including the variable updates.protected String processEngineName
protected int idBlockSize
protected String history
protected boolean jobExecutorActivate
protected boolean jobExecutorDeploymentAware
protected boolean jobExecutorPreferTimerJobs
protected boolean jobExecutorAcquireByDueDate
protected boolean hintJobExecutor
protected String mailServerHost
protected String mailServerUsername
protected String mailServerPassword
protected int mailServerPort
protected boolean useTLS
protected String mailServerDefaultFrom
protected String databaseType
protected String databaseSchemaUpdate
protected String jdbcDriver
protected String jdbcUrl
protected String jdbcUsername
protected String jdbcPassword
protected String dataSourceJndiName
protected int jdbcMaxActiveConnections
protected int jdbcMaxIdleConnections
protected int jdbcMaxCheckoutTime
protected int jdbcMaxWaitTime
protected boolean jdbcPingEnabled
protected String jdbcPingQuery
protected int jdbcPingConnectionNotUsedFor
protected DataSource dataSource
protected boolean transactionsExternallyManaged
protected Integer jdbcStatementTimeout
protected String jpaPersistenceUnitName
protected Object jpaEntityManagerFactory
protected boolean jpaHandleTransaction
protected boolean jpaCloseEntityManager
protected int defaultNumberOfRetries
protected ClassLoader classLoader
protected boolean createIncidentOnFailedJobEnabled
protected boolean authorizationEnabled
protected ValueTypeResolver valueTypeResolver
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 int getMailServerPort()
public ProcessEngineConfiguration setMailServerPort(int mailServerPort)
public boolean getMailServerUseTLS()
public ProcessEngineConfiguration setMailServerUseTLS(boolean useTLS)
public String getMailServerDefaultFrom()
public ProcessEngineConfiguration setMailServerDefaultFrom(String mailServerDefaultFrom)
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 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 Integer getJdbcStatementTimeout()
public ProcessEngineConfiguration setJdbcStatementTimeout(Integer jdbcStatementTimeout)
public boolean isJobExecutorActivate()
public ProcessEngineConfiguration setJobExecutorActivate(boolean jobExecutorActivate)
public boolean isJobExecutorDeploymentAware()
public ProcessEngineConfiguration setJobExecutorDeploymentAware(boolean jobExecutorDeploymentAware)
public boolean isJobExecutorAcquireByDueDate()
public ProcessEngineConfiguration setJobExecutorAcquireByDueDate(boolean jobExecutorAcquireByDueDate)
public boolean isJobExecutorPreferTimerJobs()
public ProcessEngineConfiguration setJobExecutorPreferTimerJobs(boolean jobExecutorPreferTimerJobs)
public boolean isHintJobExecutor()
public ProcessEngineConfiguration setHintJobExecutor(boolean hintJobExecutor)
public ClassLoader getClassLoader()
public ProcessEngineConfiguration setClassLoader(ClassLoader classLoader)
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 void setJpaPersistenceUnitName(String jpaPersistenceUnitName)
public String getDataSourceJndiName()
public void setDataSourceJndiName(String dataSourceJndiName)
public boolean isCreateIncidentOnFailedJobEnabled()
public ProcessEngineConfiguration setCreateIncidentOnFailedJobEnabled(boolean createIncidentOnFailedJobEnabled)
public boolean isAuthorizationEnabled()
public ProcessEngineConfiguration setAuthorizationEnabled(boolean isAuthorizationChecksEnabled)
public int getDefaultNumberOfRetries()
public void setDefaultNumberOfRetries(int defaultNumberOfRetries)
public ValueTypeResolver getValueTypeResolver()
public ProcessEngineConfiguration setValueTypeResolver(ValueTypeResolver valueTypeResolver)
Copyright © 2018. All rights reserved.