I’ve debugged this exact scenario multiple times in tc-12.4 environments. The problem involves all three areas you’ve identified, and the solution requires systematic verification.
Workflow Trigger Configuration:
First, verify your workflow launch criteria in the template definition. The workflow-trigger must be properly configured with the correct event type:
<LaunchCriteria>
<EventType>FormulaModified</EventType>
<ObjectType>WTPart</ObjectType>
</LaunchCriteria>
Formula Update Event Handling:
The formula-update event in tc-12.4 has specific requirements. Ensure your event subscription is configured correctly:
EventSubscription sub = EventSubscription.newEventSubscription();
sub.setEventType("FormulaModified");
sub.setSubscriberClass("com.acme.WorkflowLauncher");
Critically, the event must be a POST_INVOKE subscription, not PRE_INVOKE.
Event Mapping Verification:
The event-mapping between formula modifications and workflow launches requires proper action handler registration. Check your workflow template’s event action configuration:
// Pseudocode - Event mapping verification steps:
1. Query workflow template for Formula_Review_WF
2. Get associated event actions from template definition
3. Verify FormulaModified event has registered action handler
4. Check action handler class implements WorkflowLaunchable interface
5. Confirm handler's isApplicable() method returns true for formula objects
// See TC Workflow Administration Guide Section 6.3
Common Issues in TC-12.4:
- Event Subscription Timing: Formula events must complete transaction commit before triggering workflows. Add this to your subscription:
sub.setTiming(EventSubscription.POST_EVENT);
sub.setTransactionBehavior(EventSubscription.AFTER_COMMIT);
- Object Type Filtering: If your formulas are on specific part types, ensure event filters match:
sub.setObjectTypeFilter("com.acme.CustomPart");
- Workflow Template Deployment: Re-deploy your workflow template after verifying event mappings. Sometimes the event-mapping registration doesn’t persist correctly during initial deployment.
Testing Procedure:
- Enable debug logging for workflow engine and event service
- Update a formula on a test part
- Monitor MethodServer logs for FormulaModified event firing
- Verify event reaches workflow launch handler
- Check for any exception stack traces in workflow engine logs
Additional Fix for TC-12.4:
There’s a known issue where formula events don’t propagate if the formula is updated through certain API methods. Ensure formula updates use:
Formula formula = part.getFormula();
formula.setExpression(newExpression);
PersistenceHelper.manager.save(formula);
PersistenceHelper.manager.refresh(part);
The refresh() call is crucial for event propagation.
After implementing these changes, test with a new formula modification. The workflow should trigger automatically within seconds of the update completing.