Skip to content

addEventRegistryConsumer

Flowable 7.1.0 摘要:

方法签名与说明

void addEventRegistryConsumer (org.flowable.eventregistry.api.EventRegistryEventConsumer eventConsumer)

常见使用场景

  • 将事件消费逻辑注册到引擎。
  • 在事件总线中动态启停消费者。

Kotlin 调用示例

kotlin
val eventConsumer = taskService.getTaskEvents("TASK-001").first()

runtimeService.addEventRegistryConsumer(eventConsumer)

注意事项

  • 事件消费者逻辑应支持幂等。
  • 移除消费者后记得清理外部资源。
  • 调用前请确认当前用户具备相应的任务/流程操作权限。
  • 本文基于 Flowable 7.1.0 Javadoc。

相关 API

  • addEventRegistryConsumer
  • removeEventRegistryConsumer