All Known Subinterfaces:
PaymentFinalizationActivity, RequiresSecurePaymentInformationActivity
All Known Implementing Classes:
CartFulfillmentValidationActivity, CartItemValidationActivity, CartOfferValidationActivity, CartPaymentMethodValidationActivity, CartPricingValidationActivity, CartStalePricingValidationActivity, InventoryAvailabilityValidationCheckoutWorkflowActivity, PaymentTransactionExecutionActivity

public interface CheckoutWorkflowActivity
Within the execution of a CheckoutWorkflow, 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(CheckoutProcessDto, ContextInfo) method to un-do any work or stored state from its execute(CheckoutProcessDto, ContextInfo) method. Coordinating the execution & rollback of the workflow is the responsibility of the CheckoutWorkflow. 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 Details

    • 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 - The CheckoutProcessDto 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 the execute(CheckoutProcessDto, ContextInfo) method.
      Parameters:
      checkoutProcessDto - The CheckoutProcessDto 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.