Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# Event Preprocessors

Event preprocessors are rule functions with one argument of type simple event.

Event preprocessors are not used for time or advisory events, and they 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).

Note:

- If you are using Cache Only or Store 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 or Store Only mode.
- 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.

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.

If you are using the Cache Only or Store Only mode for any entities, you must also load the relevant entities from the cache or store using an event preprocessor.

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, and does not trigger rules. It is saved into the cache or store (depending on OM configuration) where it is available for processing by any agent as needed.

## Preprocessor Usage Guidelines

Keep in mind several guidelines for using preprocessors.

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. You cannot add a existing concept as a child to a newly created concept in preprocessor, as it modifies the existing concept.
Note: Concepts created in a preprocessor are not asserted until the RTC starts. So, for example, after one event preprocessor ends and before its RTC begins, no other preprocessor can access the new concept.
Subtopics

Did you find this helpful?

YesNo
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO BusinessEvents® Enterprise Edition

Copyright © 2004-2024. Cloud Software Group, Inc. All Rights Reserved.