Interface CheckoutWorkflowActivity
-
- All Known Subinterfaces:
RequiresSecurePaymentInformationActivity
- All Known Implementing Classes:
CartFulfillmentValidationActivity
,CartItemValidationActivity
,CartOfferValidationActivity
,CartPaymentMethodValidationActivity
,CartPricingValidationActivity
,CartStalePricingValidationActivity
,InventoryAvailabilityValidationCheckoutWorkflowActivity
,PaymentTransactionExecutionActivity
public interface CheckoutWorkflowActivity
Within the execution of aCheckoutWorkflow
, implementations of this interface are responsible for contributing an independent & isolated portion of the work required for a cart to complete checkout. If an unrecoverable error is encountered in the workflow, then the entire workflow must be rolled back. Each activity is also responsible for providing a#rollback(Cart, String)
method to un-do any work or stored state from its#execute(Cart, String)
method. Coordinating the execution & rollback of the workflow is the responsibility of theCheckoutWorkflow
. Implementations of this interface should only be concerned about how it contributes to the overall workflow & what it needs to do to roll back its own work.- Author:
- Chris Kittrell (ckittrell)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description com.broadleafcommerce.cart.client.domain.Cart
execute(com.broadleafcommerce.cart.client.domain.Cart cart, String requestId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Method responsible for executing some work against the cart that is required for checkout.com.broadleafcommerce.cart.client.domain.Cart
rollback(com.broadleafcommerce.cart.client.domain.Cart cart, 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.
-
-
-
Method Detail
-
execute
com.broadleafcommerce.cart.client.domain.Cart execute(com.broadleafcommerce.cart.client.domain.Cart cart, String requestId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
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.- Parameters:
cart
- TheCart
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.- Returns:
- The final state of the cart following the execution of the activity.
- Throws:
CheckoutWorkflowActivityException
- thrown if an unrecoverable error is encountered during the execution of the activity
-
rollback
com.broadleafcommerce.cart.client.domain.Cart rollback(com.broadleafcommerce.cart.client.domain.Cart cart, String requestId, @Nullable 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.- Parameters:
cart
- TheCart
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.- Returns:
- The final state of the cart following the rollback of the activity.
- Throws:
CheckoutWorkflowRollbackException
- If there was an exception thrown within the rollback of the activity.
-
-