Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# Adding a Virtual Rule Function

To add a virtual function, perform the following steps.

Procedure
1. Right-click the folder where you want to store the virtual rule function and select New > Rule Function. You see the New Rule Function Wizard.
   1. In the Rule Function Name field, type a name for the rule function.
   2. In the Description field, type a description. (In the source editor the description appears in the `* @description` line of the comments at the top of the editor).
   3. Select the Virtual checkbox.
      Note: You cannot change a new resource name after you click Finish. (You can change the description, however.)
2. Click Finish.

   Click the 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. These instructions use the form editor and mention the equivalent settings in the source editor.

3. 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).
4. If you did not do so in the Wizard, select the Virtual checkbox.
   Tip: In the source editor, the signature of a virtual rule function is:

          virtual void rulefunction folder.RFName
       Do not add code to the Body block in the source editor of a virtual rule function. If you do, you see error messages if you try to save or to switch to the form-based editor.

   In virtual rule functions, the Validity field is set to Action and the Return Type is set to Void. column, select where the rule function can be used (source editor equivalents shown in parentheses:

5. In the Scope section (`scope` statements in the source editor), drag an ontology entity into the Scope area, or perform the following actions:
   1. Click Add to add resources that you are using in your rule function. You see the Select Rule Function Scope Arguments dialog.
   2. In the upper half of the Select Rule Function Scope Arguments dialog, select the type you want to use.
   3. If the type you select is an ontology type, in the lower half of the dialog, select a resource from the filtered ontology tree.
   4. Click OK.

      Your selection appears in the Declarations list. TIBCO BusinessEvents assigns an alias to it. You can edit the alias.

      Add more entities as needed.

6. Save the project.

Result

For example, here is the source view for a simple virtual rule function:

    /**
     * @description Action to take when account is suspended
     */
    virtual void rulefunction Rules.FollowUp {
      attribute {
        validity = ACTION;
      }
      scope {
        Concepts.Account account;
      }
      body {
      }
    }

Subtopics

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.