You are getting optimistic lock exception which means you are modifying same process instance from different threads at the same time. What is the use case to do such this? Since you're getting optimistic lock exceptions it means transactions are working as expected, jBPM joins MDB transaction but since there are concurrent operations on same instance one of them will fail.
I think that the user transactions used by the application and JBPM are not the same.
For example I have Bean A and Bean B. Inside Bean A I start the process flow and create a JMS message to trigger the next MDB in Bean B. Bean B will only be triggered right after the ut.commit() is executed. So looking at this specific scenario, it's not supposed to be a concurrent transaction. But somehow, I'm getting this optimistic lock exceptions in the ProcessInstanceInfo randomly inside Bean B so i'm thinking that the JBPM transactions are not in-sync with the MDB user transactions.