flowable / flowable/flowable-engine

Cannot cancel a transaction with boundary cancel event

Offen
#3,202 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
9.5k
Forks
2.9k
Ø Merge
7 Std. 8 Min.
Gemergte PRs (30 T.)
2

Beschreibung

**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)

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne mit dem angehängten Workflow TestTransactions.zip und untersuche CancelEndEventActivityBehavior und BoundaryCancelEventActivityBehavior, insbesondere den Lookup in BoundaryCancelEventActivityBehavior.java, Zeile 60. Reproduziere den Boundary-Cancel-Ablauf in Flowable 6.7.1 und vergleiche ihn mit dem dokumentierten Verhalten des Cancel-End-Events. Als erledigt gilt die Aufgabe, wenn der Cancel-Pfad „User task when canceled“ erreicht, ohne die Exception wegen des fehlenden Subprozesses auszulösen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
backend
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.