Class AddWorkflowPriceOrderIfNecessaryActivity
java.lang.Object
org.broadleafcommerce.core.workflow.BaseActivity<ProcessContext<CartOperationRequest>>
org.broadleafcommerce.core.order.service.workflow.AddWorkflowPriceOrderIfNecessaryActivity
- All Implemented Interfaces:
Activity<ProcessContext<CartOperationRequest>>,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.core.Ordered
- Direct Known Subclasses:
RemoveWorkflowPriceOrderIfNecessaryActivity,UpdateWorkflowPriceOrderIfNecessaryActivity
@Component("blAddWorkflowPriceOrderIfNecessaryActivity")
public class AddWorkflowPriceOrderIfNecessaryActivity
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
FieldsModifier and TypeFieldDescriptionprotected FulfillmentGroupItemDaostatic final intprotected OrderItemServiceprotected OrderMultishipOptionServiceprotected 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 booleancheckAndUpdateChildren(CartOperationRequest request, OrderItem orderItem) execute(ProcessContext<CartOperationRequest> context) Called by the encompassing processor to activate the execution of the Activityprotected voidgetOiFgiMap(Order order, Map<OrderItem, List<FulfillmentGroupItem>> oiFgiMap, OrderItem oi) protected voidpreSaveOperation(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.protected voidupdateChildOrderItem(CartOperationRequest request, Order order) Traverses the current OrderItem for a match to the parentOrderItemId.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
-
ORDER
public static final int ORDER- See Also:
-
orderService
-
orderItemService
-
fgItemDao
-
orderMultishipOptionService
-
-
Constructor Details
-
AddWorkflowPriceOrderIfNecessaryActivity
public AddWorkflowPriceOrderIfNecessaryActivity()
-
-
Method Details
-
execute
public ProcessContext<CartOperationRequest> execute(ProcessContext<CartOperationRequest> context) throws Exception 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
-
updateChildOrderItem
Traverses the current OrderItem for a match to the parentOrderItemId. If found, populates and returns true.- Parameters:
request-order-
-
checkAndUpdateChildren
-
getOiFgiMap
-
preSaveOperation
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-
-