flowable / flowable/flowable-engine
Deletion of running process fails
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 7h 8m
- Merged PRs (30d)
- 2
Description
Hi,
I have posted the same question in the Flowable forum without getting much traction on the thread (https://forum.flowable.org/t/how-to-delete-a-process/9805) so I try here once again:
Back then in Activiti and up to Flowable 6.2 the following code worked as (at least I) expected:
```
RuntimeService runtimeService = processEngine.getRuntimeService();
String pId = runtimeService.startProcessInstanceById (processDefinition.getId ()).getId ();
System.out.println ("Process " + pId + " started");
// give process some time to "do" something
Thread.sleep (3000);
System.out.println ("Deleting process " + pId);
runtimeService.deleteProcessInstance (pId, null);
System.out.println ("Process deleted");
```
> Process 5 started
> Deleting process 5
> Process deleted
The process starts, runs some time and then gets terminated.
The Flowable version currently in use (6.7.2), however, gives me an exception in line :
` runtimeService.deleteProcessInstance (pId, null);`
> Concurrent update in table “ACT_RU_EXECUTION”: another transaction has updated or deleted the same row [90131-212]
The process used to demonstrate this behavior is trivial: One asynchronous ServiceTask between Start and End events. The task is a Java class simply doing a sleep ().
While I seem to understand what happens, I’m somewhat puzzled.
Is this behavior change intended? If so, what is the recommended way to delete a running process instance?
Thanks, Steffen.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.