The VRF category of functions (within the Built-in > Standard Functions) provide flexibility when you are working with virtual rule function implementations.
Default Implementation When you deploy multiple implementations (tables) for one virtual rule function, but use a function that doesn’t specify the implementation by name, for example if you use Functions.MyVirtualRuleFunction(), the default implementation is used. The default implementation is whichever was the last implementation to be deployed. However, if you use hot deployment, it may not be possible to determine which implementation was deployed last.Common arguments used in the above functions are described in Table 23, Common Arguments for VRF Functions.
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.
b. 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).
c. Check the Virtual checkbox.
You can’t 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 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).
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 do the following:
a. Click Add to add resources that you will be using in your rule function. You see the Select Rule Function Scope Arguments dialog.
b. In the upper half of the Select Rule Function Scope Arguments dialog, select the type you want to use.
c. If the type you select is an ontology type, in the lower half of the dialog, select a resource from the filtered ontology tree.
d. Click OK.Your selection appears in the Declarations list. BusinessEvents assigns an alias to it. You can edit the alias.
Table 23 Common Arguments for VRF Functions The universal resource identifier (URI) for the virtual rule function. This is typically the full path to the virtual rule function within the project directory. For example, in the CreditCardApplication example, the virtual rule function Person_VirtualRuleFunction() has the following URI: An object representing a virtual rule function implementation. This argument is required when invoking specific virtual rule function implementations. The name of a decision table (also known as a virtual rule function implementation). For example, in the CreditCardApplication example, the virtual rule function BankUser_VirtualRuleFunction has an implementation (decision table) called bankUser.The implName argument is used to retrieve a corresponding implementation object, or to execute an implementation. The arguments to be passed to one or more virtual rule function implementations on invocation. These objects consist of the concepts, events, scorecards, and so on. that are needed by the implementation or implementations. For example, the processApplication implementation in the CreditCardApplication example project requires concepts of type Application, BankUser, and CreditCardApplication to be passed as arguments. In order to invoke the processApplication implementation, an instance of each concept type must be passed in the args array. Not used in this release. This argument is used only for the invokeVRFImpls function. When invoking multiple implementations, the return value of each implementation is stored in this array. The array will contain a null entry for each implementation that does not return a value.
Copyright © TIBCO Software Inc. All Rights Reserved.