Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 2 Channels and Events : Event Preprocessors

Event Preprocessors
Event preprocessors are rule functions with one argument of type simple event. (Event preprocessors are not used for time or advisory events.) Event preprocessors are multithreaded. An event preprocessor is assigned to a destination and acts on all events arriving at that destination. Event preprocessors perform tasks after an incoming message arrives at the destination and is transformed into a simple event, but before it is asserted into the Rete network (if it is — events can be consumed in the event preprocessor).
TIBCO BusinessEvents Express  Content relating to Cache OM and backing store is not relevant to TIBCO BusinessEvents Express edition.
Time events do not go through an event preprocessor. If you are using Cache Only mode, take care when designing rules that execute as a result of a time event. For example, a rule that has a join condition using a time event and a concept would not execute if the concept is not loaded in the Rete network and so should not be used in an event preprocessor if the concept is configured as Cache ONly mode.
Acknowledgement  Events consumed in a preprocessor are acknowledged immediately (and not after the post RTC phase).
You can aggregate events, edit events, and perform other kinds of event enrichment in a preprocessor. You can also use preprocessors as explained below.
Setting locks if concurrency features are used
You must set locks in the preprocessor when concurrency features are used to protect concept instances during RTC. Locking ensures that updates to concept instances during an RTC do not conflict with another set of updates to the same concept instances in another RTC. Locks are released at the end of the RTC.
Loading Cache Only entities
If you are using the Cache Only mode for any entities, you must also load the relevant entities from the cache using an event preprocessor.
Improving project efficiency
You can also use preprocessors to improve performance by avoiding unnecessary RTCs in the inference engine. For example you can consume events that are not needed. Another way to use the preprocessor for efficient processing is to transfer an event’s contents to a new concept that is not processed by the agent's set of locally active rules. Such a concept is automatically asserted, does not trigger rules, and is saved into the cache (depending on OM configuration) where it is available for processing by any agent as needed.
Preprocessor Use Guidelines
Consuming events in a preprocessor is allowed  It can be useful in some applications and reduces the flow of messages into the Rete network. Such events are acknowledged immediately (if they require acknowledgement).
You can only modify events before they are asserted into the Rete network  Rule evaluation depends on event values at time of assertion, so values can be changed only before assertion, that is, in the preprocessor.
You can create concepts but not modify existing concepts  Modifying concepts that already exist in the system could disrupt an RTC. You can modify concepts that were created in the same preprocessor, however.
See Also
Loading Cache Only Objects into the Rete Network
Using Locks to Ensure Data Integrity Within and Across Agents

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved