Configuring an Integration Object with Classification Attributes
Configure Integration Objects with classification attributes.
The following code samples show how to create an example Integration Object that has classification attributes and how to define a Product type Integration Object and values for the classification attributes. Keep in mind when you configure Integration Objects with classification attributes that there are multiple configuration steps. You must:
-
Create the classification attributes if they do not exist.
-
Create an Integration Object with classification attributes.
-
Create a Product with classification attributes for that Integration Object.
-
Assign the classification classes to the Product and set values for the Product's classification attributes.
Creating an Integration Object with Classification Attributes
When you define regular type system attributes as part of an Integration Object, you use IntegrationObjectItemAttribute. To define classification attributes, however, use IntegrationObjectItemClassificationAttribute.
The following example creates the classification category dimensions with the attributes height, width, and depth.
$SYSTEM = Electronics
$VERSION = Staged
$SYSTEM_VERSION = $SYSTEM:$VERSION
$catalogVersionHeader = catalogVersion(catalog(id), version)
$systemVersionHeader = systemVersion(catalog(id), version)
INSERT_UPDATE ClassificationSystem; id[unique = true]
; $SYSTEM
INSERT_UPDATE ClassificationSystemVersion; catalog(id)[unique = true]; version[unique = true]
; $SYSTEM ; $VERSION
INSERT_UPDATE ClassificationClass; code[unique = true]; $catalogVersionHeader[unique = true]
; dimensions ; $SYSTEM_VERSION
INSERT_UPDATE ClassificationAttributeUnit; $systemVersionHeader[unique = true]; code[unique = true]; symbol; unitType
; $SYSTEM_VERSION ; centimeters ; cm ; measurement
INSERT_UPDATE ClassificationAttribute; code[unique = true]; $systemVersionHeader[unique = true]
; height ; $SYSTEM_VERSION
; width ; $SYSTEM_VERSION
; depth ; $SYSTEM_VERSION
$class = classificationClass($catalogVersionHeader, code)
$attribute = classificationAttribute($systemVersionHeader, code)
INSERT_UPDATE ClassAttributeAssignment; $class[unique = true] ; $attribute[unique = true]; unit($systemVersionHeader, code); attributeType(code)
; $SYSTEM_VERSION:dimensions; $SYSTEM_VERSION:height ; $SYSTEM_VERSION:centimeters ; number
; $SYSTEM_VERSION:dimensions; $SYSTEM_VERSION:width ; $SYSTEM_VERSION:centimeters ; number
; $SYSTEM_VERSION:dimensions; $SYSTEM_VERSION:depth ; $SYSTEM_VERSION:centimeters ; number
The following ImpEx defines a Product type Integration Object that includes the height, width, and depth classification attributes associated with dimensions, in addition to normal type system attributes.
$SYSTEM = Electronics
$VERSION = Staged
$SYSTEM_VERSION = $SYSTEM:$VERSION
$IO = ProductIO
INSERT_UPDATE IntegrationObject; code[unique = true]; integrationType(code)
; $IO ; INBOUND
INSERT_UPDATE IntegrationObjectItem; integrationObject(code)[unique = true]; code[unique = true]; type(code); root[default = false]
; $IO ; Product ; Product ; true
; $IO ; Catalog ; Catalog
; $IO ; CatalogVersion ; CatalogVersion
$item = integrationObjectItem(integrationObject(code), code)
$descriptor = attributeDescriptor(enclosingType(code), qualifier)
$attributeType = returnIntegrationObjectItem(integrationObject(code), code)
INSERT_UPDATE IntegrationObjectItemAttribute; $item[unique = true]; attributeName[unique = true]; $descriptor ; $attributeType;
; $IO:Product ; code ; Product:code
; $IO:Product ; catalogVersion ; Product:catalogVersion; $IO:CatalogVersion
; $IO:CatalogVersion ; version ; CatalogVersion:version
; $IO:CatalogVersion ; catalog ; CatalogVersion:catalog; $IO:Catalog
; $IO:Catalog ; id ; Catalog:id
$systemVersionHeader = systemVersion(catalog(id), version)
$classificationClassHeader = classificationClass(catalogVersion(catalog(id), version), code)
$classificationAttributeHeader = classificationAttribute($systemVersionHeader, code)
$classificationAssignment = classAttributeAssignment($classificationClassHeader, $classificationAttributeHeader)
INSERT_UPDATE IntegrationObjectItemClassificationAttribute; $item[unique = true]; attributeName[unique = true]; $classificationAssignment
; $IO:Product ; height ; $SYSTEM_VERSION:dimensions:$SYSTEM_VERSION:height
; $IO:Product ; depth ; $SYSTEM_VERSION:dimensions:$SYSTEM_VERSION:depth
; $IO:Product ; width ; $SYSTEM_VERSION:dimensions:$SYSTEM_VERSION:width
Viewing an Integration Object with Classification Attributes
You can view the imported Integration Object and its attributes in Backoffice or by making a GET request to the Meta API. See Related Information for more information.