Add the InitializeScorecard Rule FunctionIn this task, you configure a rule function that initializes values for the FraudCriteria scorecard. This rule function is used at system startup. (You’ll configure that connection later.)What is a rule function? A rule function is a function you write in the TIBCO BusinessEvents rule language.How are rule functions created and used? You write rule functions using the rule editor. You can use rule functions in rules and other rule functions, in event preprocessors (which are explained in the section Add the PreProcessor Rule Function), and as startup or shutdown functions for an agent.What other types of functions are there? TIBCO BusinessEvents provides a large library of functions for various purposes. In addition, an ontology function is automatically created for each concept and event in your project. These are constructor functions. Another type of ontology function enables you to create and schedule a time event.You can also add custom Java functions.
• Chapter 4, Rules and Functions in TIBCO BusinessEvents Architect’s Guide.
• In TIBCO BusinessEvents Developer’s Guide, the following chapters:
1.
2. You see the New Rule Function Wizard. In the Filename 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.
• Rule Function Editor Preference To set the default mode, go to Window > Preferences > TIBCO BusinessEvents > Rules and check or uncheck the following checkbox as desired: Initially show ’Form’ tab in Rule Function Editor.
• Ctrl-click the name of a rule function used in a rule or rule function editor to bring up the editor for that rule function.
3. 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):
FraudCriteria.interval = 120*1000; /* 120 seconds */
Notice that when you type the period after FraudCriteria, a list of its properties appears so you can select a property.Summary and Next Steps
Copyright © TIBCO Software Inc. All Rights Reserved.