return jbpmContext;
}
private void joinTransaction() throws SystemException
{
UserTransaction transaction = Transaction.instance();
if ( !transaction.isActiveOrMarkedRollback() )
{
throw new IllegalStateException("JbpmContext may only be used inside a transaction");
}
if (jbpmContext == null)
{
log.debug( "recreating seam managed jBPM context" );
jbpmContext = Jbpm.instance().getJbpmConfiguration().createJbpmContext() ;
}
if ( !synchronizationRegistered && !Lifecycle.isDestroying() && transaction.isActive() )
{
jbpmContext.getSession().isOpen();
try //TODO: what we really want here is if (!cmt)
{
transaction.registerSynchronization(this);
}
catch (UnsupportedOperationException uoe)
{
jbpmContext.getSession().getTransaction().registerSynchronization(this);
}