Skip to Content
0
Former Member
Apr 29, 2015 at 08:05 PM

Using enumerations as a classification attribute values

1077 Views

I'm using the classification system to import values from my client's item master feed from the retailer's ERP.

It will work like a charm if classification attribute assignment sets the attribute to a string. This is the assumption made in both the powertools initial data, as well as the electronics store.

What if I want to use an enum (or value list), because the classification attribute value is a fixed set of values?

Suppose I've defined 2 attributes whose key names are gender and color:

 INSERT_UPDATE ClassificationAttribute;$classSystemVersion;code[unique=true];name[lang=en];externalID;
 ;;CLA-2100;"Gender"  ;123;
 ;;CLA-2101;"Color"      ;456;
 

This is just illustrative. My client has other classification attributes that also want to be enumerations such as the marketing season, or the brand.

I configure the assignments for both of these classification attributes as follows.

 INSERT_UPDATE ClassAttributeAssignment;$class;$attribute;position;$unit;attributeType(code[default=string]);multiValued[default=false];range[default=false];localized[default=true]
 ;SAME_CLASS;CLA-2100;1 ;<ignore>;enum;;;
 ;SAME_CLASS;CLA-2101;2 ;<ignore>;enum;;;
 

How do I define the possible enumeration values for each of these attributes? I want it to be the case that the gender attribute (CLA-2100) can only be: Male, Female or Children, and that the color attribute (CLA-2101) can only be: Red, Green, Blue, etc. I'd prefer to define this through an impex.