In this task, you configure a rule function that replies to the
request received from the HTTP channel. HTTP is a request-reply protocol,
and this step is required so that the HTTP server is ready to process the
next request from the readme.html
form. This rule
function executes when an event is received. (You’ll configure that
connection later.)
What is a rule function? A rule function is a function you write in the TIBCO BusinessEvents® Extreme rule language.
How are rule functions created and used? You write rule functions using the rule editor. You can use rule functions in rules and other rule functions, in event preprocessors, and as startup or shutdown functions.
What other types of functions are there? TIBCO BusinessEvents® Extreme provides a large library of functions for various purposes. In addition, an ontology function is automatically created for each concept and event in your project. These are constructor functions. Query functions are also automatically generated for each key defined on a concept. Another type of ontology function enables you to create and schedule a timed event. You can also add custom Java functions.
![]() | |
See Rules and Functions in TIBCO BusinessEvents® Extreme Application Architect’s Guide. Relevant chapters in the TIBCO BusinessEvents® Extreme Application Developer’s Guide. |
What is an event preprocessor? An event preprocessor is a rule function that processes incoming messages before TIBCO BusinessEvents® Extreme transforms them into events. In this case the preprocessor is used to send a response to the HTTP server. In real-world applications, however, a preprocessor might filter the messages so that only certain ones are used as events, and it might do other event enrichment actions. Preprocessors are multi-threaded and you can choose from various threading and queue options, as appropriate to handle the work load. By default the threading uses the system-wide shared queue and threads.
How are event preprocessors configured for use? A preprocessor is associated with a destination. It processes events arriving at that destination. See the section called “Add a Cluster Deployment Descriptor and Build the EAR File” for details.
![]() | |
See Event Preprocessors in TIBCO BusinessEvents® Extreme Application Architect’s Guide. See Event Preprocessors in TIBCO BusinessEvents® Extreme Application Developer’s Guide. |
Right click the RuleFunctions
folder, and select New > Rule Function
You see the New Rule Function Wizard. In the Rule Function
name field, type PreProcessor
. In the Description
field, type Generates a response to an HTTP
request
. Click .
Click the tab
at the bottom of the editor.
In the Scope section, click
.
You see the Select Rule Function Scope Arguments dialog. In the Types area (at the top), select Event. Click .
In the Select Resource area, you could select a specific event type in the project. However, here we want any event to be in the scope of this rule function, not one specific event type.
In the Alias column (in the
Scope
section), replace the default alias (e)
with request
.
In the Body area, type: Event.
(Event
followed by a period). Notice that when you type the period (.) you
see a list of all catalog functions in the Event category. Use the
down arrow to scroll down the list of functions and stop at
. Its tooltip
displays. Documentation for all catalog functions is provided in
tooltips.replyEvent
Click the
function to select it. Now the body looks like this:
replyEvent
Event.replyEvent(
As you can see, the rule function arguments are two events, a request event and a reply event.
To specify the request event, type request
,
the alias for the scope argument you added above.
To specify the reply event, just type
request
again. The reply event can be any event
in this case, so we can simply reply with the request event.
Save and close the resource.