Package pkg = builder.getPackage();
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage( pkg );
final List<String> myList = new ArrayList<String>();
WorkingMemory workingMemory = ruleBase.newStatefulSession();
workingMemory.getWorkItemManager().registerWorkItemHandler("Log", new WorkItemHandler() {
public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
String message = (String) workItem.getParameter("Message");
// System.out.println(message);
myList.add(message);
manager.completeWorkItem(workItem.getId(), null);