OLM Technical Training AppsLucent Software Services
Formula Architecture
Formulas are used in OLM to derive amounts during run time. For example, during accounting, amounts
are derived dynamically from formulas. Similarly, termination quote process also derives the penalty
amount or the discount amounts from formulas. The formulas provide flexible architecture to OLM, the
amounts can be derived by PL/SQL functions, by a constant or by another formula.
Function: Function are PL/SQL functions which return a value for a given contract id and line id.
Operands: Operands are a placeholder which can be either associated with a function or another
formula. Single or multiple operands can be joined together using mathematical expression to derive
value of a formula. Thus, a formula consists of one or more operands joined by mathematical express.
Formula: Formula is associated with various OLM entities and gets executed during run time. The
formula engine evaluates the operands associated with the formula and derives the amount,
Operands
OKL_OPERANDS_B
Formula-Operand Formulas
OKL_FMLA_OPRNDS OKL_FORMULAE_B
Functions
OKL_DATA_SRC_FNCTNS_B
1
OLM Technical Training AppsLucent Software Services
Description of Table Columns
OKL_DATA_SRC_FNCTNS_B
Column Name Description
Name Name of Function
Source Function Name in the database. For example
LCPP016_SEEDED_FUNCTIONS_PVT.investor_rv_factor
OKL_OPERANDS_B
Column Name Description
Name Name of Operand
FMA_ID Formula ID
DSF_ID Function ID. Foreign Key from
OKL_DATA_SRC_FNCTNS_B.
Either FMA_ID or DSF_ID will be populated.
2
OLM Technical Training AppsLucent Software Services
OKL_FMLA_OPRNDS
(Association of Formula to Operands)
Column Name Description
OPD_ID Operand ID. Foreign Key from OKL_OPERANDS_B
FMA_ID Formula ID. Foreign Key from OKL_FORMULAE_B
LABEL Label of the Operand. This Label is used in formula
definition to define the formula string.
OKL_FORMULAE_B
Column Name Description
NAME Name of Formula
CGR_ID Context ID
FORMULA_STRING Formula String
e.g. op_line_oec - op_line_tradein-
op_line_capreduction + op_line_feescapitalized +
cap_int
How formula is evaluated
a. For the given formula name, get all the associated operands.
b. Evaluate each operand separately. If operand is a function, execute the function and get the
value. If operand is a constant, get the constant value. If Operand is another formula, then
evaluate the formula.
c. Parse the formula string. Substitute value of all operands in the string and get the final value of
the formula.
Executing a formula
Formula can be executed by calling the below public API:
Okl_Execute_Formula_Pub.EXECUTE( p_api_version => 1.0
,p_init_msg_list => l_init_msg_list
,x_return_status => l_return_status
,x_msg_count => l_msg_count
,x_msg_data => l_msg_data
,p_formula_name => l_formula_name
,p_contract_id => p_contract_id
,p_line_id => p_contract_line_id
,p_additional_parameters => p_ctxt_val_tbl
3
OLM Technical Training AppsLucent Software Services
,x_value => x_amount);
P_ctxt_val_tbl is defined in OKL_EXECUTE_FORMULA_PUB as a table of record with name
ctxt_Val_tbl_type. In the custom program, this can be used as follows:
L_ctxt_val_tbl OKL_EXECUTE_FORMULA_PUB.ctxt_val_tbl_type;
Creating a custom formula
For creating a custom formula involving a PL/SQL function, first design a formula function with the
following specification:
FUNCTION line_residual_value(
p_chr_id IN NUMBER,
p_line_id IN NUMBER)
RETURN NUMBER;
The function should have two input parameters (contract ID and Line ID) and should return Number.
OKL Standard functions are defined in the package OKL_SEEDED_FUNCTIONS_PVT. When a new custom
formula is required, it can be created as part of a new package.
Where Formulas are Used
Formulas are used at various places in a contract definition. Some of the examples are:
a. Accounting templates – Formulas are used to derive amount for accounting.
b. Terms and Conditions – Early termination and End of Term termination
c. Terms and Conditions – Repurchase Quote Calculations