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 |
---|---|
static String |
AUTHORIZATION_CHECK_REVOKE_ALWAYS
Always enables check for
revoke authorizations. |
static String |
AUTHORIZATION_CHECK_REVOKE_AUTO
This mode only checks for
revoke authorizations if at least
one revoke authorization currently exits for the current user or one of the groups the user is a member
of. |
static String |
AUTHORIZATION_CHECK_REVOKE_NEVER
Never checks for
revoke authorizations. |
protected String |
authorizationCheckRevokes |
protected boolean |
authorizationEnabled
switch for controlling whether the process engine performs authorization checks.
|
protected boolean |
authorizationEnabledForCustomCode
The following flag
authorizationEnabledForCustomCode will
only be taken into account iff authorizationEnabled is set
true . |
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 String |
defaultUserPermissionNameForTask
Provides the default task permission for the user related to a task
User can be related to a task in the following ways
- Candidate user
- Part of candidate group
- Assignee
- Owner
The default value is UPDATE.
|
protected boolean |
hintJobExecutor
The flag will be used inside the method "JobManager#send()".
|
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_AUTO
Value for
setHistory(String) . |
static String |
HISTORY_DEFAULT
The default history level that is used when no history level is configured
|
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 |
jobExecutorAcquireByPriority |
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 |
producePrioritizedExternalTasks |
protected boolean |
producePrioritizedJobs |
protected SchemaOperationsCommand |
schemaOperationsCommand |
protected boolean |
tenantCheckEnabled
If the value of this flag is set
true then the process engine
performs tenant checks to ensure that an authenticated user can only access
data that belongs to one of his tenants. |
protected boolean |
transactionsExternallyManaged |
protected boolean |
useTLS |
protected org.camunda.bpm.engine.variable.type.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.public static final String HISTORY_AUTO
setHistory(String)
. Choosing auto causes the configuration to choose the level
already present on the database. If none can be found, "audit" is taken.public static final String HISTORY_DEFAULT
public static final String AUTHORIZATION_CHECK_REVOKE_ALWAYS
revoke
authorizations.
This mode is equal to the < 7.5 behavior.
*NOTE:* Checking revoke authorizations is very expensive for resources with a high potential
cardinality like tasks or process instances and can render authorized access to the process engine
effectively unusable on most databases. You are therefore strongly discouraged from using this mode.public static final String AUTHORIZATION_CHECK_REVOKE_NEVER
revoke
authorizations. This mode
has best performance effectively disables the use of Authorization.AUTH_TYPE_REVOKE
.
*Note*: It is strongly recommended to use this mode.public static final String AUTHORIZATION_CHECK_REVOKE_AUTO
revoke
authorizations if at least
one revoke authorization currently exits for the current user or one of the groups the user is a member
of. To achieve this it is checked once per command whether potentially applicable revoke authorizations
exist. Based on the outcome, the authorization check then uses revoke or not.
*NOTE:* Checking revoke authorizations is very expensive for resources with a high potential
cardinality like tasks or process instances and can render authorized access to the process engine
effectively unusable on most databases.protected String processEngineName
protected int idBlockSize
protected String history
protected boolean jobExecutorActivate
protected boolean jobExecutorDeploymentAware
protected boolean jobExecutorPreferTimerJobs
protected boolean jobExecutorAcquireByDueDate
protected boolean jobExecutorAcquireByPriority
protected boolean producePrioritizedJobs
protected boolean producePrioritizedExternalTasks
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 SchemaOperationsCommand schemaOperationsCommand
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 String defaultUserPermissionNameForTask
protected boolean authorizationEnabledForCustomCode
The following flag authorizationEnabledForCustomCode
will
only be taken into account iff authorizationEnabled
is set
true
.
If the value of the flag authorizationEnabledForCustomCode
is set true
then an authorization check will be performed by
executing commands inside custom code (e.g. inside JavaDelegate
).
The default value is false
.
protected boolean tenantCheckEnabled
true
then the process engine
performs tenant checks to ensure that an authenticated user can only access
data that belongs to one of his tenants.protected org.camunda.bpm.engine.variable.type.ValueTypeResolver valueTypeResolver
protected String authorizationCheckRevokes
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 SchemaOperationsCommand getSchemaOperationsCommand()
public void setSchemaOperationsCommand(SchemaOperationsCommand schemaOperationsCommand)
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 String getDefaultUserPermissionNameForTask()
public ProcessEngineConfiguration setDefaultUserPermissionNameForTask(String defaultUserPermissionNameForTask)
public boolean isAuthorizationEnabledForCustomCode()
public ProcessEngineConfiguration setAuthorizationEnabledForCustomCode(boolean authorizationEnabledForCustomCode)
public boolean isTenantCheckEnabled()
public ProcessEngineConfiguration setTenantCheckEnabled(boolean isTenantCheckEnabled)
public int getDefaultNumberOfRetries()
public void setDefaultNumberOfRetries(int defaultNumberOfRetries)
public org.camunda.bpm.engine.variable.type.ValueTypeResolver getValueTypeResolver()
public ProcessEngineConfiguration setValueTypeResolver(org.camunda.bpm.engine.variable.type.ValueTypeResolver valueTypeResolver)
public boolean isProducePrioritizedJobs()
public void setProducePrioritizedJobs(boolean producePrioritizedJobs)
public boolean isJobExecutorAcquireByPriority()
public void setJobExecutorAcquireByPriority(boolean jobExecutorAcquireByPriority)
public boolean isProducePrioritizedExternalTasks()
public void setProducePrioritizedExternalTasks(boolean producePrioritizedExternalTasks)
public void setAuthorizationCheckRevokes(String authorizationCheckRevokes)
public String getAuthorizationCheckRevokes()
Copyright © 2018. All rights reserved.