Let me provide a complete solution addressing all three critical areas:
BOM Hierarchy Mapping Configuration:
First, properly configure the hierarchy mapping in Apriso’s BOM import template. The key is defining the parent-child relationship explicitly:
-
Navigate to Advanced Planning > Configuration > BOM Import Templates
-
Edit your Windchill import template
-
Set these critical parameters:
- Import Mode: Hierarchical (not Flat)
- Processing Order: Bottom-Up (leaf nodes first)
- Parent Reference Field: Map to your PLM’s ParentComponentUID
- Level Identifier: Map to BOMLevel or HierarchyDepth field
- Max Hierarchy Depth: Set to 10 (allows room for deep BOMs)
-
Define the relationship mapping in XML structure:
<HierarchyMapping>
<ParentKey field="ComponentID" type="string"/>
<ChildKey field="ParentComponentID" type="string"/>
<LevelIndicator field="BOMLevel" type="integer"/>
<RecursionEnabled>true</RecursionEnabled>
</HierarchyMapping>
Recursive Import Logic Implementation:
The import process needs to handle recursion properly. Implement a staged approach:
// Pseudocode - Recursive BOM import logic:
1. Load all BOM components into staging table from PLM export
2. Identify root level components (ParentComponentID is null)
3. Import root components first (Level 0)
4. For each imported parent:
- Query staging for children (WHERE ParentComponentID = parent.ID)
- Import child components (Level N+1)
- Recursively process each child's children
- Continue until no more children found
5. Validate complete hierarchy integrity after import
6. Log any orphaned components (parent not found)
Critical configuration changes needed:
- Increase REST API timeout from 60s to 600s (10 minutes) in apriso-config.xml
- Set database transaction timeout to 900s
- Enable batch processing with chunk size of 100 components
- Configure retry logic for failed hierarchy levels (3 attempts with exponential backoff)
Add this to your import job configuration:
<ImportJob name="BOM_Sync">
<Timeout>600000</Timeout>
<BatchSize>100</BatchSize>
<RetryAttempts>3</RetryAttempts>
<ProcessingMode>Recursive</ProcessingMode>
</ImportJob>
PLM Export Validation Requirements:
Validate the Windchill export structure before import begins. Add a pre-import validation step:
- Completeness Check: Verify all hierarchy levels are present in export
SELECT BOMLevel, COUNT(*) as ComponentCount
FROM PLM_Export_Staging
GROUP BY BOMLevel
ORDER BY BOMLevel;
Expected result should show progressive counts: Level 0 (root), Level 1 (assemblies), Level 2-4 (sub-components)
- Referential Integrity: Ensure all parent references are valid
SELECT COUNT(*) as OrphanedComponents
FROM PLM_Export_Staging child
WHERE child.ParentComponentID IS NOT NULL
AND NOT EXISTS (
SELECT 1 FROM PLM_Export_Staging parent
WHERE parent.ComponentID = child.ParentComponentID
);
Result should be 0. Any orphaned components indicate PLM export issues.
- Circular Reference Detection: Check for infinite loops
WITH RECURSIVE BOMHierarchy AS (
SELECT ComponentID, ParentComponentID, 1 as Depth
FROM PLM_Export_Staging
WHERE ParentComponentID IS NULL
UNION ALL
SELECT s.ComponentID, s.ParentComponentID, h.Depth + 1
FROM PLM_Export_Staging s
JOIN BOMHierarchy h ON s.ParentComponentID = h.ComponentID
WHERE h.Depth < 10
)
SELECT MAX(Depth) as MaxDepth FROM BOMHierarchy;
If MaxDepth hits 10, you likely have circular references.
- Windchill Export Configuration: Ensure PLM export includes all required fields
- In Windchill, edit the BOM export template
- Enable “Include All Levels” option
- Set “Hierarchy Expansion” to “Full”
- Add these mandatory attributes: ComponentID, ParentComponentID, BOMLevel, Quantity, UOM
- Disable any view filters that might exclude components
Implementation Steps:
- Week 1: Update Apriso import template with correct hierarchy mapping and increased timeouts
- Week 2: Implement pre-import validation checks on PLM export
- Week 3: Deploy recursive import logic with batch processing
- Week 4: Test with progressively deeper BOMs (2-level, 3-level, 5-level) and validate completeness
Monitoring & Troubleshooting:
Add detailed logging at each recursion level:
- Log component count at each level before and after import
- Track processing time per level
- Alert if any level shows >10% import failure rate
- Generate reconciliation report comparing PLM export vs MES imported counts
This approach resolved similar issues for a client with 6-level BOMs containing 2000+ components. Import success rate improved from 45% to 98%, with remaining 2% being actual data quality issues in PLM that needed manual correction.