flowable / flowable/flowable-engine

Cannot cancel a transaction with boundary cancel event

Aperta
#3,202 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
9.5k
Fork
2.9k
Merge medio
7h 8m
PR unite (30g)
2

Descrizione

**Description of the bug**
I am using a straightforward workflow containing a transaction with a boundary cancel event, like in the image bellow.
![Screenshot from 2022-02-04 10-13-14](https://user-images.githubusercontent.com/52911379/152520265-12e60426-55f9-4798-b284-ab221942422e.png)
The cancel is not working: the engine makes the following exception: org.flowable.common.engine.api.FlowableException: No execution found for sub process of boundary cancel event boundarycancel1.

**Expected behavior**
When the Cancel End Event is triggered, the workflow should continue with the task "User task when canceled" and no exception should be thrown by the engine.
It should work according to this piece of documentation : https://www.flowable.com/open-source/docs/bpmn/ch07b-BPMN-Constructs/#cancel-end-event .

**Code**
I had a look in the code. What basically happens is that the engine executes the org.flowable.engine.impl.bpmn.behavior.CancelEndEventActivityBehavior first, for the Cancel End Event. During this processing, the transaction sub-process is marked as deleted. Later on, when the engine executes org.flowable.engine.impl.bpmn.behavior.BoundaryCancelEventActivityBehavior, it calls executionEntityManager.findChildExecutionsByProcessInstanceId(execution.getProcessInstanceId()) to find the transaction. The issue is that this search only looks only for non deleted executions, so the transaction is not found because it is already marked as deleted by the CancelEndEventActivityBehavior. Then the exception is thrown at BoundaryCancelEventActivityBehavior.java, line 60.

**Additional context**
Using the Flowable engine version 6.7.1. We have just migrated from activiti 5.2 and we have lots of legacy workflows like this one. They were working fine with activiti but not working anymore with flowable.
Also adding the bpmn file:
[TestTransactions.zip](https://github.com/flowable/flowable-engine/files/8003262/TestTransactions.zip)

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia con il workflow allegato TestTransactions.zip e ispeziona CancelEndEventActivityBehavior e BoundaryCancelEventActivityBehavior, in particolare la ricerca alla riga 60 di BoundaryCancelEventActivityBehavior.java. Riproduci il flusso di annullamento boundary in Flowable 6.7.1 e confrontalo con il comportamento documentato dell’evento di fine cancel. Il lavoro è completato quando il percorso di annullamento raggiunge “User task when canceled” senza generare l’eccezione relativa al sottoprocesso mancante.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
backend
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.