RuleBase ruleBase = createKnowledgeBase();
StatefulSession session = ruleBase.newStatefulSession();
session.getWorkItemManager().registerWorkItemHandler("Finder", new FinderWorkItemHandler());
session.getWorkItemManager().registerWorkItemHandler("Archive", new ArchiveWorkItemHandler());
session.getWorkItemManager().registerWorkItemHandler("Exec", new ExecWorkItemHandler());
session.getWorkItemManager().registerWorkItemHandler("Log", new WorkItemHandler() {
public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
System.out.println("Log: " + workItem.getParameter("Message"));
manager.completeWorkItem(workItem.getId(), null);
}