Class QuoteHelper
Object
LineItemHelper
QuoteHelper
- All Implemented Interfaces:
Reviewable
A helper class that assists in manipulating the quote object.
Instance of this class can be obtained via call
quoteProcessor.getHelper() from quote header logic.
Example:
def isOpportunity = quoteProcessor.getHelper().getRoot().getInputByName("IsOpportunity")?.value
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class LineItemHelper
LineItemHelper.LineItem, LineItemHelper.ReviewContext, LineItemHelper.ReviewSubStep -
Field Summary
Fields inherited from class LineItemHelper
calculableLineItemCollection, idToLineItem, parentIdToLineItems, reviewContext, root -
Constructor Summary
ConstructorsConstructorDescriptionQuoteHelper(Map<String, Object> calculableLineItemCollection, LineItemHelper.ReviewContext reviewContext) -
Method Summary
Modifier and TypeMethodDescriptionfindAllWithSKU(String sku) Retrieves a list of all line items that are for a particular skuGets a list of line items that are assigned to the current user for review.Gets the current review sub-step information.booleanChecks if the user who triggered the calculation can do the review of the line items.Methods inherited from class LineItemHelper
findAllWithLabel, findByLineId, getFlattedInputs, getRoot, lineItemFromMap
-
Constructor Details
-
QuoteHelper
public QuoteHelper(Map<String, Object> calculableLineItemCollection, LineItemHelper.ReviewContext reviewContext)
-
-
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
-
isInReview
public boolean isInReview()Checks if the user who triggered the calculation can do the review of the line items.Example:
if (quoteProcessor.getHelper().isInReview()) { // Execute review-specific validation or calculations }- Specified by:
isInReviewin interfaceReviewable- Returns:
trueif the quote is in a review workflow step and there is active review sub step for the current user,falseotherwise
-
getReviewSubStep
Gets the current review sub-step information.Example:
def helper = quoteProcessor.getHelper() if (helper.isInReview()) { def label = helper.getReviewSubStep().label def userGroupName = helper.getReviewSubStep().userGroupName }- Specified by:
getReviewSubStepin interfaceReviewable- Returns:
- The review sub-step or null if the user is not in review
-
getItemsForReview
Gets a list of line items that are assigned to the current user for review.This method returns the line items that are part of the current user's review scope. Only line items that have an active review assignment for the current user's review user group are included.
Example:
def helper = quoteProcessor.getHelper() if (helper.isInReview()) { def itemsForReview = helper.getItemsForReview() for (item in itemsForReview) { // Process each line item assigned for review api.logInfo("Reviewing item", item.lineId) } }- Specified by:
getItemsForReviewin interfaceReviewable- Overrides:
getItemsForReviewin classLineItemHelper- Returns:
- A list of
LineItemHelper.LineItemobjects for the current user's review, or an empty list if not in review or no items are assigned
-