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
New
> Rule Function.
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.
The tooltips are also reproduced in the HTML version of the product documentation, in the Online References area.
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.
Result
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.