Skip to Content
author's profile photo Former Member
Former Member

Validation on Classification Attribute not working

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,

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 22, 2016 at 07:34 PM

    Hi, This is somehow supported by the Telco extensions and documented in the hybris wiki.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 05, 2015 at 03:02 PM
    -1

    Has anyone got a solution to this? We would like validation on classification attributes but currently can't find a way to implement it.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.