Error uploading a jpdl file with a wrong version format (aka: 1.0.0) which leaves the database inconsistent (bad formatted jpdl file) and does not let upload a new process definition with the same Name, because the service attempts to retrieve the previous version and throws an exception when parse the file. (NOTE: I am uploading a BAR file and the jpdl file is inside the bar)
In the RepositorySessionImpl you are doing the following steps:
session.save(deploymentImpl); // will also save the attached resources
That saves the Deployment data before checking the consistency of the jpdl file.