JBPM Process with multiple subflows is working correctly in jBPM 4.1 but upgrade to 4.2 causes an integrity constraint when the final subprocess executes successfully and returns control to the main process which then should simply end with an end-success. It would appear that the subprocess record is attempting to be deleted but fails due to an integrity constraint violation.
Actually under further investigation I have moved this code into a simple JBPM Unit test in eclipse to remove the outside influences of WLS etc and there is a similar error (although the process does not get as far this time). I have attached the jUnit classes to this bug report together with the jbpm.hibernate.cfg.xml which points to the Oracle 11g DB (using 10g dialect). In order to replicate this run the JUnit test GdfWorkflowTest which will create the GDFWorkflow. This has an async first node so returns to the caller immediately. The next step is a call to the first sub-process which works and that subprocess sits and waits until signalled.
Now run the GdfSignaller as a Java Application and use the GDF-PROV.XXXXXX id as a program argument on the Eclipse Java command runner and this will signal the GDFProvisionOrder subprocess and the execution will continue. Next it executes the GDFSpainSendNTF subflow which simply echos a message and returns and at this point an integrity constraint is thrown when it attempts to delete the GFDSPainSendNTF subprocess record. Interestingly the process engine does not seem to have deleted the GDFProvisionOrder workflow record even though that has also finished.
I have attached the Console output to this case which shows the flow of operation.
As stated before this works fine in 4.1. Unfortunately we cannot roll back to that as it does not expose the close() on the ProcessEngine which causes other deployment issues !.