Class QuoteBuilder
- Object
-
- ObjectIdentity
-
- AbstractBuilder
-
- CalculableLineItemCollectionBuilder<QuoteBuilder>
-
- QuoteBuilder
-
public class QuoteBuilder extends CalculableLineItemCollectionBuilder<QuoteBuilder>
QuoteBuilder is the starting point of an interface that allows you 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. UseisPrePhase()
andisPostPhase()
methods to detect current phase.
The quote builder is available in the header logic by this call:
def builder = quoteProcessor
IMPORTANT: Please read super class notes on sequence of execution!
-
-
Field Summary
-
Fields inherited from class CalculableLineItemCollectionBuilder
METHOD_ADD_LINE_ITEM, METHOD_ADD_OR_UPDATE_INPUT, METHOD_ADD_OR_UPDATE_OUTPUT, METHOD_UPDATE_FIELD, phase, ROOT_LINE_ID
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFolder(String label)
Creates and adds a new root folder This is only a shortcut as when doing it via QuoteStructure If you intend to add many folders and items, please use the QuoteStructure approach instead!void
addPart(String sku)
Creates and adds a new part This is only a shortcut as when doing it via QuoteStructure If you intend to add many folders and items, please use the QuoteStructure approach instead!QuoteBuilder
addQuoteStructure(QuoteStructure structure)
Apply a quote structure.QuoteBuilderResult
build()
QuoteHelper
getHelper()
Gets a helper class that assists in manipulating the quote objectObject
getQuoteView()
Gets the full quote object as a nested map-
Methods inherited from class CalculableLineItemCollectionBuilder
addLineItem, addLineItem, addLineItem, addOrUpdateInput, addOrUpdateInput, addOrUpdateOutput, addOrUpdateOutput, clearRenderInfo, deleteItem, isPostPhase, isPrePhase, moveItem, renameFolder, setRenderInfo, updateField, updateField
-
-
-
-
Method Detail
-
getQuoteView
public Object getQuoteView()
Gets the full quote object as a nested map- Returns:
- The quote object
-
getHelper
public QuoteHelper getHelper()
Gets a helper class that assists in manipulating the quote object- Returns:
-
addQuoteStructure
public QuoteBuilder addQuoteStructure(QuoteStructure structure)
Apply a quote structure. That usually means adding a set of predefined folders and/or items- Parameters:
structure
- The structure- Returns:
-
addFolder
public void addFolder(String label)
Creates and adds a new root folder This is only a shortcut as when doing it via QuoteStructure If you intend to add many folders and items, please use the QuoteStructure approach instead!- Parameters:
label
- The folder label
-
addPart
public void addPart(String sku)
Creates and adds a new part This is only a shortcut as when doing it via QuoteStructure If you intend to add many folders and items, please use the QuoteStructure approach instead!- Parameters:
label
- The SKU of the new part
-
build
public QuoteBuilderResult build()
- Specified by:
build
in classAbstractBuilder
-
-