I understood that in order to run HumanTask I have to register an handler. for example:
StatefulKnowledgeSession session = session.getWorkItemManager().registerWorkItemHandler("Human Task", new CommandBasedWSHumanTaskHandler());
I looked in the implementation of the class and realized that CommandBasedWSHumanTaskHandler in connect() method connects to port 9123 and starts a client task.
However, I saw in some examples, that I need to initialize this task:
TaskClient client = new TaskClient(new MinaTaskClientConnector("client 1",new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));
client.connect("127.0.0.1", 9123);
When do I have to invoke this TaskClient manually?
Who kills the task so it wouldn't sit on the same port with other tasks?