Class CartFulfillmentValidationActivity
java.lang.Object
com.broadleafcommerce.cartoperation.service.checkout.workflow.activity.CartFulfillmentValidationActivity
- All Implemented Interfaces:
CheckoutWorkflowActivity
Validates the fulfillment information on the cart. Delegates most validation to a
FulfillmentGroupSubmitValidator
.-
Constructor Summary
ConstructorDescriptionCartFulfillmentValidationActivity
(CartOperationServiceAutoConfiguration.ValidationConfiguration.FulfillmentCheckoutValidationConfig validationConfig, FulfillmentGroupSubmitValidator fulfillmentGroupSubmitValidator, org.springframework.context.MessageSource messageSource) -
Method Summary
Modifier and TypeMethodDescriptionconvertErrors
(@NonNull org.springframework.validation.Errors errors) Converts any errors in the errors container into a map using the field path and error code.execute
(@NonNull CheckoutProcessDto processDto, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Method responsible for executing some work against the cart that is required for checkout.protected FulfillmentGroupSubmitValidator
protected String
getMessage
(@NonNull String errorMessage, Object... args) protected org.springframework.context.MessageSource
protected CartOperationServiceAutoConfiguration.ValidationConfiguration.FulfillmentCheckoutValidationConfig
rollback
(@NonNull CheckoutProcessDto processDto, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Method responsible for rolling back any work that was done during the execution of theCheckoutWorkflowActivity.execute(CheckoutProcessDto, ContextInfo)
method.
-
Constructor Details
-
CartFulfillmentValidationActivity
public CartFulfillmentValidationActivity(CartOperationServiceAutoConfiguration.ValidationConfiguration.FulfillmentCheckoutValidationConfig validationConfig, FulfillmentGroupSubmitValidator fulfillmentGroupSubmitValidator, org.springframework.context.MessageSource messageSource)
-
-
Method Details
-
execute
public CheckoutProcessDto execute(@NonNull @NonNull CheckoutProcessDto processDto, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CheckoutWorkflowActivity
Method responsible for executing some work against the cart that is required for checkout. This may include, but is not limited to, cart validation checks, inventory reservations, or payment authorizations.- Specified by:
execute
in interfaceCheckoutWorkflowActivity
- Parameters:
processDto
- TheCheckoutProcessDto
that we're attempting to checkout with.contextInfo
- Context information around sandbox and multitenant state.- Returns:
- The final state of the
CheckoutProcessDto
following the execution of the activity.
-
rollback
public CheckoutProcessDto rollback(@NonNull @NonNull CheckoutProcessDto processDto, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CheckoutWorkflowActivity
Method responsible for rolling back any work that was done during the execution of theCheckoutWorkflowActivity.execute(CheckoutProcessDto, ContextInfo)
method.- Specified by:
rollback
in interfaceCheckoutWorkflowActivity
- Parameters:
processDto
- TheCheckoutProcessDto
that we were attempting to checkout with, but ran into an exception/error.contextInfo
- Context information around sandbox and multitenant state.- Returns:
- The final state of the
CheckoutProcessDto
following the rollback of the activity.
-
convertErrors
protected Map<String,String> convertErrors(@NonNull @NonNull org.springframework.validation.Errors errors) Converts any errors in the errors container into a map using the field path and error code.- Parameters:
errors
- the errors to convert- Returns:
- a map representing the individual validation errors that occurred
-
getMessage
-
getValidationConfig
protected CartOperationServiceAutoConfiguration.ValidationConfiguration.FulfillmentCheckoutValidationConfig getValidationConfig() -
getFulfillmentGroupSubmitValidator
-
getMessageSource
protected org.springframework.context.MessageSource getMessageSource()
-