Hi, Requirement :: Have to perform validation on classification attribute. I have create a "Type constraint" of Itemtype "Product". My code snippet is: ProductModel productModel = (ProductModel) value; final List productFeatures = productModel.getFeatures(); for (final ProductFeatureModel productFeature : productFeatures) { if ("packagingDetails".equalsIgnoreCase(productFeature.getClassificationAttributeAssignment() .getClassificationAttribute().getCode())) { final Feature feature = classificationService.getFeature(productModel, productFeature.getClassificationAttributeAssignment()); final List featureValues = feature.getValues(); if (featureValues != null && !featureValues.isEmpty()) { for (int i = 0; i < featureValues.size(); i++) { final FeatureValue featureValue = featureValues.get; if (null != featureValue.getValue()) { return true; }
Problem :: If I changed classification attribute in a product and try to save it, my constraint is not get called. Since it is not an attribute of product model. I have tried with with "ProductFeatureModel, ClassificationSystemModel, ClassificationAttributeModel, ClassificationAttributeValueModel". But my constraint is not get called. So please help on which model, the classification attribute is getting saved and how to capture the value of classification attribute onChange.
Thanks,
Hi, This is somehow supported by the Telco extensions and documented in the hybris wiki.
Add a comment