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

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