2020 Nov 02 3:21 PM - edited 2024 Feb 03 7:16 PM
Hello All,
We are observing a strange behaviour for Custom Dynamic Constraints, where validation engine is picking the first available dynamic constraint from Iterator for given annotation class and not the one return by ConstraintViolation, which caused constraint violations to display in the Backoffice ( Product Cockpit ) incorrectly.
We have created the dynamic constraints through impex and used below annotation for all the constraints.
de.hybris.platform.validation.annotations.Dynamic
But as per the OOTB logic , It looks like Hybris is expecting unique annotation class for each new Dynamic constraint.
Did anyone came across this kind of scenarios ? and if yes , what should be the suitable solution?
Currently we are using Hybris1808.
Looking for your help if you have any view or experience on this topic. Thanks in advance 🙂
OOTB class to build the constraints models.
DefaultHybrisConstraintViolation.class
private AbstractConstraintModel buildConstraintModel(ConstraintViolation constraintViolation) {
AbstractConstraintModel result = null;
Object model = constraintViolation.getLeafBean();
if (model instanceof ItemModel) {
String type = this.modelService.getModelType(model);
TypeModel typeModel = this.typeService.getType(type);
.......
while(var14.hasNext()) {
AbstractConstraintModel attribConstraintModel = (AbstractConstraintModel)var14.next();
if (attribConstraintModel.getAnnotation().equals(annotationClass)) {
result = attribConstraintModel;
break;
}
}
<br>
User | Count |
---|---|
12 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.