Hello Kris,
I have been experimenting on this but I haven't quite been successfull.
I attached some files with the BPMN and the java that I am using to debug the process.
The facth is that the Java code that is executed inside the bpmn, returns a WorkItem ID=2.
System.out.println("Inside HT node 1");
System.out.println("Process id is "+kcontext.getProcessInstance().getId());
WorkItemNodeInstance wi = (WorkItemNodeInstance)kcontext.getNodeInstance();
System.out.println("getWorkItemId is " + wi.getWorkItemId());
System.out.println("WorkNodeID is " + wi.getId());
System.out.println("WorkItem UniqueID is " + wi.getUniqueId());
System.out.println("WorkItem ID " + wi.getId());
String s2 = ""+kcontext.getNodeInstance().getId();
System.out.println("Node Instance id is " +s2);
But once I get the Task, from de debug java class, the task WorkItem ID=1.
client.getTask(TID, responseHandler);
Task task = responseHandler.getTask();
TaskData td = task.getTaskData();
System.out.println("Task WorkItemID "+td.getWorkItemId());
BlockingTaskOperationResponseHandler eresponseHandler = new BlockingTaskOperationResponseHandler();
TaskOperationResponseHandler respHandler = null;
client.start(TID, "krisv", respHandler);
client.complete(TID, "krisv", null, eresponseHandler);
So there is no way to get a correlation between these two.
So how can I get this working?