[jboss-user] [jBPM] - Re: Why is Timer event not triggered in J2EE container?

Mare Geldenhuys do-not-reply at jboss.com
Mon Aug 8 04:50:54 EDT 2011

Mare Geldenhuys [http://community.jboss.org/people/mgeldenhuys] created the discussion

"Re: Why is Timer event not triggered in J2EE container?"

To view the discussion, visit: http://community.jboss.org/message/619845#619845

Hi Gary,

I think that your suspicion is correct. The original transaction you use to create the process finishes successfully, since it is only mandated to create the process and that happens without a problem. Therefore the original transaction has already commited and is not available when the timer fires. 

Since the timer is executing now in the engine (StatefullKnowledgeSession) and transaction management has been specified as BMT. the engine now requires a transaction manager to get a transaction from it. And this is probably where the problem arises. 

The way you do that is by registering the Transaction Manager with the StatefullKnowledgeSession, and that is done upon creation/retrieval of the said StatefullKnowledgeSession. That means getting the Transaction Manager which is managed by Websphere in your case and passing it to the KnowledgeService through an Environment. 

The question now really is, how are you creating your StatefullKnowledgeSession? If you are using the jbpm-gwt-core jar's sources CommandDelegate as an example, you will have to look at the following lines,

|  |      | Environment env = KnowledgeBaseFactory.newEnvironment(); |
|  |      | env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf); |

This is where you will need to add the reference to your transaction manager, 

env.set( EnvironmentName.TRANSACTION_MANAGER,  TransactionManagerServices.getTransactionManager() );// Change this to  where you get your transaction manager from

If this does not work, someone from the community with more experience will need to assist. Whichever way, please post your findings, as I would like to see how it pans out.


Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110808/938c7fef/attachment.html 

More information about the jboss-user mailing list