List<String> list = new ArrayList<String>();
Map globals = new HashMap();
globals.put("list", list);
StatefulKnowledgeSessionSetGlobalStage setGlobal = new StatefulKnowledgeSessionSetGlobalStage();
StatefulKnowledgeSessionPipelineImpl pipeline = new StatefulKnowledgeSessionPipelineImpl(ksession);
pipeline.setReceiver( setGlobal );
pipeline.insert( globals, null );
Map vars = new HashMap();
vars.put( "variable", "SomeText" );
StatefulKnowledgeSessionStartProcessStage startProcess = new StatefulKnowledgeSessionStartProcessStage("org.drools.actions");
pipeline = new StatefulKnowledgeSessionPipelineImpl(ksession);
pipeline.setReceiver( startProcess );
pipeline.insert( vars, null );
assertEquals(1, list.size());
assertEquals("SomeText", list.get(0));
}