First I thought it should be fairly simple to get ID of the node defined in bpmn file. But doesn't seem like that.

Basically I want to get task ID of the current node that's been active in the processInstance. Not the long value which is returned from TaskSummary or from NodeInstance object. But the String value defined in BPMN file. For instance, from below example, I want some method that returns "_2", given NodeInstance or ProcessInstance objects

hehe.. I think maciej get the background of my question.. If you base your application on the model internal IDs and then you someone changes the model, remove and add a node later on, you application which uses the models ID will explode in a billon pieces to put it in a nice way

I want to keep some mapping between web pages to be shown and corresponding id defined in BPMN file. I want to show a different web page for user to feed in data based on what human task is pending. Once I define this mapping, I can get HTML page to be shown based on the id of the pending human task. ID defined in BPMN file is the only task ID I have. Other long IDs that are generated by jBPM engine can't be used for this mapping, as I don't know what's the algorithm for generating those IDs. And I didn't really get your logic of why application with blow up. IDs are defined manually by a developer who writes the BPMN file, why will it change while adding other nodes?

"I want to keep some mapping between web pages to be shown and corresponding id defined in BPMN file" That doesn't sounds as a good idea...

When you say: "IDs are defined manually by a developer who writes the BPMN file" this is true when you have a controlled scenario that will never change. The IDs will change because if you remove and add a new one with the graphical editor the ID will be incremented and the new node will not have the old ID. As you mention you cannot rely on the other ID (the long one) because you don't know the algorithm used to generate that. You are creating a strong binding from the process to the BPMN file which is not a good idea. Why not using a Task List Oriented Approach, where the user picks the tasks from a list of pending tasks, and if the user just have one task, that task is automatically displayed?

i have been using Eclipse based BPMN editor, one mentioned in jBPM docs, and it never changes the task IDs already defined in the BPMN file. It would be a bad idea for any editor to change existing IDs of BPMN file when a file in imported. In my view, it's will be a bad editor design. Hopefully, we wouldn't come across that kind of editor