These instructions focus on the form-based editor and mention the equivalent settings in the source editor. Adapt the instructions if you are using the source editor.Figure 2 Rule Form EditorFigure 3 Rule Source Editor
See Rule Editor Reference for details on the settings.
1. In Studio Explorer, right click the folder where you want to store the rule and select New > Rule. You see the New Rule Wizard.
2. In the Rule Name field, type a name for the rule. In the Description field, type a description as desired. (In the source editor the description appears in the @description line of the comments at the top of the editor.)
You can’t change the name in the editor. To change the name of any project element, right-click the element in Studio Explorer and select Refactor > Rename. See Chapter 4, Element Refactoring Operations for more details.
3. Click Finish. By default, you see the source rule editor on opening the editor. It shows the outline for a rule’s source code. Click the Form tab at the bottom of the editor to use the form editor.At any time you can click the Form and Source tabs at the bottom of the editor to switch between the form-based editor and the source editor as you work, depending on your preference.
Rule Editor Preference To set which mode the editor uses upon first opening, go to Window > Preferences > BusinessEvents > Rules and check or uncheck the following checkbox as desired: Initially show ’Form’ tab in Rule Editor
4. In the Form editor Configuration panel, add or edit a description as desired. (In the source editor the description appears in the * @description line of the comments at the top of the editor.)
a. If you want to control the order in which rules execute, set the Priority field accordingly. Highest priority is 1. (In the source editor set priority = n where n is the priority number.)If you want to also control the order in which rules with the same priority execute, set the Rank field accordingly. Browse to and select the rule function you created for this purpose. (If you want to use the source editor, add Rank=RuleFunction in the list of rule attributes.) See Using Priority and Rank to Control Order of Rule Execution for details.
6. To disable forward rule chaining (the default behavior) uncheck the Forward Chain checkbox. (In the source editor set forwardChain = false.)
7. In the Declarations panel (equivalent to the declare statements in the source editor), drag an ontology entity into the Declarations area, OR do the following:
a. Click Add to add resources that you will be using in your rule. You see the Select Rule Declaration Arguments dialog.
b. In the upper half of the Select Rule Declaration Arguments dialog, select the kind of entity you want to use.
c. In the lower half of the dialog, select a resource from the filtered ontology tree, and click OK. Your selection appears in the Declarations list. BusinessEvents assigns an alias to the resource. You can edit the alias.
d. To re-order the declarations, highlight a declaration and click the up or down arrow to move it. This is relevant only in rule functions, to order the arguments.
8. In the Conditions panel (equivalent to the when statements in the source editor), write condition statements (in the BusinessEvents rule language).Each line is a complete statement. Each condition must evaluate to a Boolean value. Each line is joined to the others with an implicit AND operator. All of a rule’s conditions must evaluate to true for the conditions to be satisfied. See Order of Evaluation of Rule Conditions in TIBCO BusinessEvents Architect’s Guide for more information.See Using Variables and Functions in the Rule Editor and Tips for Working in the Rule Editor for more information on working in the rule editor.
9. In the Actions panel (equivalent to the then statements in the source editor), write action statements (in the BusinessEvents rules language).
Copyright © TIBCO Software Inc. All Rights Reserved.