Adding the InitializeScorecard Rule Function
You will add a rule function, which is written in the TIBCO BusinessEvents rule language.
- Procedure
- Right-click the
RuleFunctions folder, and select
.
You will see the New Rule Function Wizard.
- In the
Rule Function name field, type
InitializeScorecard.
In the Description field, type Sets values in the FraudCriteria scorecard.
- Click
Finish.
You can work in the Source view or the Form view, according to your preference. The tutorial uses the Form view. In the lower area, click the Form tab to switch to the Form view.Tip:Rule Function Editor PreferenceTo set the default mode, go to Initially show "Form" tab in Rule Function Editor.and check or uncheck the following checkbox as desired:
Ctrl-click the name of a rule function in a rule or rule function editor to open the editor for that rule function.
- Leave the
Scope area empty, because this function is used at startup. In the
Body area, add the following lines to provide values to the
FraudCriteria
scorecard (and to comment your code)://Initialize scorecard variables FraudCriteria.debits_percent =.8; FraudCriteria.interval = 120*1000; /* 120 seconds */ FraudCriteria.num_txns = 3;
Notice that when you type the period after
FraudCriteria
, a list of its properties appears so you can select a property. - Save and close the resource.
What to do next
You’ve set up a startup rule function. Next you’ll set up an event preprocessor rule function.