The process image can show you where it is currently sitting. For example, the jbpm-console has a process image, and if you look at the image for a process instance, the node where it is sitting will be highlighted.
I build that same functionality into my own webapp, so I simply click an "image" button for a process instance, and the image shows me where it is sitting.
You could also iterate through all task instances for the specific process instance, and those which have an end date are completed, and those whose end date is null, means its not completed. So you can determine from that which node it is sitting at in the process.
Oh yes and to get the user its currently sitting with, just simply get the actor id from the task instance its currently sitting at.
Thank you for your answer...
But how can I get the correct process instance, if I'm not the owner of root token? I mean, I log in my application with the user who partecipates in the process and wants to know where the process instance is waiting, but he hasn't any activity to complete...he wants only to know where the process instance is blocked...
For example I've seen ExecutionContext has method getProcessInstance...but if I'm outside a process instance, how can I get it? I think I can't access ExecutionContext...
I hope I've explained my problem...
you SHOULD have a reference to the process in your system/model/.... being it the root token, processid, busisnesskey otherwise there is no relation at all
All my users have a list of all task instances that they have completed. So if they did complete a task at some stage, they can click on "completed" tasks, view their list, and then select the task they want to view the process for.
If a user never actually performs a task for a process instance, you could always list all process instances, and let him select which one he wants to view.
I also have an "initiated processes" view, where a user can view a list of all process instances that he was the initiator of.
I have an admin user that can also view a list of all process instances, and all tasks, so he can take a look at anything he wants.
There are many ways to determine the process instance you want to view, it all depends on how your application is used, and how you want it to be used.
and also a process can be waiting in a 'state' where there are no tasks.