jbpm relies on hibernate which in turn relies on db to provide unique identifiers. So check that you have properly configured db. Moreover check processinstanceinfo table to see if there are unique ids for process instances.
Can I assume that processinstanceid is duplicate only when one process is completed and one is running? Can Running processes have the same processinstanceid? THX!