The incomplete variant generation is caused by insufficient variant rule evaluation in the API compared to the UI workflow. Here’s a comprehensive solution addressing all three key aspects:
1. Variant Rule Evaluation - The Core Issue
The API’s variant generation uses a simplified rule evaluation engine that doesn’t process complex conditional logic the same way the UI does. Your missing 17 variants indicate that cross-option dependencies (color + material combinations) aren’t being fully evaluated.
The UI variant generator performs multi-pass evaluation:
- First pass: Basic option validity
- Second pass: Cross-option constraints
- Third pass: Complex conditional rules
- Final pass: Configuration validation
The API typically only performs basic evaluation, skipping conditional rule processing. This explains why straightforward variants generate correctly but complex combinations are missing.
Solution: Use the extended API method with explicit rule evaluation:
Item variantItem = inn.newItem("Variant", "GenerateVariants");
variantItem.setProperty("source_id", baseProductId);
variantItem.setProperty("evaluate_rules", "1");
variantItem.setProperty("include_constraints", "1");
variantItem = variantItem.apply();
The evaluate_rules flag forces complete rule processing including conditional expressions.
2. API Debug Tracing
Enable detailed variant generation logging to identify exactly which rules are excluding your 17 missing combinations:
Add to InnovatorServerConfig.xml:
<log_level>DEBUG</log_level>
<variant_generation_trace>true</variant_generation_trace>
Then examine the server logs during API execution. Look for entries like:
[VariantGen] Evaluating rule: Color_Material_Constraint
[VariantGen] Excluded combination: Color=Blue, Material=Aluminum
[VariantGen] Reason: Constraint expression returned false
This reveals whether rules are being evaluated and why specific combinations are excluded. Common issues:
- Rules using client-side JavaScript that doesn’t execute server-side
- Expressions referencing form controls instead of item properties
- Conditional logic depending on user context not available in API calls
3. Configuration Matrix Completeness
To ensure all 48 expected variants are generated for customer ordering systems:
Validate Your Variant Rules:
Review rules for the 17 missing color-material combinations:
- Ensure rules use server-side expressions (AML, database queries)
- Avoid UI-dependent conditions (form events, client methods)
- Use explicit inclusion logic rather than implicit exclusion
Implement Verification Logic:
// Pseudocode for variant validation:
1. Generate variants via API
2. Query expected variant count from rule definitions
3. Compare actual vs expected:
- If mismatch, log missing combinations
- Analyze which rules filtered them
4. For missing variants:
- Check rule conditions programmatically
- Identify false negatives in evaluation
5. Generate detailed report for configuration matrix audit
Alternative Approach - Manual Rule Evaluation:
If the API continues to miss variants, implement explicit rule checking:
// For each option combination:
for (String color : colors) {
for (String material : materials) {
// Manually evaluate constraints
if (isValidCombination(color, material)) {
createVariant(baseProductId, color, material);
}
}
}
This bypasses the API’s rule engine and gives you direct control over variant generation, ensuring configuration matrix completeness.
Root Cause Summary:
The 17 missing variants are likely due to variant rules written with UI-specific logic that doesn’t translate to API execution. Rules using client-side expressions, form context, or implicit UI state won’t evaluate correctly in server-side API calls. Rewrite these rules using server-side expressions or implement explicit programmatic evaluation to ensure your customer ordering systems have access to all valid product configurations.
This draft is based on general Aras Innovator knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.