Class 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 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: createStandaloneInMemProcessEngineConfiguration()

    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();
     

    Author:
    Tom Baeyens
    See Also:
    ProcessEngines
    • 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
      • HISTORY_ACTIVITY

        public static final String HISTORY_ACTIVITY
        Value for setHistory(String) to ensure that only historic process instances and historic activity instances are being recorded. This means no details for those entities.
        See Also:
        Constant Field Values
      • HISTORY_AUDIT

        public static final 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.
        See Also:
        Constant Field Values
      • HISTORY_AUTO

        public static final String HISTORY_AUTO
        Value for setHistory(String). Choosing auto causes the configuration to choose the level already present on the database. If none can be found, "audit" is taken.
        See Also:
        Constant Field Values
      • HISTORY_DEFAULT

        public static final String HISTORY_DEFAULT
        The default history level that is used when no history level is configured
        See Also:
        Constant Field Values
      • HISTORY_CLEANUP_STRATEGY_END_TIME_BASED

        public static final String HISTORY_CLEANUP_STRATEGY_END_TIME_BASED
        History cleanup is performed based on end time.
        See Also:
        Constant Field Values
      • HISTORY_CLEANUP_STRATEGY_REMOVAL_TIME_BASED

        public static final String HISTORY_CLEANUP_STRATEGY_REMOVAL_TIME_BASED
        History cleanup is performed based on removal time.
        See Also:
        Constant Field Values
      • HISTORY_REMOVAL_TIME_STRATEGY_START

        public static final String HISTORY_REMOVAL_TIME_STRATEGY_START
        Removal time for historic entities is set on execution start.
        See Also:
        Constant Field Values
      • HISTORY_REMOVAL_TIME_STRATEGY_END

        public static final String HISTORY_REMOVAL_TIME_STRATEGY_END
        Removal time for historic entities is set if execution has been ended.
        See Also:
        Constant Field Values
      • HISTORY_REMOVAL_TIME_STRATEGY_NONE

        public static final String HISTORY_REMOVAL_TIME_STRATEGY_NONE
        Removal time for historic entities is not set.
        See Also:
        Constant Field Values
      • AUTHORIZATION_CHECK_REVOKE_ALWAYS

        public static final String AUTHORIZATION_CHECK_REVOKE_ALWAYS
        Always enables check for 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.

        See Also:
        Constant Field Values
      • AUTHORIZATION_CHECK_REVOKE_NEVER

        public static final String AUTHORIZATION_CHECK_REVOKE_NEVER
        Never checks for 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.
        See Also:
        Constant Field Values
      • AUTHORIZATION_CHECK_REVOKE_AUTO

        public static final 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. 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.

        See Also:
        Constant Field Values
      • processEngineName

        protected String processEngineName
      • idBlockSize

        protected int idBlockSize
      • history

        protected String history
      • jobExecutorActivate

        protected boolean jobExecutorActivate
      • jobExecutorDeploymentAware

        protected boolean jobExecutorDeploymentAware
      • jobExecutorPreferTimerJobs

        protected boolean jobExecutorPreferTimerJobs
      • jobExecutorAcquireByDueDate

        protected boolean jobExecutorAcquireByDueDate
      • jobExecutorAcquireByPriority

        protected boolean jobExecutorAcquireByPriority
      • ensureJobDueDateNotNull

        protected boolean ensureJobDueDateNotNull
      • producePrioritizedJobs

        protected boolean producePrioritizedJobs
      • producePrioritizedExternalTasks

        protected boolean producePrioritizedExternalTasks
      • hintJobExecutor

        protected boolean hintJobExecutor
        The flag will be used inside the method "JobManager#send()". It will be used to decide whether to notify the job executor that a new job has been created. It will be used for performance improvement, so that the new job could be executed in some situations immediately.
      • mailServerHost

        protected String mailServerHost
      • mailServerUsername

        protected String mailServerUsername
      • mailServerPassword

        protected String mailServerPassword
      • mailServerPort

        protected int mailServerPort
      • useTLS

        protected boolean useTLS
      • mailServerDefaultFrom

        protected String mailServerDefaultFrom
      • databaseType

        protected String databaseType
      • databaseVendor

        protected String databaseVendor
      • databaseVersion

        protected String databaseVersion
      • databaseSchemaUpdate

        protected String databaseSchemaUpdate
      • jdbcDriver

        protected String jdbcDriver
      • jdbcUrl

        protected String jdbcUrl
      • jdbcUsername

        protected String jdbcUsername
      • jdbcPassword

        protected String jdbcPassword
      • dataSourceJndiName

        protected String dataSourceJndiName
      • 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
      • transactionsExternallyManaged

        protected boolean transactionsExternallyManaged
      • jdbcStatementTimeout

        protected Integer jdbcStatementTimeout
        the number of seconds the jdbc driver will wait for a response from the database
      • jdbcBatchProcessing

        protected boolean jdbcBatchProcessing
      • jpaPersistenceUnitName

        protected String jpaPersistenceUnitName
      • jpaEntityManagerFactory

        protected Object jpaEntityManagerFactory
      • jpaHandleTransaction

        protected boolean jpaHandleTransaction
      • jpaCloseEntityManager

        protected boolean jpaCloseEntityManager
      • defaultNumberOfRetries

        protected int defaultNumberOfRetries
      • createIncidentOnFailedJobEnabled

        protected boolean createIncidentOnFailedJobEnabled
      • enablePasswordPolicy

        protected boolean enablePasswordPolicy
        configuration of password policy
      • authorizationEnabled

        protected boolean authorizationEnabled
        switch for controlling whether the process engine performs authorization checks. The default value is false.
      • defaultUserPermissionNameForTask

        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.
      • authorizationEnabledForCustomCode

        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.

      • tenantCheckEnabled

        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.
      • authorizationCheckRevokes

        protected String authorizationCheckRevokes
      • generalResourceWhitelistPattern

        protected String generalResourceWhitelistPattern
        A parameter used for defining acceptable values for the User, Group and Tenant IDs. The pattern can be defined by using the standard Java Regular Expression syntax should be used.

        By default only alphanumeric values (or 'camunda-admin') will be accepted.

      • userResourceWhitelistPattern

        protected String userResourceWhitelistPattern
        A parameter used for defining acceptable values for the User IDs. The pattern can be defined by using the standard Java Regular Expression syntax should be used.

        If not defined, the general pattern is used. Only alphanumeric values (or 'camunda-admin') will be accepted.

      • groupResourceWhitelistPattern

        protected String groupResourceWhitelistPattern
        A parameter used for defining acceptable values for the Group IDs. The pattern can be defined by using the standard Java Regular Expression syntax should be used.

        If not defined, the general pattern is used. Only alphanumeric values (or 'camunda-admin') will be accepted.

      • tenantResourceWhitelistPattern

        protected String tenantResourceWhitelistPattern
        A parameter used for defining acceptable values for the Tenant IDs. The pattern can be defined by using the standard Java Regular Expression syntax should be used.

        If not defined, the general pattern is used. Only alphanumeric values (or 'camunda-admin') will be accepted.

      • enableExceptionsAfterUnhandledBpmnError

        protected boolean enableExceptionsAfterUnhandledBpmnError
        If the value of this flag is set true then the process engine throws ProcessEngineException when no catching boundary event was defined for an error event.

        The default value is false.

      • skipHistoryOptimisticLockingExceptions

        protected boolean skipHistoryOptimisticLockingExceptions
        If the value of this flag is set to false, OptimisticLockingExceptions are not skipped for UPDATE or DELETE operations applied to historic entities.

        The default value is true.

      • enforceSpecificVariablePermission

        protected boolean enforceSpecificVariablePermission
        If the value of this flag is set to true, READ_INSTANCE_VARIABLE, READ_HISTORY_VARIABLE, or READ_TASK_VARIABLE on Process Definition resource, and READ_VARIABLE on Task resource READ_VARIABLE on Historic Task Instance resource will be required to fetch variables when the authorizations are enabled.
      • disabledPermissions

        protected List<String> disabledPermissions
        Specifies which permissions will not be taken into account in the authorizations checks if authorization is enabled.
      • enableCmdExceptionLogging

        protected boolean enableCmdExceptionLogging
        If the value of this flag is set to false exceptions that occur during command execution will not be logged before re-thrown. This can prevent multiple logs of the same exception (e.g. exceptions that occur during job execution) but can also hide valuable debugging/rootcausing information.
      • enableReducedJobExceptionLogging

        protected boolean enableReducedJobExceptionLogging
        If the value of this flag is set to true exceptions that occur during the execution of a job that still has retries left will not be logged. If the job does not have any retries left, the exception will still be logged on logging level WARN.
      • deserializationAllowedClasses

        protected String deserializationAllowedClasses
        Specifies which classes are allowed for deserialization
      • deserializationAllowedPackages

        protected String deserializationAllowedPackages
        Specifies which packages are allowed for deserialization
      • deserializationTypeValidationEnabled

        protected boolean deserializationTypeValidationEnabled
        Indicates whether type validation should be done before deserialization
      • installationId

        protected String installationId
        An unique installation identifier
      • skipOutputMappingOnCanceledActivities

        protected boolean skipOutputMappingOnCanceledActivities
        On failing activities we can skip output mapping. This might be helpful if output mapping uses variables that might not be available on failure (e.g. with external tasks or RPA tasks).
    • Constructor Detail

      • ProcessEngineConfiguration

        protected ProcessEngineConfiguration()
        use one of the static createXxxx methods instead
    • Method Detail

      • buildProcessEngine

        public abstract ProcessEngine buildProcessEngine()
      • createProcessEngineConfigurationFromResourceDefault

        public static ProcessEngineConfiguration createProcessEngineConfigurationFromResourceDefault()
      • createStandaloneProcessEngineConfiguration

        public static ProcessEngineConfiguration createStandaloneProcessEngineConfiguration()
      • createStandaloneInMemProcessEngineConfiguration

        public static ProcessEngineConfiguration createStandaloneInMemProcessEngineConfiguration()
      • getProcessEngineName

        public String getProcessEngineName()
      • getIdBlockSize

        public int getIdBlockSize()
      • getHistory

        public String getHistory()
      • getMailServerHost

        public String getMailServerHost()
      • getMailServerUsername

        public String getMailServerUsername()
      • getMailServerPassword

        public String getMailServerPassword()
      • getMailServerPort

        public int getMailServerPort()
      • getMailServerUseTLS

        public boolean getMailServerUseTLS()
      • getMailServerDefaultFrom

        public String getMailServerDefaultFrom()
      • getDatabaseType

        public String getDatabaseType()
      • getDatabaseVendor

        public String getDatabaseVendor()
      • getDatabaseVersion

        public String getDatabaseVersion()
      • getDatabaseSchemaUpdate

        public String getDatabaseSchemaUpdate()
      • getDataSource

        public DataSource getDataSource()
      • setSchemaOperationsCommand

        public void setSchemaOperationsCommand​(SchemaOperationsCommand schemaOperationsCommand)
      • getJdbcDriver

        public String getJdbcDriver()
      • getJdbcUrl

        public String getJdbcUrl()
      • getJdbcUsername

        public String getJdbcUsername()
      • getJdbcPassword

        public String getJdbcPassword()
      • isTransactionsExternallyManaged

        public boolean isTransactionsExternallyManaged()
      • setTransactionsExternallyManaged

        public ProcessEngineConfiguration setTransactionsExternallyManaged​(boolean transactionsExternallyManaged)
      • getJdbcMaxActiveConnections

        public int getJdbcMaxActiveConnections()
      • getJdbcMaxIdleConnections

        public int getJdbcMaxIdleConnections()
      • getJdbcMaxCheckoutTime

        public int getJdbcMaxCheckoutTime()
      • getJdbcMaxWaitTime

        public int getJdbcMaxWaitTime()
      • isJdbcPingEnabled

        public boolean isJdbcPingEnabled()
      • getJdbcPingQuery

        public String getJdbcPingQuery()
      • getJdbcPingConnectionNotUsedFor

        public int getJdbcPingConnectionNotUsedFor()
      • getJdbcStatementTimeout

        public Integer getJdbcStatementTimeout()
        Gets the number of seconds the jdbc driver will wait for a response from the database.
      • setJdbcStatementTimeout

        public ProcessEngineConfiguration setJdbcStatementTimeout​(Integer jdbcStatementTimeout)
        Sets the number of seconds the jdbc driver will wait for a response from the database.
      • isJdbcBatchProcessing

        public boolean isJdbcBatchProcessing()
      • isJobExecutorActivate

        public boolean isJobExecutorActivate()
      • isJobExecutorDeploymentAware

        public boolean isJobExecutorDeploymentAware()
      • setJobExecutorDeploymentAware

        public ProcessEngineConfiguration setJobExecutorDeploymentAware​(boolean jobExecutorDeploymentAware)
      • isJobExecutorAcquireByDueDate

        public boolean isJobExecutorAcquireByDueDate()
      • setJobExecutorAcquireByDueDate

        public ProcessEngineConfiguration setJobExecutorAcquireByDueDate​(boolean jobExecutorAcquireByDueDate)
      • isJobExecutorPreferTimerJobs

        public boolean isJobExecutorPreferTimerJobs()
      • setJobExecutorPreferTimerJobs

        public ProcessEngineConfiguration setJobExecutorPreferTimerJobs​(boolean jobExecutorPreferTimerJobs)
      • isHintJobExecutor

        public boolean isHintJobExecutor()
      • getJpaEntityManagerFactory

        public Object getJpaEntityManagerFactory()
      • isJpaHandleTransaction

        public boolean isJpaHandleTransaction()
      • isJpaCloseEntityManager

        public boolean isJpaCloseEntityManager()
      • getJpaPersistenceUnitName

        public String getJpaPersistenceUnitName()
      • setJpaPersistenceUnitName

        public void setJpaPersistenceUnitName​(String jpaPersistenceUnitName)
      • getDataSourceJndiName

        public String getDataSourceJndiName()
      • setDataSourceJndiName

        public void setDataSourceJndiName​(String dataSourceJndiName)
      • isCreateIncidentOnFailedJobEnabled

        public boolean isCreateIncidentOnFailedJobEnabled()
      • setCreateIncidentOnFailedJobEnabled

        public ProcessEngineConfiguration setCreateIncidentOnFailedJobEnabled​(boolean createIncidentOnFailedJobEnabled)
      • isAuthorizationEnabled

        public boolean isAuthorizationEnabled()
      • getDefaultUserPermissionNameForTask

        public String getDefaultUserPermissionNameForTask()
      • isAuthorizationEnabledForCustomCode

        public boolean isAuthorizationEnabledForCustomCode()
      • setAuthorizationEnabledForCustomCode

        public ProcessEngineConfiguration setAuthorizationEnabledForCustomCode​(boolean authorizationEnabledForCustomCode)
      • isTenantCheckEnabled

        public boolean isTenantCheckEnabled()
      • getGeneralResourceWhitelistPattern

        public String getGeneralResourceWhitelistPattern()
      • setGeneralResourceWhitelistPattern

        public void setGeneralResourceWhitelistPattern​(String generalResourceWhitelistPattern)
      • getUserResourceWhitelistPattern

        public String getUserResourceWhitelistPattern()
      • setUserResourceWhitelistPattern

        public void setUserResourceWhitelistPattern​(String userResourceWhitelistPattern)
      • getGroupResourceWhitelistPattern

        public String getGroupResourceWhitelistPattern()
      • setGroupResourceWhitelistPattern

        public void setGroupResourceWhitelistPattern​(String groupResourceWhitelistPattern)
      • getTenantResourceWhitelistPattern

        public String getTenantResourceWhitelistPattern()
      • setTenantResourceWhitelistPattern

        public void setTenantResourceWhitelistPattern​(String tenantResourceWhitelistPattern)
      • getDefaultNumberOfRetries

        public int getDefaultNumberOfRetries()
      • setDefaultNumberOfRetries

        public void setDefaultNumberOfRetries​(int defaultNumberOfRetries)
      • isEnsureJobDueDateNotNull

        public boolean isEnsureJobDueDateNotNull()
      • setEnsureJobDueDateNotNull

        public void setEnsureJobDueDateNotNull​(boolean ensureJobDueDateNotNull)
      • isProducePrioritizedJobs

        public boolean isProducePrioritizedJobs()
      • setProducePrioritizedJobs

        public void setProducePrioritizedJobs​(boolean producePrioritizedJobs)
      • isJobExecutorAcquireByPriority

        public boolean isJobExecutorAcquireByPriority()
      • setJobExecutorAcquireByPriority

        public void setJobExecutorAcquireByPriority​(boolean jobExecutorAcquireByPriority)
      • isProducePrioritizedExternalTasks

        public boolean isProducePrioritizedExternalTasks()
      • setProducePrioritizedExternalTasks

        public void setProducePrioritizedExternalTasks​(boolean producePrioritizedExternalTasks)
      • setAuthorizationCheckRevokes

        public void setAuthorizationCheckRevokes​(String authorizationCheckRevokes)
      • getAuthorizationCheckRevokes

        public String getAuthorizationCheckRevokes()
      • isEnableExceptionsAfterUnhandledBpmnError

        public boolean isEnableExceptionsAfterUnhandledBpmnError()
      • setEnableExceptionsAfterUnhandledBpmnError

        public void setEnableExceptionsAfterUnhandledBpmnError​(boolean enableExceptionsAfterUnhandledBpmnError)
      • isSkipHistoryOptimisticLockingExceptions

        public boolean isSkipHistoryOptimisticLockingExceptions()
      • setSkipHistoryOptimisticLockingExceptions

        public ProcessEngineConfiguration setSkipHistoryOptimisticLockingExceptions​(boolean skipHistoryOptimisticLockingExceptions)
      • isEnforceSpecificVariablePermission

        public boolean isEnforceSpecificVariablePermission()
      • setEnforceSpecificVariablePermission

        public void setEnforceSpecificVariablePermission​(boolean ensureSpecificVariablePermission)
      • getDisabledPermissions

        public List<String> getDisabledPermissions()
      • setDisabledPermissions

        public void setDisabledPermissions​(List<String> disabledPermissions)
      • isEnablePasswordPolicy

        public boolean isEnablePasswordPolicy()
      • isEnableCmdExceptionLogging

        public boolean isEnableCmdExceptionLogging()
      • setEnableCmdExceptionLogging

        public ProcessEngineConfiguration setEnableCmdExceptionLogging​(boolean enableCmdExceptionLogging)
      • isEnableReducedJobExceptionLogging

        public boolean isEnableReducedJobExceptionLogging()
      • setEnableReducedJobExceptionLogging

        public ProcessEngineConfiguration setEnableReducedJobExceptionLogging​(boolean enableReducedJobExceptionLogging)
      • getDeserializationAllowedClasses

        public String getDeserializationAllowedClasses()
      • getDeserializationAllowedPackages

        public String getDeserializationAllowedPackages()
      • isDeserializationTypeValidationEnabled

        public boolean isDeserializationTypeValidationEnabled()
      • setDeserializationTypeValidationEnabled

        public ProcessEngineConfiguration setDeserializationTypeValidationEnabled​(boolean deserializationTypeValidationEnabled)
      • getInstallationId

        public String getInstallationId()
      • isSkipOutputMappingOnCanceledActivities

        public boolean isSkipOutputMappingOnCanceledActivities()
      • setSkipOutputMappingOnCanceledActivities

        public void setSkipOutputMappingOnCanceledActivities​(boolean skipOutputMappingOnCanceledActivities)