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

    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
      • 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
      • 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
      • 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
      • transactionsExternallyManaged

        protected boolean transactionsExternallyManaged
      • jpaPersistenceUnitName

        protected String jpaPersistenceUnitName
      • jpaEntityManagerFactory

        protected Object jpaEntityManagerFactory
      • jpaHandleTransaction

        protected boolean jpaHandleTransaction
      • jpaCloseEntityManager

        protected boolean jpaCloseEntityManager
      • clock

        protected Clock clock
      • 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 use 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.

        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
      • useClassForNameClassLoading

        protected boolean useClassForNameClassLoading
        Either use Class.forName or ClassLoader.loadClass for class loading. See http://forums.activiti.org/content/reflectutilloadclass-and-custom- classloader
      • enableProcessDefinitionInfoCache

        protected boolean enableProcessDefinitionInfoCache
      • copyVariablesToLocalForTasks

        protected boolean copyVariablesToLocalForTasks
    • Constructor Detail

      • ProcessEngineConfiguration

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