Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# Adding the PreProcessor Rule Function

In this task, you configure a rule function that replies to the request received from the HTTP channel.

Procedure
1. Select the project and right-click the RuleFunctions folder and select New > Rule Function.
   The New Rule Function Wizard is displayed.
2. Type the name of the RuleFunction in the Rule Function name,
   For example, PreProcessor_Function.
3. Type the appropriate description for the rule function in the Description and click Finish.
   For example, The PreProcessor rule function is added to send the response to the HTTP request.
4. Click the Form tab at the bottom of the editor.
5. To add the RuleFunction arguments of a specific type, in the Scope section click Add.
   The Select Rule Function Scope Arguments dialog is displayed.
6. In Types, select Event.
7. In Select Resource, select an event from the list of events and click OK.
   For example, in the FraudDetection sample example, select `Debit.event`.
   In the Select Resource, you can select an event type specific to your project.
8. In the Scope section, rename the event under the column Alias.
   For example, under the column Alias, rename the default event name from `Debit` to `request`.
9. To display a list of catalog functions for the `Event` category, in the Body, type `Event` and insert a period (.).
10. To reply to the HTTP request, select `replyEvent`.
    The Body displays as follows:

        Event.replyEvent()

11. To specify the request event in the `replyEvent` function, enter the first argument, `Request` that is an alias for the selected event.
12. To specify the reply event, enter again `Request` for the second argument. The function in the body displays as follows:

Note:

- The `replyEvent` RuleFunction has two arguments:
  `Event.replyEvent(<inputEvent>,<replyEvent>)`.

- As a PreProcessor function has only a single input event in scope, you can create and use a new event for the `replyEvent`. Alternatively, use the `inputEvent` as the `replyEvent`. In our example, `request` is used for both `inputEvent` and `replyEvent`.

- For Types Event, when you hover the mouse over a function, a tooltip dialog displays more detailed information about the catalog function.

  For example, a `replyEvent` function displays the following tooltip:

- You can also refer to the online documentation at docs.tibco.com.

What to do next

You have configured a rule function that sends a reply to requests sent by the HTTP server (through the HTTP channel). Next you configure rules that take action on an assertion of `CreateAccount` and `Debit` events, depending on various conditions.

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.