Okay so I tried the code and it gave me a class cast exception. Then I tried your previous code, it seems to be giving me the coordinates but not exactly in a way I need them.
I have got a process with a start node, 3 human task nodes, and an end node. So total of 5 nodes.
Out of the 3 human task nodes, I have completed 1 human task. It is at 2nd human task.
The code returned me 5 nodes. But the first 2 nodes returned are both start nodes, next 2 are both of first human task and 5th node is of second human task. Even in the db I have 5 nodes. I am not sure if thats how the information is logged or if this is a bug.
But what I am looking for is the coordinate of just the second human task since the process is pending at it.
But at least I am getting the coordinates now thanks to you. I am gonna try to figure out the problem/logic. If you already know then you are most welcome to share. Thanks.