to change the TimerJobFactoryManager you'll need to provide your own TimerService impl and all other components that it utilizes. This is because they do heavily rely on its capabilities and then it might be rather complex to change just one component.
Could you elaborate why you need to change TimerJobFactoryManager?
Basically, I'm using jBPM within a framework that already exists in our system. It relies heavily on container managed transactions so we've enabled those within jBPM. jBPM is working perfectly in general - creating processes / tasks, starting them, completing them etc.
The issue came in when we started using timers - as the timer job is triggered from the thread pool, there is no container managed transaction and we start getting no transaction in progress messages.
Our workaround for now is to extend GlobalJpaTimerJobInstance and manually create the transaction, call super.call() and then commit the transaction. For this it seemed that it would be easiest to use a custom TimerJobFactoryManager and get it to return our custom GlobalJpaTimerJobInstance.
For now I've basically just mirrored the functionality of ThreadPoolSchedulerService so that it uses a handed in TimerJobFactoryManager and then set that up on the RuntimeEnvironmentBuilder.
This is working fine, in that the timed jobs are now triggering and advancing states.
Unfortunately the timers aren't persisting through server bounces - I'm not sure if that's because of my changes or because I've just set them up incorrectly. It appears that all of the Timers are kept serialized in SessionInfo? The SessionInfo entry hasn't been updated however - each time I boot up the server it runs the three timers that were last persisted, and any new timers are lost.
Is there a way that I can manually trigger this update? It seems that having to reserialize all of the timers each time a new timer is created could cause performance issues?