Package org.flowable.eventregistry.api

# Interface EventRegistry

public interface EventRegistry
Central registry for events that are received through external channels through a `InboundEventChannelAdapter` and then passed through as a event registry event.

Author:
  Joram Barrez

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `eventReceived(org.flowable.eventregistry.model.InboundChannelModel channelModel, String event)`
  `void`
  `eventReceived(org.flowable.eventregistry.model.InboundChannelModel channelModel, InboundEvent event)`
  Events received in adapters should call this method to process events.
  `String`
  `generateKey(Map<String,Object> data)`
  Method to generate the unique key used to correlate an event.
  `OutboundEventProcessor`
  `getSystemOutboundEventProcessor()`
  `void`
  `registerEventRegistryEventConsumer(EventRegistryEventConsumer eventRegistryEventBusConsumer)`
  Registers a `EventRegistryEventConsumer` instance (a consumer of event registry events which is created by any of the engines).
  `void`
  `removeFlowableEventRegistryEventConsumer(EventRegistryEventConsumer eventRegistryEventBusConsumer)`
  Removes the event consumer from the event registry
  `void`
  `sendEventOutbound(EventInstance eventInstance, Collection<org.flowable.eventregistry.model.ChannelModel> channelModels)`
  Send out the `eventInstance` via the given `channelModel`(s).
  `void`
  `sendEventToConsumers(EventRegistryEvent eventRegistryEvent)`
  Send an event to all the registered event consumers.
  `void`
  `sendSystemEventOutbound(EventInstance eventInstance)`
  Send out the `eventInstance` via the given system `OutboundEventProcessor`.
  `void`
  `setInboundEventProcessor(InboundEventProcessor inboundEventProcessor)`
  The `InboundEventProcessor` is responsible for handling any new event.
  `void`
  `setOutboundEventProcessor(OutboundEventProcessor outboundEventProcessor)`
  The `OutboundEventProcessor` is responsible for handling sending out events.
  `void`
  `setSystemOutboundEventProcessor(OutboundEventProcessor outboundEventProcessor)`
  The `OutboundEventProcessor` is responsible for handling sending system out events.

- ## Method Details

  - ### setInboundEventProcessor

    void setInboundEventProcessor(InboundEventProcessor inboundEventProcessor)
    The `InboundEventProcessor` is responsible for handling any new event. The event registry will simply pass any event it receives to this instance.

  - ### setOutboundEventProcessor

    void setOutboundEventProcessor(OutboundEventProcessor outboundEventProcessor)
    The `OutboundEventProcessor` is responsible for handling sending out events. The event registry will simply pass any event it needs to send to this instance.

  - ### getSystemOutboundEventProcessor

    OutboundEventProcessor getSystemOutboundEventProcessor()

  - ### setSystemOutboundEventProcessor

    void setSystemOutboundEventProcessor(OutboundEventProcessor outboundEventProcessor)
    The `OutboundEventProcessor` is responsible for handling sending system out events. The event registry will simply pass any event it needs to send to this instance.

  - ### registerEventRegistryEventConsumer

    void registerEventRegistryEventConsumer(EventRegistryEventConsumer eventRegistryEventBusConsumer)
    Registers a `EventRegistryEventConsumer` instance (a consumer of event registry events which is created by any of the engines).

  - ### removeFlowableEventRegistryEventConsumer

    void removeFlowableEventRegistryEventConsumer(EventRegistryEventConsumer eventRegistryEventBusConsumer)
    Removes the event consumer from the event registry

  - ### generateKey

    String generateKey(Map<String,Object> data)
    Method to generate the unique key used to correlate an event.
    Parameters:
      `data` - data information used to generate the key (must not be `null`)
    Returns:
      a unique string correlating the event based on the information supplied

  - ### eventReceived

    void eventReceived(org.flowable.eventregistry.model.InboundChannelModel channelModel, String event)

  - ### eventReceived

    void eventReceived(org.flowable.eventregistry.model.InboundChannelModel channelModel, InboundEvent event)
    Events received in adapters should call this method to process events.

  - ### sendEventToConsumers

    void sendEventToConsumers(EventRegistryEvent eventRegistryEvent)
    Send an event to all the registered event consumers.

  - ### sendSystemEventOutbound

    void sendSystemEventOutbound(EventInstance eventInstance)
    Send out the `eventInstance` via the given system `OutboundEventProcessor`.

  - ### sendEventOutbound

    void sendEventOutbound(EventInstance eventInstance, Collection<org.flowable.eventregistry.model.ChannelModel> channelModels)
    Send out the `eventInstance` via the given `channelModel`(s).