Adding the PreProcessor Rule Function
In this task, you configure a rule function that replies to the request received from the HTTP channel.
- Procedure
- Right-click the
RuleFunctions folder, and select
.
You will see the New Rule Function Wizard.
- In the
Rule Function name field, type
PreProcessor.
In the Description field, type
Closes requests from the HTTP server
. - Click Finish.
- Click the Form tab at the bottom of the editor.
- In the
Scope section, click
Add.
You will see the Select Rule Function Scope Arguments dialog.
- In the
Types area (at the top), select
Event. Click
OK.
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 replyEvent. Its tooltip displays. Documentation for all catalog functions is provided in tooltips.
- 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.
- To specify the request event, type request , which is the alias for the scope argument you added.
- 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.
What to do next
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.