This is a problem that started after moving an application from WebLogic 11g to WebLogic 12c and I have reproduced it using JDeveloper 12c and 2 BPEL processes.
I have created the BPEL process CreateTask which sends an initiateTask request to the TaskService to create a human task, then waits for the task to be completed. Flow number 4 in this screenshot, it is left in the Running state while it waits for the task to be completed:
I open that flow and can see that CreateTask has created the human task, both the BPEL process and the Workflow are in the Running state:
I click the human task and take the workflow number:
Now I can send an updateTaskOutcome request to the TaskService using that workflow number to complete the task (done here in SoapUI):
I go back to Enterprise Manager and see that flow 4 is now completed:
All good so far.
I've created a second BPEL process, CompleteTask, which sends the same request to the TaskService that I sent from SoapUI. After running CreateTask again then running CompleteTask using the new workflow number, we have flow 5 which is the CreateTask and flow 6 which is the CompleteTask:
Flow 5 has changed to completed as expected but flow 6 isn't waiting for anything so it should also be completed.
Looking at the detail for flow 6, the BPEL process has completed but there is a human task under it that is still running:
That human task should not be there as this process was only completing the task that was already created. If I open that task, it is completely blank:
Doing other calls to the TaskService from a BPEL process, even just requestInfoForTask, does the same thing.
This doesn't happen in WebLogic 11g. The empty human task was not created and both processes completed. Why does it happen in 12c and what can be done about it?
One way around the issue is to call the TaskService as an external service rather than as part of the human task component.
Add a new SOAP reference onto your composite:
The URL in TaskService.wsdl is for localhost:8888, follow your project's example for configuring it correctly when deployed. (e.g. changing the reference in the composite to use the project copy of the WSDL and replacing the value with a config plan)
For any BPEL processes that use operations other than initiateTask, link them to the external TaskService instead of the human task (or both if required). I've replaced the link completely as my process was only using updateTaskOutcome.
In the BPEL processes, change the partnerLink on the invoke steps to from HumanTask.TaskService to TaskService.
Now the process that completes the task will complete correctly: