I have had the same problem and found that a manual delete from the JBPM_LOG:
delete from JBPM_LOG
where JBPM_LOG.variableinstance_ = JBPM_VARIABLEINSTANCE.id_
and JBPM_VARIABLEINSTANCE.processinstance_ = yourProcessInstanceId)
...followed by the variable instance rows that are causing the conflict:
delete from JBPM_VARIABLEINSTANCE
Where JBPM_VARIABLEINSTANCE.processinstance_ = yourProcessInstanceId
...allows the deleteProcessInstance() to complete and perform a successful commit to the database.
Hopefully this will patch it until the next release.
This can be done using:
String  sql = new String;
sql = "begin transaction";
sql = "delete from JBPM_LOG Where exists (select id_ from JBPM_VARIABLEINSTANCE where JBPM_LOG.variableinstance_ = JBPM_VARIABLEINSTANCE.id_ and JBPM_VARIABLEINSTANCE.processinstance_ = " + processInstance.getId() + ")";
sql = "delete from JBPM_VARIABLEINSTANCE Where JBPM_VARIABLEINSTANCE.processinstance_ = " + processInstance.getId();
sql = "commit";
Once the process instance or definition is deleted i have not found any side effects from the manual delete
Thanks for looking into this. What release will this be a part of? I checked sourceforge and do not see any releases for a 3.1 beta or such.
It seems it doesn't work for me.
I have added a "delete" action in the cvs webapp (from the process instances list for a process definition), and an exception occurs with this action.
May be you can test the webapp delete action ?