Your handler implementation has multiple integration issues causing the workflow blocking. Let me address all the key aspects:
Handler Completion Callback Mechanism:
The fireCompletionCallback() method needs proper event context propagation. Your current implementation doesn’t pass the workflow transition context. Modify to:
public void processEvent(RevisionEvent event) {
event.setCompletionMode(EventCompletionMode.SYNCHRONOUS);
validateDependencies(event.getRevision());
event.signalCompletion(EventStatus.SUCCESS);
}
Event Dispatcher Configuration:
In BMIDE, your Event Handler Registration must specify:
- Execution Mode: SYNCHRONOUS
- Wait for Completion: TRUE
- Transaction Boundary: REQUIRES_NEW
- Priority: 50 (ensures execution before workflow state change)
The dispatcher configuration in site.xconf should have:
wt.event.dispatcher.threadPool.maxSize=25
wt.event.dispatcher.timeout=60000
Workflow Transition Binding in BMIDE:
Your handler binding in the workflow template is likely configured as a Pre-Action. Change it to Rule Extension type:
- Open workflow template in BMIDE
- Navigate to transition node
- Add Rule Extension (not Pre-Action)
- Select your handler from registry
- Enable ‘Block Transition on Failure’ flag
- Set evaluation timing to ‘Before State Change’
This ensures the workflow engine waits for handler completion before proceeding with the transition.
Error Handling in Rule Extensions:
Implement proper exception handling with explicit completion signaling:
public void processEvent(RevisionEvent event) {
try {
event.setCompletionMode(EventCompletionMode.SYNCHRONOUS);
ValidationResult result = validateDependencies(event.getRevision());
if (!result.isValid()) {
event.signalCompletion(EventStatus.FAILURE, result.getMessage());
return;
}
event.signalCompletion(EventStatus.SUCCESS);
} catch (Exception e) {
event.signalCompletion(EventStatus.ERROR, e.getMessage());
throw new HandlerException("Validation failed", e);
}
}
The key issue is your handler doesn’t set synchronous completion mode before processing. The workflow engine defaults to asynchronous mode and proceeds without waiting. Additionally, verify your handler extends AbstractRevisionRuleHandler (not just RevisionHandler) which provides proper workflow integration support.
After making these changes, restart the method server and test the workflow transition. The timeout should resolve once the completion callback properly signals the workflow engine.
This draft is based on general Teamcenter knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.