signed

QiShunwang

“诚信为本、客户至上”

Flowable 6.6.0 BPMN用户指南-(2)配置 - 2.11 ~ 2.15

2020/12/28 6:58:21   来源:

《Flowable 6.6.0 BPMN用户指南》

2. 配置

  • 2.1 创建ProcessEngine
  • 2.2 ProcessEngineConfiguration Bean
  • 2.3 数据库配置
  • 2.4 JNDI数据源配置
  • 2.5 支持的数据库
  • 2.6 创建数据库表
  • 2.7 数据库表名说明
  • 2.8 数据库升级
  • 2.9 作业执行器
  • 2.10 作业执行器激活
  • 2.11 邮件服务器配置
  • 2.12 历史(History)配置
  • 2.13 异步历史配置(Async history configuration)
  • 2.14 在表达式和脚本中暴露bean
  • 2.15 部署缓存配置
  • 2.16 日志
  • 2.17 映射诊断上下文
  • 2.18 事件处理器(Event handlers)
    • 2.18.1 事件侦听器(event-listener)实现
    • 2.18.2 配置和设置
    • 2.18.3 运行时增加侦听器
    • 2.18.4 向流程定义增加侦听器
    • 2.18.5 通过API分发事件
    • 2.18.6 支持的事件类型
    • 2.18.7 附加说明

Flowable 6.6.0 用户指南相关文档下载

《精编Flowable 6.6.0 应用程序指南中文PDF版》
《精编Flowable 6.6.0 表单用户指南中文PDF版》

有关Flowable文档的其他资料,参见:

《Flowable文档大全》

2.11 邮件服务器配置

Configuring a mail server is optional. Flowable supports sending e-mails in business processes. To actually send an e-mail, a valid SMTP mail server configuration is required. See the e-mail task for the configuration options.

配置邮件服务器是可选的。Flowable支持在业务流程中发送电子邮件。要实际发送电子邮件,需要完成有效的SMTP邮件服务器配置。有关配置选项,请参阅电子邮件任务。

2.12 历史(History)配置

Customizing the configuration of history storage is optional. This allows you to tweak settings that influence the history capabilities of the engine. See history configuration for more details.

自定义历史存储的配置是可选的。这允许您调整引擎历史记录能力(history capabilities)的设置。有关详细信息,请参阅历史配置(history configuration)。

<property name="history" value="audit" />

2.13 异步历史配置(Async history configuration)

[Experimental] Since Flowable 6.1.0 the async history feature has been added. When async history is enabled, the historic data will be persisted by a history job executor, instead of synchronous persistence as part of the runtime execution persistence. See async history configuration for more details.

[实验性]自Flowable 6.1.0以来,添加了异步历史特性(async history feature)。当启用异步历史时,历史数据将由历史作业执行器(history job executor)持久化,而不是作为运行时执行持久化(runtime execution persistence)的一部分进行同步持久化(synchronous persistence)。有关详细信息,请参阅异步历史配置(async history configuration)。

<property name="asyncHistoryEnabled" value="true" />

2.14 在表达式和脚本中暴露bean

By default, all beans that you specify in the flowable.cfg.xml configuration or in your own Spring configuration file are available to expressions and scripts. If you want to limit the visibility of beans in your configuration file, you can configure a property called beans in your process engine configuration. The beans property in ProcessEngineConfiguration is a map. When you specify that property, only beans specified in that map will be visible to expressions and scripts. The exposed beans will be exposed with the names as you specify in the map.

默认情况下,在flowable.cfg.xml配置的或在您自己Spring配置文件中指定的全部bean都可用于表达式和脚本(expressions and scripts)。如果要限制bean在配置文件中的可见性,可以在流程引擎配置中配置一个名为beans的属性。ProcessEngineConfiguration中的beans属性是一个map。当指定该属性时,只有在该map中指定的beans才对表达式和脚本可见。暴露的bean将使用您在映射中指定的名称进行暴露。

2.15 部署缓存配置

All process definitions are cached (after they’re parsed) to avoid hitting the database every time a process definition is needed and because process definition data doesn’t change. By default, there is no limit on this cache. To limit the process definition cache, add following property:
因为流程定义数据不会改变,所以所有的流程定义都会被缓存(在解析之后),以避免每次需要流程定义时都会访问数据库。默认情况下,此缓存没有限制。要限制流程定义缓存,请添加以下属性:

<property name="processDefinitionCacheLimit" value="10" />

Setting this property will swap the default hashmap cache with a LRU cache that has the provided hard limit. Of course, the ‘best’ value for this property depends on the total amount of process definitions stored and the number of process definitions actually used at runtime by all the runtime process instances.

设置此属性可将默认的hashmap缓存替换为具有严格限制的LRU缓存。当然,此属性的“最佳”值取决于存储的流程定义的总量,以及所有运行时流程实例(runtime process instance)在运行时(at runtime)实际使用的流程定义的数量(the number of process definitions)。

You can also inject your own cache implementation. This must be a bean that implements the org.flowable.engine.impl.persistence.deploy.DeploymentCache interface:

您还可以注入自己的缓存实现。这必须是一个实现org.flowable.engine.impl.persistence.deploy.DeploymentCache接口的bean:

<property name="processDefinitionCache">
  <bean class="org.flowable.MyCache" />
</property>

There is a similar property called knowledgeBaseCacheLimit and knowledgeBaseCache for configuring the rules cache. This is only needed when you use the rules task in your processes.

类似的属性knowledgeBaseCacheLimit和knowledgeBaseCache用于配置规则缓存(rules cache)。只有当您在流程中使用规则任务时(rules task),才需要这样做。