Class DefaultCheckoutWorkflow

    • Method Detail

      • unlockPayments

        protected void unlockPayments​(@NonNull
                                      @NonNull CheckoutProcessDto processDto,
                                      @Nullable
                                      com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      • rollback

        public CheckoutProcessDto rollback​(@NonNull
                                           @NonNull CheckoutProcessDto processDto,
                                           @Nullable
                                           com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: CheckoutWorkflow
        Method used to coordinate the rollback of work that has been done by the CheckoutWorkflowActivities up to that point.
        Specified by:
        rollback in interface CheckoutWorkflow
        Parameters:
        processDto - 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 execution of the workflow rollback.
      • sendCheckoutRollbackEvent

        public void sendCheckoutRollbackEvent​(@NonNull
                                              @NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
                                              @NonNull
                                              @NonNull String requestId,
                                              @Nullable
                                              com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: CheckoutWorkflow
        Send a message to notify external services (and internal listeners) of the checkout workflow rollback, so that they can react accordingly.
        Specified by:
        sendCheckoutRollbackEvent in interface CheckoutWorkflow
        Parameters:
        cart - The cart that is being rolled back.
        requestId - The checkout request id
        contextInfo - Context information around sandbox and multitenant state.
      • logErrorInitiatingWorkflowRollback

        protected void logErrorInitiatingWorkflowRollback​(@NonNull
                                                          @NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
                                                          @NonNull
                                                          @NonNull String requestId,
                                                          Exception e)
        Log a message to record the initiation of the workflow rollback
        Parameters:
        cart - The cart that is being acted upon in this workflow
        requestId - The id used to identify changes tied to the specific execution request
        e - The exception thrown by the CheckoutWorkflowActivity
      • logErrorInitiatingWorkflowRollback

        protected void logErrorInitiatingWorkflowRollback​(@NonNull
                                                          @NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
                                                          @NonNull
                                                          @NonNull String requestId,
                                                          @NonNull
                                                          @NonNull CheckoutWorkflowActivityException e)
      • recordWorkflowError

        protected CheckoutProcessDto recordWorkflowError​(@NonNull
                                                         @NonNull CheckoutProcessDto processDto,
                                                         @NonNull
                                                         @NonNull CheckoutWorkflowActivityException e,
                                                         @Nullable
                                                         com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Method responsible for recording the error that was encountered during the activity's execution.
        Parameters:
        processDto - The CheckoutProcessDto that is being acted upon in this workflow
        e - The exception thrown by the CheckoutWorkflowActivity
        contextInfo - Context information around sandbox and multitenant state.
        Returns:
        The cart including the recorded activity execution state
      • recordRollbackError

        protected CheckoutProcessDto recordRollbackError​(@NonNull
                                                         @NonNull CheckoutProcessDto processDto,
                                                         @NonNull
                                                         @NonNull Exception e,
                                                         @Nullable
                                                         com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Method responsible for recording the error that was encountered during the activity's rollback.
        Parameters:
        processDto - The CheckoutProcessDto that encountered an error during the execution of this activity
        e - The exception that was encountered
        contextInfo - Context information around sandbox and multitenant state.
        Returns:
        The CheckoutProcessDto including the recorded activity rollback state
      • getCartProvider

        protected CartProvider getCartProvider()
      • getTypeFactory

        protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
      • getMessageSource

        protected org.springframework.context.MessageSource getMessageSource()
      • setMessageRetryTemplate

        @Autowired
        @Qualifier("checkoutWorkflowRollbackMessageRetryTemplate")
        public void setMessageRetryTemplate​(org.springframework.retry.support.RetryTemplate messageRetryTemplate)
      • getMessageRetryTemplate

        protected org.springframework.retry.support.RetryTemplate getMessageRetryTemplate()