KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
List<String> list = new ArrayList<String>();
ksession.setGlobal("list", list);
ProcessInstance processInstance = ksession.startProcess("RuleTask");
assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
restoreSession(ksession, true);
ksession.fireAllRules();
assertTrue(list.size() == 1);
assertProcessInstanceCompleted(processInstance.getId(), ksession);