Class OfferProcesingUtility
java.lang.Object
com.broadleafcommerce.promotion.offer.service.engine.OfferProcesingUtility
Utility methods used by the offer processing engine extracted for ease of testing.
prepareOfferProcessingContext - creates the OfferProcessingContext and builds all permutations of
the offers to process.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addNodes
(CompatiblePermutationNode parentNode, OfferProcessingContext context, List<Set<OfferCombinabilityCriteria>> offerTypeCriteria, LinkedHashSet<CompatiblePermutationNode> allNodesSet) protected void
buildCombinedOfferTypePermutations
(EnhancedOrder order, OfferProcessingContext context) Each offer type (e.g.protected OrderTotals
prepareOfferProcessingContext
(EnhancedOrder order, CandidateOffers candidateOffers)
-
Constructor Details
-
OfferProcesingUtility
public OfferProcesingUtility()
-
-
Method Details
-
prepareOfferProcessingContext
public OfferProcessingContext prepareOfferProcessingContext(EnhancedOrder order, CandidateOffers candidateOffers) -
buildCombinedOfferTypePermutations
protected void buildCombinedOfferTypePermutations(EnhancedOrder order, OfferProcessingContext context) Each offer type (e.g. item, order, etc.) has a set of permutations grouped by aOfferCombinabilityCriteriaKey
object. This method builds a higher level set of permutations where each one represents a valid combination representing all of the offer types. Stated another way, at the end of this methods execution, theOfferProcessingContext
will have a collection ofCombinedTypesOfferPermutation
s, one of which is the best option for the passed in order. This method only builds the compatible combinations, it does not attempt to score or choose the best one.- Parameters:
order
-context
-
-
initializeOrderTotals
-
addNodes
protected void addNodes(CompatiblePermutationNode parentNode, OfferProcessingContext context, List<Set<OfferCombinabilityCriteria>> offerTypeCriteria, LinkedHashSet<CompatiblePermutationNode> allNodesSet)
-