Class AutoBundleActivity
java.lang.Object
org.broadleafcommerce.core.workflow.BaseActivity<ProcessContext<Order>>
org.broadleafcommerce.core.pricing.service.workflow.AutoBundleActivity
- All Implemented Interfaces:
Activity<ProcessContext<Order>>,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.core.Ordered
This pricing workflow step will automatically bundle items in the cart.
For example, if a ProductBundle exists of two items and the user has one of the items in their cart. If they then add the second item, this activity will replace the two items with the ProductBundle.
This only occurs if the ProductBundle is set to "automatically" bundle.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CatalogServiceprotected FulfillmentGroupItemDaoprotected OrderItemDaoprotected OrderServiceFields inherited from class org.broadleafcommerce.core.workflow.BaseActivity
automaticallyRegisterRollbackHandler, beanName, errorHandler, order, rollbackHandler, rollbackRegion, stateConfigurationFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intcountExistingUsesOfBundle(Order order, ProductBundle bundle) protected intcountMaximumApplications(Order order, SkuBundleItem skuBundleItem, Set<Long> processedBundles) execute(ProcessContext<Order> context) Called by the encompassing processor to activate the execution of the ActivityhandleAutomaticBundling(Order order) protected intpopulateItemMatchesForSku(List<DiscreteOrderItem> matchingItems, Order order, List<DiscreteOrderItem> unbundledItems, Long skuId) Methods inherited from class org.broadleafcommerce.core.workflow.BaseActivity
getAutomaticallyRegisterRollbackHandler, getBeanName, getErrorHandler, getOrder, getRollbackHandler, getRollbackRegion, getStateConfiguration, setAutomaticallyRegisterRollbackHandler, setBeanName, setErrorHandler, setOrder, setRollbackHandler, setRollbackRegion, setStateConfiguration, shouldExecute
-
Field Details
-
catalogService
-
orderService
-
orderItemDao
-
fulfillmentGroupItemDao
-
-
Constructor Details
-
AutoBundleActivity
public AutoBundleActivity()
-
-
Method Details
-
execute
Description copied from interface:ActivityCalled by the encompassing processor to activate the execution of the Activity- Parameters:
context- - process context for this workflow- Returns:
- resulting process context
- Throws:
Exception
-
handleAutomaticBundling
-
countExistingUsesOfBundle
-
populateItemMatchesForSku
protected int populateItemMatchesForSku(List<DiscreteOrderItem> matchingItems, Order order, List<DiscreteOrderItem> unbundledItems, Long skuId) -
countMaximumApplications
protected int countMaximumApplications(Order order, SkuBundleItem skuBundleItem, Set<Long> processedBundles)
-