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 arollback(CheckoutProcessDto, ContextInfo)
method to un-do any work or stored state from itsexecute(CheckoutProcessDto, ContextInfo)
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 CheckoutProcessDto
execute(CheckoutProcessDto checkoutProcessDto, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Method responsible for executing some work against the cart that is required for checkout.CheckoutProcessDto
rollback(CheckoutProcessDto checkoutProcessDto, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Method responsible for rolling back any work that was done during the execution of theexecute(CheckoutProcessDto, ContextInfo)
method.
-
-
-
Method Detail
-
execute
CheckoutProcessDto execute(CheckoutProcessDto checkoutProcessDto, @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:
checkoutProcessDto
- 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. - Throws:
CheckoutWorkflowActivityException
- thrown if an unrecoverable error is encountered during the execution of the activity
-
rollback
CheckoutProcessDto rollback(CheckoutProcessDto checkoutProcessDto, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Method responsible for rolling back any work that was done during the execution of theexecute(CheckoutProcessDto, ContextInfo)
method.- Parameters:
checkoutProcessDto
- 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. - Throws:
CheckoutWorkflowRollbackException
- If there was an exception thrown within the rollback of the activity.
-
-