emf );
env.set( EnvironmentName.GLOBALS, new MapGlobalResolver() );
StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );
ksession.getWorkItemManager().registerWorkItemHandler("MyWork", new SystemOutWorkItemHandler());
ProcessInstance processInstance = ksession.startProcess( "org.drools.test.TestProcess" );
ksession.insert( "TestString" );
assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
}