flowable / flowable/flowable-engine
Problem while selecting the correct error event subprocess
- Vorherrschende Sprache
- Java
- Sterne
- 9.5k
- Forks
- 2.9k
- Ø Merge
- 7 Std. 8 Min.
- Gemergte PRs (30 T.)
- 2
Beschreibung
**Describe the bug**
I have a BPMN with a subprocess containing another subprocess.
In both subprocesses, i can throw BPMN Errors.
I added, in each subprocess, an error event subprocesses to handle the BPMNError occuring inside.
When the engine search for an appropriate error subprocess to handle a BPMNError, the selected one is not always the same.
I put a full explanation of the problem on the flowable forum :
https://forum.flowable.org/t/bpmnerror-error-handling-subprocess-possible-bug-at-least-strange-behaviour/10873
**Expected behavior**
If i have a BPMN containing ITEMSubprocess containing a **sub**ITEMSubproces expect that :
- A BPMNError happening in a task of ITEMSubprocess will be handled by the error event subprocess of ITEMSubprocess .
- A BPMNError happening in a task of *sub**ITEMSubproces will be handled by the error event subprocess of *sub**ITEMSubproces.
**Code**
https://github.com/flowable/flowable-engine/blob/6c5b934c0b0fa8b33a3612a11f503c06b81a369a/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/helper/ErrorPropagation.java#L155C1-L175C18
I think the issue is caused by the fact that :
`List events = eventMap.get(refId);
for (String refId : eventMap.keySet()) { //Not always in the same order ; probably due to hashing`
`currentContainer.getFlowElement(refActivityId) // considers that a refActivityId in subITEMsubprocess is "contained" within ITEMSubprocess.`
==> I get inconsisted results depending on the order of the eventMap keySet;
The selected error handling subprocess is the one of the last checked subprocess between ITEMsubprocess and subITEMsubprocess.
I think it should search for an error handling subprocess only withing current subprocess and it's parents; not in children subprocesses.
**Additional context**
flowable 7.0.0
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginne in modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/helper/ErrorPropagation.java ungefähr bei den Zeilen 155–175 und lies anschließend die verlinkte Forumerklärung für den Fall verschachtelter Subprozesse. Reproduziere die Fehlerbehandlung mit verschachtelten Subprozessen und unterschiedlicher eventMap-Reihenfolge; abgeschlossen ist die Aufgabe, wenn Fehler in jedem Subprozess von diesem Subprozess oder einem übergeordneten Parent behandelt werden, niemals von einem Child.
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
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100