env.set( EnvironmentName.ENTITY_MANAGER_FACTORY,
ctx.getBean( "myEmf" ) );
env.set( EnvironmentName.TRANSACTION_MANAGER,
ctx.getBean( "txManager" ) );
KieStoreServices kstore = (KieStoreServices) ctx.getBean( "kstore1" );
KieBase kbase1 = (KieBase) ctx.getBean( "kbProcessWorkItems" );
service = kstore.loadKieSession( sessionId,
kbase1,
null,
env );
log.info( "---> load session: " + sessionId );
processInstance = service.getProcessInstance( procId );
log.info( "---> GetProcessInstanceCommand id: " + procId );
assertNotNull( processInstance );
Thread.sleep( 1000 );
log.info( "---> session disposed" );
service.dispose();
service = kstore.loadKieSession( sessionId,
kbase1,
null,
env );
log.info( "---> load session: " + sessionId );
Thread.sleep( 3000 );