Project Design Tutorial : Add the PreProcessor Rule Function

Add the PreProcessor Rule Function
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.)
Learning Points
What is an event preprocessor?  An event preprocessor is a rule function that processes incoming messages before BusinessEvents 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. See the topic Event Preprocessorsin TIBCO BusinessEvents Architect’s Guide.
More Information
Event Preprocessors in TIBCO BusinessEvents Architect’s Guide.
Task K Add the PreProcessor Rule Function
1.
Right click the RuleFunctions folder, and select New > Rule Function
2.
You see the New Rule Function Wizard. In the Filename field, type PreProcessor. In the Description field, type Closes requests from the HTTP server. Click Finish.
3.
Click the Form tab at the bottom of the editor.
4.
5.
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.
6.
7.
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 replyEvent. Its tooltip displays. Documentation for all catalog functions is provided in tooltips.
The tooltips are also reproduced in the HTML version of the product documentation, in the Online References area.
8.
Click the replyEvent function to select it. Now the body looks like this:
Event.replyEvent(
As you can see, the rule function arguments are two events, a request event and a reply event.
9.
To specify the request event, type Request, the alias for the scope argument you added in step 5.
10.
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.
Summary and Next Steps
You have configured a rule function that will send a reply to requests sent by the HTTP server (through the HTTP channel). Next you will configure rules that take action on assertion of CreateAccount and Debit events, depending on various conditions.