KnowledgeBase kbase = createKnowledgeBase();
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
ksession.getWorkItemManager().registerWorkItemHandler("Finder", new FinderWorkItemHandler());
ksession.getWorkItemManager().registerWorkItemHandler("Archive", new ArchiveWorkItemHandler());
ksession.getWorkItemManager().registerWorkItemHandler("Exec", new ExecWorkItemHandler());
ksession.getWorkItemManager().registerWorkItemHandler("Log", new WorkItemHandler() {
public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
System.out.println("Log: " + workItem.getParameter("Message"));
manager.completeWorkItem(workItem.getId(), null);
}
public void abortWorkItem(WorkItem arg0, WorkItemManager arg1) {