SAP Knowledge Base Article - Preview

2318669 - How to enable ordered evaluation of TypeConstraint in the SAP Commerce Cloud data validation framework


If you create multiple TypeConstraints applying on the same composedtype, the evaluation order of the constraints will be different each time you restart the hybris platform. As a showcase, an demo extension is created which contains three TypeConstraint definitions i.e. TestProductConstraintOne, TestProductConstraintTwo and TestProductConstraintThree. The isValid() method of them return always true and print out a simple message in the console. As shown in the pictures below, it is proved the evaluation order of them are arbitrary.



However sometimes the constraints need be evaluated in certain order to fulfill certain business requirements.



SAP Commerce Cloud


SAP Commerce Cloud 2211


hybris, validation, typeconstraint, evaluation, order , KBA , CEC-COM-CPS , SAP Commerce , How To

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.