Interface QuoteHelper
- All Superinterfaces:
LineItemHelper,Reviewable
- All Known Subinterfaces:
QuotePersistedHelper
A helper interface that assists in manipulating the quote object.
An instance can be obtained via call
quoteProcessor.getHelper() from a quote header logic.
Example:
def isOpportunity = quoteProcessor.getHelper().getRoot().getInputByName("IsOpportunity")?.value
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface LineItemHelper
LineItemHelper.LineItem, LineItemHelper.ReviewSubStep -
Method Summary
Modifier and TypeMethodDescriptionfindAllWithSKU(String sku) Retrieves a list of all line items that are for a particular sku.Streaming variant ofReviewable.getItemsForReview(), preferred for quotes with many line items.Streaming iterator over all line items of this quote, preferred over walkingquoteProcessor.getQuoteView()for quotes with many line items.Methods inherited from interface LineItemHelper
findAllWithLabel, findByLineId, getRoot, lineItemFromMapMethods inherited from interface Reviewable
getItemsForReview, getReviewSubStep, isInReview
-
Method Details
-
findAllWithSKU
Retrieves a list of all line items that are for a particular sku.- Parameters:
sku- The sku to search for- Returns:
- The list of line items
-
getItemsForReviewIterator
LineItemIterator getItemsForReviewIterator()Streaming variant ofReviewable.getItemsForReview(), preferred for quotes with many line items.When the persisted quote calculation processor is enabled on the QuoteType, the items are fetched from the database one at a time instead of all being held in memory; otherwise the in-memory items are simply wrapped. Either way the iterator must be closed after use.
Example:
def helper = quoteProcessor.getHelper() if (helper.isInReview()) { helper.getItemsForReviewIterator().withCloseable { items -> items.each { item -> api.logInfo("Reviewing item", item.lineId) } } }- Returns:
- an iterator over the line items assigned to the current user for review, empty if not in
review; must be closed after use (try-with-resources or
withCloseable)
-
getLineItemsIterator
LineItemIterator getLineItemsIterator()Streaming iterator over all line items of this quote, preferred over walkingquoteProcessor.getQuoteView()for quotes with many line items.When the persisted quote calculation processor is enabled on the QuoteType, the items are fetched from the database one at a time instead of all being held in memory; otherwise the in-memory items are simply wrapped. Either way the iterator must be closed after use.
Example:
quoteProcessor.getHelper().getLineItemsIterator().withCloseable { items -> items.each { item -> api.logInfo("Item", item.getSKU()) } }- Returns:
- an iterator over all line items of the quote; must be closed after use
(try-with-resources or
withCloseable)
-