Well I tried to add it like this but it didn't work:
@Override
public void afterNodeTriggered(ProcessNodeTriggeredEvent event) {
Node node = event.getNodeInstance().getNode();
if (node instanceof HumanTaskNode) {
BlockingGetTaskResponseHandler handler = new BlockingGetTaskResponseHandler();
taskClient.getTasksAssignedAsPotentialOwner(userName, "en-UK", handler);
..
//send web services
}
The new task was not added to the database at this point!
When can I add this piece of code that will send web service about the new task with the task id?