Functions Defined as Rules

Oracle Insurance Rules Palette

You are here: Global Explorer and Business Rules > Functions > Functions Defined as Rules

 

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 may be global or they may be overridden. Overrides should be used as an exception to the more general higher level overrides.

    • The same functionality available in global functions is available in the override. Inputs and outputs must be clearly defined and math variables mapped to the input and output of the function must be defined prior to the function call or a stack trace will occur.
    • Every function has a signature. This signature is the name, parameters and the data types being passed in and out. There will be one signature that transcends all the overrides. All overrides are required to match a global signature.

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

  • Functions can be defined at different levels. Container components using them will establish a context that finds the best matching level to execute for each individual function.
  • 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. 

 

  1. Name the math variable.

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

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

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

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

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

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

 

Function open in Configuration Area

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, 2014, Oracle and/or its affiliates. All rights reserved. Legal Notices