StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
// setup task client to use running BRMS server task client.
TaskClient client = new TaskClient(new HornetQTaskClientConnector("taskClient",
new HornetQTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));
AsyncWSHumanTaskHandler handler = new AsyncWSHumanTaskHandler(client, ksession);
handler.setConnection("127.0.0.1", 5153);
// register work items.
ksession.getWorkItemManager().registerWorkItemHandler("Log", new SystemOutWorkItemHandler());
ksession.getWorkItemManager().registerWorkItemHandler("Email", new SystemOutWorkItemHandler());
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", handler);