org.broadleafcommerce.core.order.service.workflow
Class PriceOrderIfNecessaryActivity

java.lang.Object
  extended by org.broadleafcommerce.core.workflow.BaseActivity<ProcessContext<CartOperationRequest>>
      extended by org.broadleafcommerce.core.order.service.workflow.PriceOrderIfNecessaryActivity
All Implemented Interfaces:
Activity<ProcessContext<CartOperationRequest>>, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.core.Ordered

public class PriceOrderIfNecessaryActivity
extends BaseActivity<ProcessContext<CartOperationRequest>>

As of Broadleaf version 3.1.0, saves of individual aspects of an Order (such as OrderItems and FulfillmentGroupItems) no longer happen in their respective activities. Instead, we will now handle these saves in this activity exclusively. This provides the ability for an implementation to not require a transactional wrapper around the entire workflow and instead only requires it around this particular activity. This is only recommended if there are long running steps in the workflow, such as an external service call to check availability.

Author:
Andre Azzolini (apazzolini)

Field Summary
protected  FulfillmentGroupItemDao fgItemDao
           
protected  OrderItemService orderItemService
           
protected  OrderMultishipOptionService orderMultishipOptionService
           
protected  OrderService orderService
           
 
Fields inherited from class org.broadleafcommerce.core.workflow.BaseActivity
automaticallyRegisterRollbackHandler, beanName, errorHandler, order, rollbackHandler, rollbackRegion, stateConfiguration
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
PriceOrderIfNecessaryActivity()
           
 
Method Summary
 ProcessContext<CartOperationRequest> execute(ProcessContext<CartOperationRequest> context)
          Called by the encompassing processor to activate the execution of the Activity
protected  void getOiFgiMap(Order order, Map<OrderItem,List<FulfillmentGroupItem>> oiFgiMap, OrderItem oi)
           
protected  void preSaveOperation(CartOperationRequest request)
          Intended to be overridden by a custom implementation if there is a requirement to perform additional logic or saves before triggering the main Order save with pricing.
 
Methods inherited from class org.broadleafcommerce.core.workflow.BaseActivity
getAutomaticallyRegisterRollbackHandler, getBeanName, getErrorHandler, getOrder, getRollbackHandler, getRollbackRegion, getStateConfiguration, setAutomaticallyRegisterRollbackHandler, setBeanName, setErrorHandler, setOrder, setRollbackHandler, setRollbackRegion, setStateConfiguration, shouldExecute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

orderService

protected OrderService orderService

orderItemService

protected OrderItemService orderItemService

fgItemDao

protected FulfillmentGroupItemDao fgItemDao

orderMultishipOptionService

protected OrderMultishipOptionService orderMultishipOptionService
Constructor Detail

PriceOrderIfNecessaryActivity

public PriceOrderIfNecessaryActivity()
Method Detail

execute

public ProcessContext<CartOperationRequest> execute(ProcessContext<CartOperationRequest> 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

getOiFgiMap

protected void getOiFgiMap(Order order,
                           Map<OrderItem,List<FulfillmentGroupItem>> oiFgiMap,
                           OrderItem oi)

preSaveOperation

protected void preSaveOperation(CartOperationRequest request)
Intended to be overridden by a custom implementation if there is a requirement to perform additional logic or saves before triggering the main Order save with pricing.

Parameters:
request -


Copyright © 2013. All Rights Reserved.