SAP Knowledge Base Article - Preview

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

Symptom

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.

111.png

222.png

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


Read more...

Environment

SAP Hybris commerce suite 5

Product

SAP hybris Commerce 5.0.3 ; SAP hybris Commerce 5.0.4 ; SAP hybris Commerce 5.7 ; SAP hybris Commerce Suite 5.2 ; SAP hybris Commerce Suite 5.3 ; SAP hybris Commerce Suite 5.4 ; SAP hybris Commerce Suite 5.5 ; SAP hybris Commerce Suite 5.5-1 ; SAP hybris Commerce Suite 5.6 ; hybris Commerce Suite 5.0 ; hybris Commerce Suite 5.1 ; hybris Commerce Suite 5.1.1

Keywords

hybris, validation, typeconstraint, evaluation, order , KBA , CEC-COM-CPS , Commerce Platform & Suite (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 ONE Support launchpad (Login required).

Search for additional results

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