for (DroolsError error: builder.getErrors().getErrors()) {
System.err.println(error);
}
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage( pkg );
WorkingMemory workingMemory = ruleBase.newStatefulSession();
List<String> list = new ArrayList<String>();
workingMemory.setGlobal("list", list);
TestWorkItemHandler testHandler = new TestWorkItemHandler();
workingMemory.getWorkItemManager().registerWorkItemHandler("Work", testHandler);
ProcessInstance processInstance = ( ProcessInstance )