from NodeInstance you can get access to Node which then has map of metadata and one of the metadata is the id of the node, it is stored under UniqueId key in the meta data map.
Thanks for the pointer. However, I'm unable to get a NodeInstance. Perhaps I'm using the wrong ID? Here is code I have tried:
org.kie.api.runtime.process.NodeInstance ni = processInstance.getNodeInstance(workItem.getProcessInstanceId());
org.kie.api.runtime.process.NodeInstance ni2 = processInstance.getNodeInstance(workItem.getId());
log.info("NODE INSTANCE: "+ni+" (for workItem.getProcessInstanceId() = "+workItem.getProcessInstanceId()+")");
log.info("NODE INSTANCE: "+ni2+" (for workItem.getId() = "+workItem.getId()+")");
And this is the output:
NODE INSTANCE: null (for workItem.getProcessInstanceId() = 196)
NODE INSTANCE: null (for workItem.getId() = 1019)
As you can see, I'm getting null for the NodeInstance variables. How do I get the nodeInstanceId from the workItem?