Bulk part import fails to trigger custom post-processing script

Our custom post-processing script works fine when creating parts individually through the UI, but completely fails during bulk imports via the part import tool. The script is supposed to auto-generate related documents and set certain attributes based on part classification.

The trigger registration looks correct:


modify type WTPart add trigger postCreate
  action com.custom.PartPostProcessor

When we import 500+ parts using the bulk import utility, none of the post-processing logic executes. The parts are created successfully, but without the expected related documents or calculated attributes. This creates data inconsistency issues because our downstream processes depend on these auto-generated artifacts. Has anyone experienced triggers not firing during batch operations?

The root cause is that ENOVIA’s bulk import tool behavior differs fundamentally from interactive UI operations, and your trigger registration needs to account for batch contexts. Let me address all three focus areas: bulk import tool behavior, trigger registration, and batch post-processing.

First, understand the bulk import tool behavior. The standard part import utility uses ENOVIA’s LoadFromFile or similar batch loading APIs that deliberately suppress event triggers for performance. When importing hundreds of parts, firing individual triggers for each part would create massive overhead. The tool batches database operations and commits them in chunks, bypassing the normal object lifecycle that fires your postCreate trigger.

Second, fix your trigger registration for batch operations. The standard trigger approach won’t work here. Instead, implement an EventSubscriber that explicitly handles batch contexts:

public class PartBatchSubscriber implements EventSubscriber {
  public void notify(Event event) {
    if (event instanceof PartCreationEvent) {
      processPartCreation((PartCreationEvent) event);
    }
  }
}

Register this subscriber with batch scope enabled in your eventSubscriber.xml configuration. The key difference is that EventSubscribers can be configured to fire during batch operations by setting the batchEnabled attribute to true, whereas standard triggers are suppressed.

Third, implement robust batch post-processing. Even with EventSubscribers, you’ll want a safety net for bulk operations. Create a scheduled job that runs after imports to catch any parts that didn’t get processed:

// Query parts created recently without post-processing
QuerySpec qs = new QuerySpec(WTPart.class);
qs.appendWhere(new SearchCondition(
  WTPart.class, "createStamp", ">=", yesterday));

This scheduled job should check for parts missing the expected related documents or calculated attributes, then apply your post-processing logic. This handles both the immediate batch import case and any edge cases where processing failed.

The most reliable solution combines two approaches:

  1. Immediate processing: Implement a custom ImportListener that hooks directly into the bulk import tool’s workflow. ENOVIA R2021x supports the wt.load.LoadListener interface. Create a class implementing this interface and register it in your site.xconf:
<Service name="com.custom.PartImportListener"
  class="com.custom.PartImportListener">
  <Option cardinality="singleton"/>
</Service>

Your ImportListener gets called for each batch of parts during import, allowing you to apply post-processing logic in real-time without the performance hit of individual triggers.

  1. Deferred processing: Schedule a background job that runs 15 minutes after typical import windows to catch any missed parts. This job queries for recently created parts lacking the expected artifacts and processes them in batches.

For your specific case with document generation and attribute calculations, the ImportListener approach is ideal because it maintains data consistency immediately during the import process. The listener can access the full part context and apply your existing PartPostProcessor logic within the batch transaction, ensuring that related documents and attributes are created atomically with the parts themselves.

Implementing this solution requires refactoring your PartPostProcessor into a shared service that both the EventSubscriber (for UI operations) and ImportListener (for batch operations) can call. This ensures consistent behavior across all part creation paths while respecting the performance requirements of bulk operations.


This draft is based on general ENOVIA knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.

Bulk import tools often bypass standard event triggers for performance reasons. The import utility uses direct database operations or batch APIs that skip the normal object lifecycle events. Check if your import tool has a ‘trigger events’ option that’s disabled by default. Some bulk operations deliberately suppress triggers to speed up processing.

Your trigger is registered on the type, but bulk import tools might be using a different API path. Instead of relying on postCreate triggers, consider implementing a batch post-processing job that runs after the import completes. You could query for parts created in the last import session and apply your logic to all of them at once. This gives you more control over when the processing happens and handles bulk operations better than individual triggers.

I’ve dealt with this exact scenario. The issue is that bulk import tools use transaction batching and often call lower-level persistence methods that don’t fire standard triggers. Your postCreate trigger works in the UI because the UI uses the full object creation workflow, but bulk tools optimize by bypassing event processing. You need to either modify the import tool configuration to enable event firing, or implement a custom import listener that hooks into the batch process specifically. Check if your ENOVIA version supports ImportListener interfaces that you can register for bulk operations.

We solved this by using ENOVIA’s EventSubscriber framework instead of simple triggers. EventSubscribers can be configured to fire even during batch operations if you set the proper subscription scope.

Thanks for the suggestions. I checked the import tool settings and didn’t find a ‘trigger events’ option. Would switching to EventSubscriber require significant code changes? Our current PartPostProcessor is already pretty complex with document generation and attribute calculations.