Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# Adding a Rule

Procedure
1. In TIBCO BusinessEvents Studio Explorer, right-click the folder where you want to store a 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.)
   Note: You cannot change the name in the editor. To change the name of any project element, right-click the element in TIBCO BusinessEvents Studio Explorer and select Refactor > Rename.
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.

   Tip: Rule Editor Preference
   To set which mode the editor uses on the first opening, go to Window > Preferences > TIBCO BusinessEvents > Rules and select or deselect the Initially show 'Form’ tab checkbox as desired.
4. In the Form editor Configuration section, 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.)
5. To control the order of rule execution:
   1. To control the order in which the rules run, set the Priority field accordingly. The highest priority is 1. (In the source editor set `priority =` `n` where n is the priority number.)

      Also, to control the order in which rules with the same priority run, set the Rank field accordingly. Browse to and select the rule function you created for this purpose. (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 section (equivalent to the `declare` statements in the source editor), drag an ontology entity into the section, or perform the following actions.
   1. Click Add to add the resources that you are using in your rule. You see the Select Rule Declaration Arguments dialog.
   2. In the upper half of the Select Rule Declaration Arguments dialog, select the kind of entity you want to use.
   3. 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. TIBCO BusinessEvents assigns an alias to the resource. You can edit the alias.
   4. To reorder 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.

      Repeat to add more entity types as desired.

8. In the Conditions section (equivalent to the `when` statements in the source editor), write the condition statements (in the TIBCO 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 be evaluated true for the conditions to be satisfied. Refer to the "Order of Evaluation of Rule Conditions" section in the TIBCO BusinessEvents Architect Guide for more information.

   See Using Variables and Functions in the Rule Editor for more information on working in the rule editor.

9. In the Actions section (equivalent to the `then` statements in the source editor), write action statements (in the TIBCO BusinessEvents rules language).
10. Save the resource.

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.