Class AbstractCheckAvailabilityActivity
java.lang.Object
org.broadleafcommerce.core.workflow.BaseActivity<ProcessContext<CartOperationRequest>>
org.broadleafcommerce.core.order.service.workflow.AbstractCheckAvailabilityActivity
- All Implemented Interfaces:
Activity<ProcessContext<CartOperationRequest>>,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.core.Ordered
- Direct Known Subclasses:
CheckAddAvailabilityActivity,CheckUpdateAvailabilityActivity
public abstract class AbstractCheckAvailabilityActivity
extends BaseActivity<ProcessContext<CartOperationRequest>>
Common functionality between checking availability between adds and updates
- Author:
- Phillip Verheyden (phillipuniverse)
-
Field Summary
FieldsFields 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 voidcheckSkuAvailability(Order order, Sku sku, Integer requestedQuantity) booleanshouldExecute(ProcessContext<CartOperationRequest> context) Determines if an activity should execute based on the current values in theProcessContext.Methods inherited from class org.broadleafcommerce.core.workflow.BaseActivity
getAutomaticallyRegisterRollbackHandler, getBeanName, getErrorHandler, getOrder, getRollbackHandler, getRollbackRegion, getStateConfiguration, setAutomaticallyRegisterRollbackHandler, setBeanName, setErrorHandler, setOrder, setRollbackHandler, setRollbackRegion, setStateConfiguration
-
Field Details
-
inventoryService
-
-
Constructor Details
-
AbstractCheckAvailabilityActivity
public AbstractCheckAvailabilityActivity()
-
-
Method Details
-
shouldExecute
Description copied from interface:ActivityDetermines if an activity should execute based on the current values in theProcessContext. For example, a context might have both anOrderas well as a String 'status' of what the order should be changed to. It is possible that an activity in a workflow could only deal with a particular status change, and thus could return false from this method.- Specified by:
shouldExecutein interfaceActivity<ProcessContext<CartOperationRequest>>- Overrides:
shouldExecutein classBaseActivity<ProcessContext<CartOperationRequest>>- Returns:
-
checkSkuAvailability
protected void checkSkuAvailability(Order order, Sku sku, Integer requestedQuantity) throws InventoryUnavailableException - Throws:
InventoryUnavailableException
-