Configurable Lookups Guide

The PSP lookup framework allows you to define PX/PP/PCOMP lookups in a Price Parameter table, enabling you to modify existing lookups without any Groovy coding and add new ones with minimal Groovy required.

Benefits of Configurable Lookups

  • Unification – Every out-of-the-box PSP Data Lookup uses the same features, allowing you to add your own lookups.

  • Performance – These lookups are cached (if called without context and without PLI/PGI key) or cached and batched (if called with context).

  • Ease of use – Typically complicated support for Dependency Levels is embedded into Configurable Lookups with a single flag.

Note on Caching and Batching

Caching and batching are two techniques used to enhance data lookup performance in databases.

  • Caching looks up data only once and saves a single lookup result for reuse across multiple line items – because this value will be the same.

  • Batching looks up data for 200 line items at once. This improves the performance significantly, as there are fewer connections to the database.

Both of these approaches are supported.

If the lookup does not rely on the product context, there is no point in batching it. In such a case, the lookup is performed only once and its value is cached. This occurs when the lookup fields 'key1Field' and 'key2Fields' are empty, meaning there is no column in the data structure that refers to a specific product.

Examples of such cached lookups are out-of-the-box PSP lookups: RoundingRules and StrategyConditions.

Further Reading