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. They 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).
You can aggregate events, edit events, and perform other kinds of event enrichment in a preprocessor. You can also use preprocessors as explained below.
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.
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.
Consuming events in a preprocessor is allowed It can be useful in some applications and reduces the flow of messages into the Rete network.
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 or delete existing concepts Modifying or deleting concepts that already exist in the system could disrupt an RTC. You can modify or delete concepts that were created in the same preprocessor, however.