You are here: Global Explorer Folders > Functions > Functions Defined as Rules

Oracle® Insurance Rules Palette 9.4.1.0 E23637_01

# Functions Defined as Rules

A function defined as a rule contains common calculations that can be broken out into logical pieces. Functions improve readability as the inputs and outputs are clearly defined. In addition, the majority of math variables used in a function do not need to be stored or used outside of the function. The math variables in a function are not stored in Math results, which improves system performance. Instead, the function is cached temporarily.

## Functions Defined as Rules

- All math functionality available in transactions and business rule configuration is available within functions except LOG. Use LOG for the function’s return value. Do not use LOG for math variables in the function itself.

- Functions must be global and cannot call a Non-Global function or CopyBook.

- Functions are often chosen over CopyBooks for specific calculations since they offer increased readability.

- If a function is used multiple times in a transaction/business rule it will be resolved and compiled once, no matter how many times it is used in that transaction/rule.

Important: Existing functions are stored in the Global Rules Explorer window under the function folder type. View a function's inputs and return value by double-clicking the function's XML file. In the XML source, the return value is written as an attribute of the function tag and pre-fixed with r for return. The inputs of the function are in the parameter tag and pre-fixed with p for parameter.

## Steps to Call a Function Defined as a Rule

1. Right-click on the XML file to call the function in.

2. Select Check out.

3. Open the Math pane.

4. From the Palette window, scroll down to the folder labeled rule and drag and drop FunCall onto the Configuration Area.

Note: If the Palette window is not visible, open it by selecting Open Search Palette Window from the Window option on the main menu.

5. Name the math variable.

6. Click the Data Type field to select a data type from the drop down box.

7. Select whether to LOG or Round the function’s output result.

8. Click the Functions field to select the function to call from the Functions drop-down box.

9. In the Input section, click the Value drop-down box to select each parameter’s value.

10. In the Output section, click the Value drop down box to select each parameter's value.

11. Check-in the XML file to save the changes.

Math Section Displaying Function Parameters

Note: If the function’s parameters are set-up incorrectly in the function, a red error will display in the bottom math variable text box.

Copyright © 2009, 2011, Oracle and/or its affiliates. All rights reserved. Legal Notices