How to get persistence id from a java connector
If you talk of users in BDM, I imagine that you have a bussiness object called "User" and in your process data, in the pool variables, you have defined a variable users that is a List of User, correct?
In that case, when you instance a process and initialize the list users, all data is stored in the variable. In each point of the process instance you can get the persistenceId of the User in that way:
import com.company.model.User def userVar = new com.company.model.User(); def pid userVar = users.get(i); // i is the index you want to know pid = userVar.persistenceId; //here you have the persistenceId