KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
// setup task client to use running BRMS server task client.
TaskClient client = new TaskClient(new HornetQTaskClientConnector("taskClient" + UUID.randomUUID(),
new HornetQTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));
client.connect("127.0.0.1", 5153);
// setup task client to use running BRMS server task client.
CommandBasedHornetQWSHumanTaskHandler handler = new CommandBasedHornetQWSHumanTaskHandler(ksession);
handler.setClient(client);