" </connections>\n" +
"\n" +
"</process>");
kbuilder.add( ResourceFactory.newReaderResource( source ), ResourceType.DRF );
KnowledgeBase kbase = kbuilder.newKnowledgeBase();
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
List<String> list = new ArrayList<String>();
ksession.setGlobal("list", list);
ProcessInstance processInstance = ksession.startProcess("org.drools.state");
assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
assertTrue(list.isEmpty());
Person person = new Person("John Doe", 30);
ksession.insert(person);
assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
assertEquals(1, list.size());
assertEquals("1", list.get(0));
}