Do you need processIds or ProcessIntanceIds. These are 2 different things. ProcessIds are the Ids of the processes however each instance of the process will have a ProcessInstanceId. So if there are 2 processes in your system, you will have 2 processIds and if there are 10 instances of each process running, you will have 20 processInstances working in your engine, 10 for each processId.
If you need process information available in the system, you can query the ksession for them. You can get all available process Ids as:
Iterator<org.drools.definition.process.Process> it = kSession.getKnowledgeBase().getProcesses().iterator();
If you want all processInstances for a specific processId in the system, you can do so by using the DB Logger by using the following line in the while loop instead of the line which is there now and iterate these to get the information on each process instance.
List<ProcessInstanceLog> pl = JPAProcessInstanceDbLog.findProcessInstances(it.next().getId());