Interface QuoteBuilder
- All Superinterfaces:
CalculableLineItemCollectionBuilder<QuoteBuilder>
QuoteBuilder is the starting point of an interface that allows you to manipulate
a quote object in a quote header calculation logic.
The header calculation is executed twice: Once before the calculation of the individual line items (= pre phase) and once after that (= post phase).
Usually code should only apply in one phase. Use
The quote builder is available in the header logic by this call:
IMPORTANT: Please read super interface notes on the sequence of execution!
The header calculation is executed twice: Once before the calculation of the individual line items (= pre phase) and once after that (= post phase).
Usually code should only apply in one phase. Use
isPrePhase()
and isPostPhase() methods to detect the current phase. The quote builder is available in the header logic by this call:
def builder = quoteProcessor
IMPORTANT: Please read super interface notes on the sequence of execution!
- See Also:
-
Field Summary
Fields inherited from interface CalculableLineItemCollectionBuilder
ROOT_LINE_ID -
Method Summary
Modifier and TypeMethodDescriptionvoidCreates and adds a new folder under the ROOT folder.voidCreates and adds a new line item to the Quote with the givensku.addQuoteStructure(QuoteStructure structure) Apply a quote structure.Gets a helper that assists in manipulating the quote object.Gets the full quote object as a nested map.Methods inherited from interface CalculableLineItemCollectionBuilder
addLineItem, addLineItem, addLineItem, addOrUpdateInput, addOrUpdateInput, addOrUpdateOutput, addOrUpdateOutput, clearRenderInfo, closeFolder, deleteFolder, deleteItem, deselectItem, isPostPhase, isPrePhase, markItemDirty, moveItem, openFolder, renameFolder, selectItem, setRenderInfo, switchToAsync, updateField, updateField
-
Method Details
-
getQuoteView
Object getQuoteView()Gets the full quote object as a nested map. This map contains all header inputs/outputs, and all line items (with their inputs/outputs).Caution: when using Classic or Unity non-React user interface, then during pre-phase, the quoteProcessor.quoteView will NOT contain values of Outputs. The only exception are "overridable" outputs.
- Returns:
- The quote object
-
getHelper
QuoteHelper getHelper()Gets a helper that assists in manipulating the quote object. You can use it instead of directly reading the QuoteView map.- Returns:
- The helper object
-
addQuoteStructure
Apply a quote structure. That usually means adding a set of folders and/or items.Example:
if (quoteProcessor.isPrePhase()) { def structure = new QuoteStructure() productSubCategory.each { structure.addFolder(it.attribute2) } quoteProcessor.addQuoteStructure(structure) }- Parameters:
structure- The structure- Returns:
- itself (for flow pattern)
-
addFolder
Creates and adds a new folder under the ROOT folder.If you intend to add many folders and items, please use the QuoteStructure approach instead.
- Parameters:
label- The folder label
-
addPart
Creates and adds a new line item to the Quote with the givensku.If you intend to add many folders and items, please use the QuoteStructure approach instead.
- Parameters:
sku- The SKU of the new part
-