MPN Formula Engine processing
The Formula Engine processes raw KPI formulas and stores the result in the Formatted KPI Formula field when a record is inserted or updated in the MPN Formulas [sn_tsom_em_conns_kpi_definitions] table.
When a record is inserted or updated in the MPN Formulas table, a business rule named Transform KPI Formula to Script fires automatically. It invokes the NokiaMpnFormulaEngineSEP extension point to process the
raw formula before it is stored in the Formatted KPI Formula field.
The processing runs in two steps:
- Cleanup: The raw value in KPI Formula is normalized into a JavaScript-evaluable expression:
- Whitespace and line breaks are collapsed to a single space.
Sum()wrappers are removed;Max()andMin()are converted toMath.max()andMath.min().**exponentiation notation is converted toMath.pow()for compatibility with the MID Server JavaScript engine.
- Validation — The processed formula is checked for balanced parentheses. If the parentheses are unbalanced, the raw value is still stored but a warning is logged. Records with unbalanced parentheses are skipped during metric collection at runtime.
The resulting value is written to the Formatted KPI Formula field and is the expression that the metric calculation engine references at runtime.
Note:
If no
NokiaMpnFormulaEngineSEP implementation is registered, the raw value in the KPI Formula value is stored unchanged and a warning is logged.