public class CartFulfillmentValidationActivity extends Object implements CheckoutWorkflowActivity
FulfillmentGroupSubmitValidator
.Constructor and Description |
---|
CartFulfillmentValidationActivity(CartOperationServiceAutoConfiguration.ValidationConfiguration.FulfillmentCheckoutValidationConfig validationConfig,
FulfillmentGroupSubmitValidator fulfillmentGroupSubmitValidator,
org.springframework.context.MessageSource messageSource) |
Modifier and Type | Method and Description |
---|---|
protected Map<String,String> |
convertErrors(@NonNull org.springframework.validation.Errors errors)
Converts any errors in the errors container into a map using the field path and error code.
|
com.broadleafcommerce.cart.client.domain.Cart |
execute(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull String requestId,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Method responsible for executing some work against the cart that is required for checkout.
|
protected FulfillmentGroupSubmitValidator |
getFulfillmentGroupSubmitValidator() |
protected String |
getMessage(@NonNull String errorMessage,
Object... args) |
protected org.springframework.context.MessageSource |
getMessageSource() |
protected CartOperationServiceAutoConfiguration.ValidationConfiguration.FulfillmentCheckoutValidationConfig |
getValidationConfig() |
protected CheckoutWorkflowActivityException |
invalid(@NonNull String message,
@NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
Creates a checkout workflow activity exception relevant for this validation activity.
|
protected CheckoutWorkflowActivityException |
invalid(@NonNull String message,
org.springframework.validation.Errors errors,
@NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
Creates a checkout workflow activity exception relevant for this validation activity.
|
com.broadleafcommerce.cart.client.domain.Cart |
rollback(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull String requestId,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Method responsible for rolling back any work that was done during the execution of the
#execute(Cart, String) method. |
public CartFulfillmentValidationActivity(CartOperationServiceAutoConfiguration.ValidationConfiguration.FulfillmentCheckoutValidationConfig validationConfig, FulfillmentGroupSubmitValidator fulfillmentGroupSubmitValidator, org.springframework.context.MessageSource messageSource)
public com.broadleafcommerce.cart.client.domain.Cart execute(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull String requestId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CheckoutWorkflowActivity
execute
in interface CheckoutWorkflowActivity
cart
- The Cart
that we're attempting to checkout with.requestId
- The id used to identify changes tied to the specific execution requestcontextInfo
- Context information around sandbox and multitenant state.public com.broadleafcommerce.cart.client.domain.Cart rollback(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull String requestId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CheckoutWorkflowActivity
#execute(Cart, String)
method.rollback
in interface CheckoutWorkflowActivity
cart
- The Cart
that we were attempting to checkout with, but ran into an
exception/error.requestId
- The id used to identify changes tied to the specific execution requestcontextInfo
- Context information around sandbox and multitenant state.protected CheckoutWorkflowActivityException invalid(@NonNull @NonNull String message, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
message
- the message to create the exception withcart
- the most current version of the cartprotected CheckoutWorkflowActivityException invalid(@NonNull @NonNull String message, @Nullable org.springframework.validation.Errors errors, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
message
- the message to create the exception witherrors
- the errors to include in the exceptioncart
- the most current version of the cartprotected Map<String,String> convertErrors(@NonNull @NonNull org.springframework.validation.Errors errors)
errors
- the errors to convertprotected String getMessage(@NonNull @NonNull String errorMessage, @Nullable Object... args)
protected CartOperationServiceAutoConfiguration.ValidationConfiguration.FulfillmentCheckoutValidationConfig getValidationConfig()
protected FulfillmentGroupSubmitValidator getFulfillmentGroupSubmitValidator()
protected org.springframework.context.MessageSource getMessageSource()
Copyright © 2021. All rights reserved.