Flowable 6.6.0 用户指南相关文档下载
- BPMN用户指南 第一部分 - 中文PDF精编版
- BPMN用户指南 第二部分 - 中文PDF精编版
- BPMN用户指南 第三部分 - 中文PDF精编版
- 应用程序指南 - 中文PDF精编版
- 应用程序指南 - 中英对照PDF精编版
- 应用程序指南 - Eclipse设计器中文PDF精编版
- 表单用户指南 - 中文PDF精编版
- 事件注册表用户指南 - 中文PDF精编版
《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)
有关Flowable文档的其他资料,参见:
2.18.5 通过API分发事件
We opened up the event-dispatching mechanism through the API, to allow you to dispatch custom events to any listeners that are registered in the engine. It’s recommended (although not enforced) to only dispatch FlowableEvents with type CUSTOM. Dispatching the event can be done using the RuntimeService:
我们通过API打开事件分派机制,允许您将自定义事件分派给引擎中注册的任何侦听器。建议(尽管不是强制的)只分派类型为CUSTOM的FlowableEvents。可以使用RuntimeService来分派事件:
/**
* Dispatches the given event to any listeners that are registered.
* @param event event to dispatch.
*
* @throws FlowableException if an exception occurs when dispatching the event or
* when the {@link FlowableEventDispatcher} is disabled.
* @throws FlowableIllegalArgumentException when the given event is not suitable for dispatching.
*/
void dispatchEvent(FlowableEvent event);
2.18.6 支持的事件类型
Listed below are all event types that can occur in the engine. Each type corresponds to an enum value in the org.flowable.engine.common.api.delegate.event.FlowableEventType.
下面列出了引擎中可能发生的所有事件类型。每个类型对应于一个org.flowable.engine.common.api.delegate.event.FlowableEventType中的枚举值。
All ENTITY_* events are related to entities inside the engine. The list below show an overview of what entity-events are dispatched for which entities:
所有ENTITY_*事件都与引擎内的实体相关。下面的列表概述了为哪些实体分派哪些实体事件:
- ENTITY_CREATED, ENTITY_INITIALIZED, ENTITY_DELETED: Attachment, Comment, Deployment, Execution, Group, IdentityLink, Job, Model, ProcessDefinition, ProcessInstance, Task, User.
- ENTITY_UPDATED: Attachment, Deployment, Execution, Group, IdentityLink, Job, Model, ProcessDefinition, ProcessInstance, Task, User.
- ENTITY_SUSPENDED, ENTITY_ACTIVATED: ProcessDefinition, ProcessInstance/Execution, Task.
2.18.7 附加说明
Listeners are only notified for events dispatched from the engine they are registered with. So if you have different engines - running against the same database - only events that originated in the engine the listener is registered to are dispatched to that listener. The events that occur in other engines are not dispatched to the listeners, regardless of whether they are running in the same JVM or not.
Certain event-types (related to entities) expose the targeted entity. Depending on the type or event, these entities cannot be updated anymore (for example, when the entity is deleted). If possible, use the EngineServices exposed by the event to interact in a safe way with the engine. Even then, you need to be cautious with updates/operations on entities that are involved in the dispatched event.
No entity-events are dispatched related to history, as they all have a runtime-counterpart that dispatch their events.
侦听器只会收到从其注册的引擎发送的事件的通知。因此,如果您有不同的引擎(针对同一个数据库运行),那么只有源于侦听器注册的引擎的事件才会被调度到该侦听器。在其他引擎中发生的事件不会被调度到侦听器,不管它们是否在同一个JVM中运行。
向特定的事件类型(与实体相关)暴露目标实体。取决于类型或事件,无法再更新这些实体(例如,当实体被删除时)。如果可能,使用事件暴露的EngineServices以安全的方式与引擎交互。即使如此,您仍然需要谨慎对待与分派事件有关的实体的更新/操作(updates/operations)。
不会分派与历史(history)相关的实体事件,因为它们都有一个运行时的对应方式来分派它们的事件。