Broadleaf Microservices
  • v1.0.0-latest-prod

Cart Item Validation Workflow Activity

Overview

Activity responsible for validating that the cart’s cart items include all necessary selections and data so that a specific item can be identified and purchased. Some items are based on Variants determined by user-selected attributes like size and color. Others are from ItemChoice ProductOptions where the user selects specific items like for a configurable bundle or kit. Still others are from IncludedProducts like for a fixed bundle or kit.

This activity ensures that all of the requirements are met such as required attributes or min/max quantities.

Default Implementation Details

By default, CartItemValidationActivity relies on CatalogProvider to retrieve the products and their hierarchies to use as a basis for validation. It then defers CartItemConfigurationService for the particulars of the validation process. If validation errors are discovered, the messages are mapped to each particular item and included in a CheckoutWorkflowActivityException with failureType INVALID_CART_ITEM_CONFIG, which is then handled by CheckoutWorkflowActivity and can be referenced by the checkout initiator in the CheckoutResponse.