org.broadleafcommerce.core.pricing.service.workflow
Class AutoBundleActivity

java.lang.Object
  extended by org.broadleafcommerce.core.workflow.BaseActivity
      extended by org.broadleafcommerce.core.pricing.service.workflow.AutoBundleActivity
All Implemented Interfaces:
Activity, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware

public class AutoBundleActivity
extends BaseActivity

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
protected  CatalogService catalogService
           
protected  FulfillmentGroupItemDao fulfillmentGroupItemDao
           
protected  OrderItemDao orderItemDao
           
protected  OrderService orderService
           
 
Constructor Summary
AutoBundleActivity()
           
 
Method Summary
protected  int countExistingUsesOfBundle(Order order, ProductBundle bundle)
           
protected  int countMaximumApplications(Order order, SkuBundleItem skuBundleItem, Set<Long> processedBundles)
           
 ProcessContext execute(ProcessContext context)
          Called by the encompassing processor to activate the execution of the Activity
 Order handleAutomaticBundling(Order order)
           
protected  int populateItemMatchesForSku(List<DiscreteOrderItem> matchingItems, Order order, List<DiscreteOrderItem> unbundledItems, Long skuId)
           
 
Methods inherited from class org.broadleafcommerce.core.workflow.BaseActivity
getAutomaticallyRegisterRollbackHandler, getBeanName, getErrorHandler, getRollbackHandler, getRollbackRegion, getStateConfiguration, setAutomaticallyRegisterRollbackHandler, setBeanName, setErrorHandler, setRollbackHandler, setRollbackRegion, setStateConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

catalogService

protected CatalogService catalogService

orderService

protected OrderService orderService

orderItemDao

protected OrderItemDao orderItemDao

fulfillmentGroupItemDao

protected FulfillmentGroupItemDao fulfillmentGroupItemDao
Constructor Detail

AutoBundleActivity

public AutoBundleActivity()
Method Detail

execute

public ProcessContext execute(ProcessContext context)
                       throws Exception
Description copied from interface: Activity
Called 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

public Order handleAutomaticBundling(Order order)
                              throws PricingException,
                                     RemoveFromCartException
Throws:
PricingException
RemoveFromCartException

countExistingUsesOfBundle

protected int countExistingUsesOfBundle(Order order,
                                        ProductBundle bundle)

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)


Copyright © 2013. All Rights Reserved.