Processors
A single event handler requires one processor. The following processors are available, each of which consumes events in different ways:
-
Batching event processor: Groups events by entity type then passes them to publishers in small groups.
The batch size is defined in
nme.eventHandler.publish.batchSize
in Runtime Parameters. Events are delivered to the publisher in batches so aggregation is not possible.The batching event processor is most suitable when faster reporting is required or when append storage databases are used.
-
Simple event processor: Passes events directly to the configured publishers (grouping events per operation). As all events are available, the simple event processor is suitable when aggregation of file outputs are required.
-
Grouping event processor: Groups related events before passing them to publishers.
The processor groups the events in a tree-like model similar to the relationship configuration defined in the logical model. One processor can contain multiple roots.
The root of each tree model is the entity for which related entities will be configured (the root is typically the central entity for a given domain, for example, Party in case of the MDM Example Project). Master entity-based roots can have both other master entities and instance entities as children. Instance entity-based roots can have other instance entities as children. Entities belonging to one group are sent to publishers together.
This article describes how to add a new event handler.
Prerequisites
-
Configure the instance layer model as described in Creating an Instance Layer Model using the top-down modeling approach (see Creating a Logical Model for more information).
-
Configure a master layer model as described in Creating a Master Data Layer Model using the top-down modeling approach (see Creating a Logical Model for more information).
-
Go to Output Interfaces > Event Handlers (right-click) > New Event Handler Definition.
-
Set the following parameters:
-
Class - Select the specific implementation of the data changes handler (
EventHandlerAsync
). -
Used Processor - Choose the processor: Batching event processor, Simple event processor, or Grouping event processor, and follow the relevant instructions.
-
Batching event processor configuration
-
Go to Output Interfaces > Event Handlers (right-click) > New Event Handler Definition.
-
Set the following parameters:
-
Class - Select the specific implementation of the data changes handler (
EventHandlerAsync
). -
Used Processor - Select
BatchingEventProcessor
. -
Name (optional) - Mame to distinguish between multiple event handlers. If no name is entered, the Class type is used by default, but if multiple event handlers exist, providing names is required.
-
Description (optional) - Description of the handler.
-
Enable - Activate or deactivate the event handler.
-
Persistence Type, DB Persistence Data Source, and DB Persistence Prefix - See [Event Handler Persistence].
-
Persistence Directory - Set a path to the folder for captured events before publishing.
-
Filter - Define a filter to preselect events (for example, only record updates).
-
General Filter Expression - A common filter based on metadata attributes: only the
meta
dot-source can be used here.A Boolean ONE expression can be specified. In that case, only the events for which the expression evaluates to
true
are accepted. For more information, see Event Handler, section Evaluation of ONE expressions. -
Filtered Entities - Define which entities should be monitored for data changes (events from all other entities are filtered out). Optionally, use a filter expression on the entity level:
meta
,new
, andold
dot-sources can be used here.Each entity can have its own
filterExpression
that works exactly like thefilterExpression
except all the data columns are available (old and new values of the changed records as well as metadata columns).
-
-
For example, the event handler can be configured to do the following: "Capture all changes to the first_name attribute in the party entity and send a message to the JMS queue". This would be useful, for example, if your organization is a bank, as changes to attributes like first name and ID card number are suspicious and should be tracked. |
-
Go to the Publishers tab to define different event distribution implementations to external systems.
-
Double-click the row number or select Add to add a new publisher. Select the desired publisher from the list of available options.
-
Enable the publisher by selecting the option.
-
Each publisher has to be configured to connect to external systems. For more information, see Publishers.
Simple event processor configuration
-
Go to Output Interfaces > Event Handlers (right-click) > New Event Handler Definition.
-
Set the following parameters:
-
Class - Select the specific implementation of the data changes handler (
EventHandlerAsync
). -
Used Processor - Select
SimpleEventProcessor
. -
Name (optional) - Name to distinguish between multiple event handlers.
-
Description (optional) - Description of the handler.
-
Enable - Activate or deactivate the event handler.
-
Persistence Type, DB Persistence Data Source, and DB Persistence Prefix - See Event handler persistence.
-
Persistence Directory - Set a path to the folder for captured events before publishing.
-
Filter - Define a filter to preselect events (for example, only record updates).
-
General Filter Expression - A common filter based on metadata attributes: only the
meta
dot-source can be used here.A Boolean ONE expression can be specified. In that case, only the events for which the expression evaluates to
true
are accepted. For more information, see Event Handler, section Evaluation of ONE expressions. -
Filtered Entities - Define which entities should be monitored for data changes (events from all other entities are filtered out). Optionally, use a filter expression on the entity level:
meta
,new
, andold
dot-sources can be used here.Each entity can have its own
filterExpression
that works exactly like thefilterExpression
except all the data columns are available (old and new values of the changed records as well as metadata columns).
-
-
-
Go to the Publishers tab to define different event distribution implementations to external systems.
-
Double-click the row number or select Add to add a new publisher. Select the desired publisher from the list of available options.
-
Enable the publisher by selecting the option.
-
Each publisher has to be configured to connect to external systems. For more information, see Publishers.
We recommend using the event plan publisher with the simple plan processor. See Publishers.
Grouping event processor configuration
It is possible to define the grouping event processor based on the traversing publisher configuration by choosing your traversing plan publisher in the Grouping Event Processor Settings. This requires having a defined traversing plan publisher beforehand. For more information, see Publishers, section Traversing plan publisher. |
-
Go to Output Interfaces > Event Handlers (right-click) > New Event Handler Definition.
-
Set the following parameters:
-
Class - Select the specific implementation of the data changes handler (
EventHandlerAsync
). -
Used Processor - Select the Grouping Event Processor.
-
Name - Optional name to distinguish between multiple event handlers.
-
Description - Pptional description of the handler.
-
Enable - Activate or deactivate the event handler.
-
Persistence Type, DB Persistence Data Source, and DB Persistence Prefix - See Event handler persistence.
-
Persistence Directory - Set a path to the folder for captured events before publishing.
-
Filter - Define a filter to preselect events (for example, only record updates).
-
General Filter Expression - A common filter based on metadata attributes: only the
meta
dot-source can be used here.A Boolean ONE expression can be specified. In that case, only the events for which the expression evaluates to
true
are accepted. For more information, see Event Handler, section Evaluation of ONE expressions. -
Filtered Entities - Define which entities should be monitored for data changes (events from all other entities are filtered out). Optionally, use a filter expression on the entity level:
meta
,new
, andold
dot-sources can be used here.Each entity can have its own
filterExpression
that works exactly like thefilterExpression
except all the data columns are available (old and new values of the changed records as well as metadata columns).
-
-
-
Open the Grouping Event Processor Settings tab to configure the entity tree model. Add a grouping event processor by clicking the asterisk (
*
) next to the empty row. -
To configure the tree model, choose whether you wish to configure it for an instance entity root or a master entity root. Choose the Master Entity Roots or Instance Entity Roots tables accordingly.
-
Select Add, or double-click the asterisk (
*
) in the table rows to create a new root. -
Use Ctrl+Space in the Name column to see a list of all available entities.
-
Double-click the first row space in the […] column to open the configuration for related entities.
-
Add the related entities by double-clicking the asterisk (
*
) in the table row and using Ctrl+Space to get a list of available child entities. -
Repeat steps 5-9 for as many roots as you wish to configure.
It is possible to configure more than one grouping event processor if necessary. -
Go to the Publishers tab to define different event distribution implementations to external systems.
-
Double-click the row number or select Add to add a new publisher. Select the desired publisher from the list of available options.
We recommend using the traversing plan publisher (see Publishers, section Traversing plan publisher) with the grouping event processor to remove duplicate results. -
Enable the publisher by selecting the option.
-
Each publisher has to be configured to connect to external systems. For more information, see Publishers.
Event handler persistence
Event handlers can use file persistence (default) or database persistence.
To define persistence for event handlers, go to Output interfaces > Event Handlers, select the event handler, right-click, and select Edit.
Select Persistence Type and fill in the necessary information. If you select DB Persistence, you need to define the DB Persistence Data Source and DB Persistence Prefix.
Database persistence is generally slower than file persistence but it is easier to make it highly available (by using an HA database). The following optimizations are available:
|
When switching the persistence type, ensure all events are published first. |
Was this page useful?