Class ValidateAddRequestActivity
java.lang.Object
org.broadleafcommerce.core.workflow.BaseActivity<ProcessContext<CartOperationRequest>>
org.broadleafcommerce.core.order.service.workflow.add.ValidateAddRequestActivity
- All Implemented Interfaces:
Activity<ProcessContext<CartOperationRequest>>,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.core.Ordered
@Component("blValidateAddRequestActivity")
public class ValidateAddRequestActivity
extends BaseActivity<ProcessContext<CartOperationRequest>>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CatalogServicestatic final intprotected OrderItemRequestValidationServiceprotected OrderItemServiceprotected OrderServiceprotected ProductOptionValidationServiceprotected org.broadleafcommerce.common.sandbox.SandBoxHelperFields 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 voidaddSkuToCart(Sku sku, OrderItemRequestDTO orderItemRequestDTO, Product product, CartOperationRequest request) protected booleancanSellDefaultSku(Product product) protected ProductdetermineProduct(OrderItemRequestDTO orderItemRequestDTO) protected SkudetermineSku(Product product, Long skuId, Map<String, String> attributeValues, ActivityMessages messages) execute(ProcessContext<CartOperationRequest> context) Called by the encompassing processor to activate the execution of the Activityprotected SkufindMatchingSku(Product product, Map<String, String> attributeValuesForSku) protected SkufindMatchingSku(Product product, Map<String, String> attributeValues, ActivityMessages messages) protected voidhandleIfNonDiscreteOI(OrderItemRequestDTO orderItemRequestDTO) protected voidhandleIfNoSku(OrderItemRequestDTO orderItemRequestDTO, Product product) protected booleanprotected booleanhasQuantity(Integer orderItemQuantity) protected booleanhasSameCurrency(OrderItemRequestDTO orderItemRequestDTO, CartOperationRequest request, Sku sku) protected booleanhasSkuOrIsNonDiscreteOI(Sku sku, OrderItemRequestDTO orderItemRequestDTO) protected booleanshouldValidateWithException(boolean isRequired, boolean isAddOrNoneType, String attributeValue, boolean hasStrategy) protected ProcessContext<CartOperationRequest>validate(ProcessContext<CartOperationRequest> context) protected voidvalidateIfParentOrderItemExists(OrderItemRequestDTO orderItemRequestDTO) protected voidvalidateIfProductIsProdRecord(Product product) 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:
-
orderItemRequestValidationService
-
orderService
-
catalogService
-
productOptionValidationService
-
orderItemService
-
extensionManager
-
sandBoxHelper
protected org.broadleafcommerce.common.sandbox.SandBoxHelper sandBoxHelper
-
-
Constructor Details
-
ValidateAddRequestActivity
public ValidateAddRequestActivity()
-
-
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
-
validate
protected ProcessContext<CartOperationRequest> validate(ProcessContext<CartOperationRequest> context) -
validateIfProductIsProdRecord
-
hasQuantity
-
determineProduct
-
determineSku
protected Sku determineSku(Product product, Long skuId, Map<String, String> attributeValues, ActivityMessages messages) throws RequiredAttributeNotProvidedException -
canSellDefaultSku
-
findMatchingSku
protected Sku findMatchingSku(Product product, Map<String, String> attributeValues, ActivityMessages messages) throws RequiredAttributeNotProvidedException -
shouldValidateWithException
protected boolean shouldValidateWithException(boolean isRequired, boolean isAddOrNoneType, String attributeValue, boolean hasStrategy) -
findMatchingSku
-
addSkuToCart
protected void addSkuToCart(Sku sku, OrderItemRequestDTO orderItemRequestDTO, Product product, CartOperationRequest request) -
hasSkuOrIsNonDiscreteOI
-
handleIfNoSku
-
handleIfNonDiscreteOI
-
hasPrice
-
hasSameCurrency
protected boolean hasSameCurrency(OrderItemRequestDTO orderItemRequestDTO, CartOperationRequest request, Sku sku) -
validateIfParentOrderItemExists
-