I’ll walk you through a comprehensive solution for handling nested variant configuration attributes in the quote-to-order process:
1. Variant Configuration Attribute Mapping Strategy
The core issue is that CPQ’s hierarchical characteristic model doesn’t directly map to Commerce Cloud’s flat order line item structure. You need a three-tier approach:
Tier 1 - Product Catalog Alignment:
Ensure your Commerce product catalog has flat extension attributes that correspond to all leaf-level characteristics:
- In Commerce Backoffice, navigate to System > Types > Product
- Create custom attributes for each configuration option: processorType, ramSize, storageType, storageCapacity
- These should be direct attributes on the variant product type, not classification attributes
- Set these attributes as ‘Include in Order’ = true
Tier 2 - CPQ Configuration Model:
Structure your CPQ product rules to output flattened characteristic values:
// In CPQ product configuration rules
IF BaseProduct.Type = 'Laptop' THEN
SET FlatAttribute.ProcessorType = Processor.Type
SET FlatAttribute.ProcessorCores = Processor.CoreCount
SET FlatAttribute.RAMSize = Memory.Capacity
SET FlatAttribute.StorageType = Storage.Technology
END
2. Nested Characteristic Handling in Integration Layer
In your Cloud Integration iFlow, implement a custom mapping script that traverses the characteristic hierarchy:
Script Logic (Groovy):
// Flatten nested characteristics
def flattenCharacteristics(node, prefix = '') {
def result = [:]
node.characteristics.each { char ->
def key = prefix ? "${prefix}_${char.name}" : char.name
if (char.hasChildren()) {
result.putAll(flattenCharacteristics(char, key))
} else {
result[key] = char.value
}
}
return result
}
This script recursively processes your nested structure:
- BaseProduct > Processor > Type=‘i7’ becomes ProcessorType=‘i7’
- BaseProduct > Memory > Capacity=‘16GB’ becomes MemoryCapacity=‘16GB’
- BaseProduct > Storage > Technology=‘SSD’, Capacity=‘512GB’ becomes StorageType=‘SSD’, StorageCapacity=‘512GB’
3. Custom Attribute Support in Order Creation
Integration Flow Configuration:
- Add a Message Mapping artifact after the quote retrieval step
- Map flattened CPQ characteristics to Commerce order line item extension fields:
- CPQ: FlatAttribute.ProcessorType → Commerce: orderEntry.processorType
- CPQ: FlatAttribute.RAMSize → Commerce: orderEntry.ramSize
- CPQ: FlatAttribute.StorageType → Commerce: orderEntry.storageType
Extension Field Registration:
Register these mappings in your integration configuration:
- Open the CPQ-Commerce connector settings
- Navigate to ‘Custom Attribute Mappings’
- Add mapping entries for each flattened attribute
- Enable ‘Preserve Configuration Data’ option to maintain the full hierarchy as JSON in a memo field for reference
4. Handling Multi-Level Product Structures
For complex hierarchies (base > variant group > specific SKU), implement a cascading mapping strategy:
- Level 1 (Base): Product family attributes (category, series)
- Level 2 (Variant Group): Configurable options (processor family, memory type)
- Level 3 (SKU): Specific values (exact model number, capacity)
Map all three levels to a single flat structure in the order, but maintain the hierarchy in a custom JSON field for audit and re-configuration purposes.
5. Validation and Error Handling
Add validation logic in your iFlow:
// Validate all required characteristics are mapped
requiredAttrs = ['ProcessorType', 'RAMSize', 'StorageType']
requiredAttrs.each { attr ->
if (!flattenedMap.containsKey(attr)) {
throw new Exception("Missing required characteristic: ${attr}")
}
}
6. Testing Approach
- Create test quotes with 1-level, 2-level, and 3-level nested characteristics
- Verify each configuration level maps correctly to order line items
- Check that pricing calculations reflect the correct variant
- Confirm that order confirmation emails show the complete configuration
Common Pitfall: Don’t rely on classification attributes for order mapping. They’re great for product information management but unreliable for transactional data transfer. Always use direct product attributes for characteristics that need to flow through to orders.
After implementing this approach, your nested laptop configurations should transfer completely from quote to order with all processor, memory, and storage specifications intact.