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
AttributedResultformats an output value, such as its colors and suffix.WrappedResultkeeps a result as-is in the logic result, such as a list or an array.ResultGaugeholds a gauge that shows a value in a range divided into colored sectors.ResultHighchartholds a Highcharts chart definition.ResultHighmapholds a Highmaps map definition.ResultFlexChartholds a FlexChart. New projects useResultHighchartinstead.DashboardControllerdefines a controller portlet of HTML snippets and buttons.ContextParameterconfigures an input field, such as its label and default value.ConfiguratorEntryholds a section of a Configurator form: a set of inputs and an optional message.ConfiguratorEntryArrayholds several Configurator sections returned from one logic element.ItemRecommendationis a scored item recommendation for cross-sell and up-sell.ActionItemApicreates, updates, recalculates and deletes Action Items.CustomFormApiworks with Custom Forms.
- See Also:
-
ClassDescriptionUtility class to work with Action Items in Groovy codeHelper class to create Action Items.
The class exposes several methods of the type setXX() for properties of the Action Item.
The Action Item is then created in the database by invoking thecreatemethod.Provides means for output elements' formatting.Holds a section of a Configurator form: a set of inputs that share a purpose, and an optional message shown above them.Holds several Configurator sections returned from one logic element.This class represents the input parameter, the input field.Utility class to work with Custom Forms in Groovy codeHelper class to create Custom Forms.Helper class to work with Custom Forms statuses.Helper class for all operations on Custom Forms.
Example:Helper class to recalculate Custom Forms.Helper class to update Custom Forms.Helper class to work with Workflow statuses.This class is used to generate the definition of a so-called controller dashboard portlet (or wizard).Represents a scored item recommendation calculated by logic.Holds a FlexChart returned from a logic element.The Gauge widget class implements a graphical speedometer-style gauge for displaying a measurement by means of a needle on a dial.Holds a Highcharts chart definition returned from a logic element.The menu that opens when the user clicks a point in the chart.An item of the context menu.Defines what happens when the user clicks a point in the chart.An event that the chart triggers when the user clicks a point.Holds a Highmaps map definition returned from a logic element.Makes sure that a result appears "as-is" in the logic result.