cancel
Showing results for 
Search instead for 
Did you mean: 

Classification and features list and values in tables

Former Member
0 Kudos

HI All

I am facing some issue with classifications , please go through below explanation

I was able to create a new classification from HMC , and able to map that classification to some categories

after that I am trying to fetch that data into my controller with below code , it was giving Nullpointer exception , and also please explain me in tables are these classification attributes and values are persist.

  • Code with I am using :

final FeatureList featureList = classificationService.getFeatures(productModel);

// Here I am getting NullPointer exception final Feature feature = featureList.getFeatureByCode("JewellaryClassificationSystem/1.0/color"); final FeatureValue featureValue = feature.getValue();

Thanks Nagendra

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI Potter

Thanks for your response

I understand what your exaplaine above but I have all valid data in HMC , and one more thing in below path I am not able to understand what is graphics, I know that resolutions is a attribute in classification, please clarify me what is graphics here.

graphics.resolutions

actual path : featureList.getFeatureByCode("SampleClassification/1.0/graphics.resolutions");

in My code color is attribute , I thing I have to add once more thing in the place of graphics, so if you can clear what graphics here then according to that I am able to add

Thanks Nagendra

former_member387866
Active Contributor
0 Kudos

Hi Nahendra,

It says nothing on the Catalog - Technical Guide, or any of it's sub-pages about the classification system they are using.

Your result could be gathered from product.color, colors or something similar. They use "graphics.resolution*S*", note the "S". So it may be colors or something.colors.

Reagrds, Luke

former_member387866
Active Contributor
0 Kudos

Hi Nagendra,

Are there actually any featured defined for the product? Check in the hMC and the Database. The NullPointerException might be coming from the fact that there are not any Feature types defined for the Product.

It's always a good idea to sanitise the data that you get from the database and check for Null data being returned.

 FeatureList features = classificationService.getFeatures(productModel);
 if (features != null) {
     Feature feature = features.getFeatureByCode("ClassificationSystem/path");
     FeatureValue featureValue = feature.getValue();
 }

As you can see from the Classification Feature Value API wiki page, they use another qualifier at the end of the call to getFeatureByCode(), in this case graphics.resolutions

 featureList.getFeatureByCode("SampleClassification/1.0/graphics.resolutions");

Perhaps you need a color.SOMETHING, possibly color.black, in your call.

I hope this is helpful,
Luke