Package net.pricefx.server.dto.calculation


package net.pricefx.server.dto.calculation
The objects a calculation logic returns to format, display or configure its results.

Most of these objects are what a logic element returns when its result needs more than a plain value. Such an object formats a value, holds a gauge or a chart, defines a controller portlet, or holds a Configurator section. A recommendation logic returns scored items. Two helper APIs work with Action Items and Custom Forms.

Entry point: each type comes from a call on api, such as api.attributedResult() or api.newGauge(). The example formats an output.


 def margin = out.MarginPct
 return api.attributedResult(margin)
         .withBackgroundColor(margin < 0.30 ? "red" : null)
         .withTextColor(margin < 0.30 ? "white" : null)
 

Configurators are a legacy input mechanism. Since version 17.0, new implementations use Forms 2.0. An existing Configurator logic builds a section with input builders:


 def entry = api.createConfiguratorEntry()
 api.inputBuilderFactory()
         .createOptionEntry("SalesOrg")
         .setOptions(["Europe", "USA"])
         .addToConfiguratorEntry(entry)
 return entry
 

Reference

See Also: