SCC_SC_VALIDATE
This service operation validates the items in the cart for a user. A user interface can use this operation to validate a single or multiple items in the cart. The validation results of all the items indicating a success or failure is sent back in the response message.
Example: A student adds three classes to the enrollment shopping cart. Before the student checks out these classes, the user interface validates the class choices. After validation, the user interface determines that the student is eligible to enroll only in one specific class. The enrollment shopping cart uses the SCC_SC_VALIDATE operation to perform such a pre enrollment validation.
The SCC_SC_VALIDATE operation enables a user interface to first validate the classes that exist in the enrollment shopping cart, before the user interface invokes the SCC_SC_CHECKOUT operation to enroll the student in the classes. On successful validation of the class, the SCC_SC_VALIDATE operation sends back a response message: OK to Add. If any error occurs during validation, the response message contains the appropriate error message.
Note:
The validation code should be specific to the shopping cart feature that you are implementing. Therefore, whoever implements a shopping cart needs to create feature-specific validation logic as part of the adopting feature's application class. In the preceding example, the enrollment validation logic is not part of the Shopping Cart framework. We have incorporated this enrollment validation logic in the CourseShoppingCart application class, validateCart method (part of SSR_COURSE application package). This class and method are specific to the enrollment shopping cart. The validateCart method executes when the enrollment shopping cart user interface invokes the SCC_SC_VALIDATE service operation.