LUA
LUA is a scripting language used in PENGINE via an API to fully customize workflows instead of hard-coding them. A label administrator writes a short expression, and PENGINE evaluates it at the right moment to return a value.
Currently LUA is only used for the Cost Management, where every cost rule has a LUA expression that returns an amount.
How LUA runs on the platform
All LUA on the platform shares the same execution contract:
- Scripts run in a hard secured sandbox.
- Execution is time-boxed. A script is aborted after 5 seconds of CPU time. Calls that fetch data through the API (e.g. retrieving portfolio balances) will pause this timer, and have an async time limit of 5 minutes before the execution is aborted.
- LUA Evaluation is audited. Each call to the LUA API is written in an audit log for full transparency & traceability.
- Rounding. PENGINE automatically rounds returned numbers based on the label’s configured decimals (e.g. cash decimals for Cost Management).
Sections
- Cost Management — cost rules and the LUA API available to each of the cost rule types.