Class ProcessEngineConfiguration


  • public abstract class ProcessEngineConfiguration
    extends org.flowable.common.engine.impl.AbstractEngineConfiguration
    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/flowable) in standalone mode. Standalone mode means that the process engine 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/flowable) in standalone mode. The DB schema strategy default is in this case create-drop. Standalone mode means that Flowable 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

      • processEngineName

        protected String processEngineName
      • idBlockSize

        protected int idBlockSize
      • history

        protected String history
      • asyncExecutorActivate

        protected boolean asyncExecutorActivate
      • asyncHistoryExecutorActivate

        protected boolean asyncHistoryExecutorActivate
      • mailServerHost

        protected String mailServerHost
      • mailServerUsername

        protected String mailServerUsername
      • mailServerPassword

        protected String mailServerPassword
      • mailServerPort

        protected int mailServerPort
      • mailServerSSLPort

        protected int mailServerSSLPort
      • useSSL

        protected boolean useSSL
      • useTLS

        protected boolean useTLS
      • mailServerDefaultFrom

        protected String mailServerDefaultFrom
      • mailServerForceTo

        protected String mailServerForceTo
      • mailServerDefaultCharset

        protected Charset mailServerDefaultCharset
      • mailSessionJndi

        protected String mailSessionJndi
      • mailServers

        protected Map<String,​org.flowable.common.engine.impl.cfg.mail.MailServerInfo> mailServers
      • historyLevel

        protected org.flowable.common.engine.impl.history.HistoryLevel historyLevel
      • enableProcessDefinitionHistoryLevel

        protected boolean enableProcessDefinitionHistoryLevel
      • jpaPersistenceUnitName

        protected String jpaPersistenceUnitName
      • jpaEntityManagerFactory

        protected Object jpaEntityManagerFactory
      • jpaHandleTransaction

        protected boolean jpaHandleTransaction
      • jpaCloseEntityManager

        protected boolean jpaCloseEntityManager
      • asyncExecutor

        protected org.flowable.job.service.impl.asyncexecutor.AsyncExecutor asyncExecutor
      • asyncTaskExecutor

        protected org.flowable.common.engine.api.async.AsyncTaskExecutor asyncTaskExecutor
      • shutdownAsyncTaskExecutor

        protected boolean shutdownAsyncTaskExecutor
      • asyncTaskInvoker

        protected org.flowable.common.engine.api.async.AsyncTaskInvoker asyncTaskInvoker
      • asyncHistoryExecutor

        protected org.flowable.job.service.impl.asyncexecutor.AsyncExecutor asyncHistoryExecutor
      • asyncHistoryTaskExecutor

        protected org.flowable.common.engine.api.async.AsyncTaskExecutor asyncHistoryTaskExecutor
      • shutdownAsyncHistoryTaskExecutor

        protected boolean shutdownAsyncHistoryTaskExecutor
      • 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
      • processDiagramGenerator

        protected org.flowable.image.ProcessDiagramGenerator processDiagramGenerator
        Process diagram generator. Default value is DefaultProcessDiagramGenerator
      • isCreateDiagramOnDeploy

        protected boolean isCreateDiagramOnDeploy
      • alwaysUseArraysForDmnMultiHitPolicies

        protected boolean alwaysUseArraysForDmnMultiHitPolicies
      • drawSequenceFlowNameWithNoLabelDI

        protected boolean drawSequenceFlowNameWithNoLabelDI
        include the sequence flow name in case there's no Label DI,
      • defaultCamelContext

        protected String defaultCamelContext
      • activityFontName

        protected String activityFontName
      • labelFontName

        protected String labelFontName
      • annotationFontName

        protected String annotationFontName
      • enableProcessDefinitionInfoCache

        protected boolean enableProcessDefinitionInfoCache
      • enableHistoryCleaning

        protected boolean enableHistoryCleaning
      • historyCleaningTimeCycleConfig

        protected String historyCleaningTimeCycleConfig
      • cleanInstancesEndedAfterNumberOfDays

        protected int cleanInstancesEndedAfterNumberOfDays
      • taskPostProcessor

        protected org.flowable.task.service.TaskPostProcessor taskPostProcessor
        postprocessor for a task builder
    • 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()
      • getRuntimeService

        public abstract RuntimeService getRuntimeService()
      • getFormService

        public abstract FormService getFormService()
      • getTaskService

        public abstract TaskService getTaskService()
      • getHistoryService

        public abstract HistoryService getHistoryService()
      • getIdentityService

        public abstract IdentityService getIdentityService()
      • getEngineName

        public String getEngineName()
        Specified by:
        getEngineName in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • getIdBlockSize

        public int getIdBlockSize()
      • getHistory

        public String getHistory()
      • getMailServerHost

        public String getMailServerHost()
      • getMailServerUsername

        public String getMailServerUsername()
      • getMailServerPassword

        public String getMailServerPassword()
      • getMailSessionJndi

        public String getMailSessionJndi()
      • getMailServerPort

        public int getMailServerPort()
      • getMailServerDefaultCharset

        public Charset getMailServerDefaultCharset()
      • getMailServerSSLPort

        public int getMailServerSSLPort()
      • getMailServerUseSSL

        public boolean getMailServerUseSSL()
      • getMailServerUseTLS

        public boolean getMailServerUseTLS()
      • getMailServerDefaultFrom

        public String getMailServerDefaultFrom()
      • getMailServerForceTo

        public String getMailServerForceTo()
      • getMailServer

        public org.flowable.common.engine.impl.cfg.mail.MailServerInfo getMailServer​(String tenantId)
      • getMailServers

        public Map<String,​org.flowable.common.engine.impl.cfg.mail.MailServerInfo> getMailServers()
      • getMailSessionJndi

        public String getMailSessionJndi​(String tenantId)
      • setHttpClientConfig

        public void setHttpClientConfig​(HttpClientConfig httpClientConfig)
      • setDatabaseType

        public ProcessEngineConfiguration setDatabaseType​(String databaseType)
        Overrides:
        setDatabaseType in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setDatabaseSchemaUpdate

        public ProcessEngineConfiguration setDatabaseSchemaUpdate​(String databaseSchemaUpdate)
        Overrides:
        setDatabaseSchemaUpdate in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setDataSource

        public ProcessEngineConfiguration setDataSource​(DataSource dataSource)
        Overrides:
        setDataSource in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setJdbcDriver

        public ProcessEngineConfiguration setJdbcDriver​(String jdbcDriver)
        Overrides:
        setJdbcDriver in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setJdbcUrl

        public ProcessEngineConfiguration setJdbcUrl​(String jdbcUrl)
        Overrides:
        setJdbcUrl in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setJdbcUsername

        public ProcessEngineConfiguration setJdbcUsername​(String jdbcUsername)
        Overrides:
        setJdbcUsername in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setJdbcPassword

        public ProcessEngineConfiguration setJdbcPassword​(String jdbcPassword)
        Overrides:
        setJdbcPassword in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setTransactionsExternallyManaged

        public ProcessEngineConfiguration setTransactionsExternallyManaged​(boolean transactionsExternallyManaged)
        Overrides:
        setTransactionsExternallyManaged in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • getHistoryLevel

        public org.flowable.common.engine.impl.history.HistoryLevel getHistoryLevel()
      • setHistoryLevel

        public ProcessEngineConfiguration setHistoryLevel​(org.flowable.common.engine.impl.history.HistoryLevel historyLevel)
      • isEnableProcessDefinitionHistoryLevel

        public boolean isEnableProcessDefinitionHistoryLevel()
      • setEnableProcessDefinitionHistoryLevel

        public ProcessEngineConfiguration setEnableProcessDefinitionHistoryLevel​(boolean enableProcessDefinitionHistoryLevel)
      • setJdbcMaxActiveConnections

        public ProcessEngineConfiguration setJdbcMaxActiveConnections​(int jdbcMaxActiveConnections)
        Overrides:
        setJdbcMaxActiveConnections in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setJdbcMaxIdleConnections

        public ProcessEngineConfiguration setJdbcMaxIdleConnections​(int jdbcMaxIdleConnections)
        Overrides:
        setJdbcMaxIdleConnections in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setJdbcMaxCheckoutTime

        public ProcessEngineConfiguration setJdbcMaxCheckoutTime​(int jdbcMaxCheckoutTime)
        Overrides:
        setJdbcMaxCheckoutTime in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setJdbcMaxWaitTime

        public ProcessEngineConfiguration setJdbcMaxWaitTime​(int jdbcMaxWaitTime)
        Overrides:
        setJdbcMaxWaitTime in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setJdbcPingEnabled

        public ProcessEngineConfiguration setJdbcPingEnabled​(boolean jdbcPingEnabled)
        Overrides:
        setJdbcPingEnabled in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setJdbcPingQuery

        public ProcessEngineConfiguration setJdbcPingQuery​(String jdbcPingQuery)
        Overrides:
        setJdbcPingQuery in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setJdbcPingConnectionNotUsedFor

        public ProcessEngineConfiguration setJdbcPingConnectionNotUsedFor​(int jdbcPingNotUsedFor)
        Overrides:
        setJdbcPingConnectionNotUsedFor in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setJdbcDefaultTransactionIsolationLevel

        public ProcessEngineConfiguration setJdbcDefaultTransactionIsolationLevel​(int jdbcDefaultTransactionIsolationLevel)
        Overrides:
        setJdbcDefaultTransactionIsolationLevel in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • isAsyncExecutorActivate

        public boolean isAsyncExecutorActivate()
      • isAsyncHistoryExecutorActivate

        public boolean isAsyncHistoryExecutorActivate()
      • setAsyncHistoryExecutorActivate

        public ProcessEngineConfiguration setAsyncHistoryExecutorActivate​(boolean asyncHistoryExecutorActivate)
      • setClassLoader

        public ProcessEngineConfiguration setClassLoader​(ClassLoader classLoader)
        Overrides:
        setClassLoader in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setUseClassForNameClassLoading

        public ProcessEngineConfiguration setUseClassForNameClassLoading​(boolean useClassForNameClassLoading)
        Overrides:
        setUseClassForNameClassLoading in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • getJpaEntityManagerFactory

        public Object getJpaEntityManagerFactory()
      • isJpaHandleTransaction

        public boolean isJpaHandleTransaction()
      • isJpaCloseEntityManager

        public boolean isJpaCloseEntityManager()
      • getJpaPersistenceUnitName

        public String getJpaPersistenceUnitName()
      • setDataSourceJndiName

        public ProcessEngineConfiguration setDataSourceJndiName​(String dataSourceJndiName)
        Overrides:
        setDataSourceJndiName in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • getDefaultCamelContext

        public String getDefaultCamelContext()
      • isCreateDiagramOnDeploy

        public boolean isCreateDiagramOnDeploy()
      • isDrawSequenceFlowNameWithNoLabelDI

        public boolean isDrawSequenceFlowNameWithNoLabelDI()
      • setDrawSequenceFlowNameWithNoLabelDI

        public ProcessEngineConfiguration setDrawSequenceFlowNameWithNoLabelDI​(boolean drawSequenceFlowNameWithNoLabelDI)
      • getActivityFontName

        public String getActivityFontName()
      • getLabelFontName

        public String getLabelFontName()
      • getAnnotationFontName

        public String getAnnotationFontName()
      • setDatabaseTablePrefix

        public ProcessEngineConfiguration setDatabaseTablePrefix​(String databaseTablePrefix)
        Overrides:
        setDatabaseTablePrefix in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setTablePrefixIsSchema

        public ProcessEngineConfiguration setTablePrefixIsSchema​(boolean tablePrefixIsSchema)
        Overrides:
        setTablePrefixIsSchema in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setDatabaseWildcardEscapeCharacter

        public ProcessEngineConfiguration setDatabaseWildcardEscapeCharacter​(String databaseWildcardEscapeCharacter)
        Overrides:
        setDatabaseWildcardEscapeCharacter in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setDatabaseCatalog

        public ProcessEngineConfiguration setDatabaseCatalog​(String databaseCatalog)
        Overrides:
        setDatabaseCatalog in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setDatabaseSchema

        public ProcessEngineConfiguration setDatabaseSchema​(String databaseSchema)
        Overrides:
        setDatabaseSchema in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setXmlEncoding

        public ProcessEngineConfiguration setXmlEncoding​(String xmlEncoding)
        Overrides:
        setXmlEncoding in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • setClock

        public ProcessEngineConfiguration setClock​(org.flowable.common.engine.impl.runtime.Clock clock)
        Overrides:
        setClock in class org.flowable.common.engine.impl.AbstractEngineConfiguration
      • getProcessDiagramGenerator

        public org.flowable.image.ProcessDiagramGenerator getProcessDiagramGenerator()
      • setProcessDiagramGenerator

        public ProcessEngineConfiguration setProcessDiagramGenerator​(org.flowable.image.ProcessDiagramGenerator processDiagramGenerator)
      • getAsyncExecutor

        public org.flowable.job.service.impl.asyncexecutor.AsyncExecutor getAsyncExecutor()
      • setAsyncExecutor

        public ProcessEngineConfiguration setAsyncExecutor​(org.flowable.job.service.impl.asyncexecutor.AsyncExecutor asyncExecutor)
      • getAsyncTaskExecutor

        public org.flowable.common.engine.api.async.AsyncTaskExecutor getAsyncTaskExecutor()
      • setAsyncTaskExecutor

        public ProcessEngineConfiguration setAsyncTaskExecutor​(org.flowable.common.engine.api.async.AsyncTaskExecutor asyncTaskExecutor)
      • getAsyncTaskInvoker

        public org.flowable.common.engine.api.async.AsyncTaskInvoker getAsyncTaskInvoker()
      • setAsyncTaskInvoker

        public ProcessEngineConfiguration setAsyncTaskInvoker​(org.flowable.common.engine.api.async.AsyncTaskInvoker asyncTaskInvoker)
      • getAsyncHistoryExecutor

        public org.flowable.job.service.impl.asyncexecutor.AsyncExecutor getAsyncHistoryExecutor()
      • setAsyncHistoryExecutor

        public ProcessEngineConfiguration setAsyncHistoryExecutor​(org.flowable.job.service.impl.asyncexecutor.AsyncExecutor asyncHistoryExecutor)
      • getAsyncHistoryTaskExecutor

        public org.flowable.common.engine.api.async.AsyncTaskExecutor getAsyncHistoryTaskExecutor()
      • setAsyncHistoryTaskExecutor

        public ProcessEngineConfiguration setAsyncHistoryTaskExecutor​(org.flowable.common.engine.api.async.AsyncTaskExecutor asyncHistoryTaskExecutor)
      • getDefaultFailedJobWaitTime

        public int getDefaultFailedJobWaitTime()
      • getAsyncFailedJobWaitTime

        public int getAsyncFailedJobWaitTime()
      • isEnableProcessDefinitionInfoCache

        public boolean isEnableProcessDefinitionInfoCache()
      • setEnableProcessDefinitionInfoCache

        public ProcessEngineConfiguration setEnableProcessDefinitionInfoCache​(boolean enableProcessDefinitionInfoCache)
      • getTaskPostProcessor

        public org.flowable.task.service.TaskPostProcessor getTaskPostProcessor()
      • setTaskPostProcessor

        public void setTaskPostProcessor​(org.flowable.task.service.TaskPostProcessor processor)
      • isEnableHistoryCleaning

        public boolean isEnableHistoryCleaning()
      • getHistoryCleaningTimeCycleConfig

        public String getHistoryCleaningTimeCycleConfig()
      • getCleanInstancesEndedAfterNumberOfDays

        public int getCleanInstancesEndedAfterNumberOfDays()
      • setCleanInstancesEndedAfterNumberOfDays

        public ProcessEngineConfiguration setCleanInstancesEndedAfterNumberOfDays​(int cleanInstancesEndedAfterNumberOfDays)
      • isAlwaysUseArraysForDmnMultiHitPolicies

        public boolean isAlwaysUseArraysForDmnMultiHitPolicies()
      • setAlwaysUseArraysForDmnMultiHitPolicies

        public ProcessEngineConfiguration setAlwaysUseArraysForDmnMultiHitPolicies​(boolean alwaysUseArraysForDmnMultiHitPolicies)