Skip to content

Record a delete reason when an error event sub-process interrupts. Fixes #4257 - #4258

Open
chaserb wants to merge 2 commits into
flowable:mainfrom
chaserb:fix/4257-error-subprocess-delete-reason
Open

Record a delete reason when an error event sub-process interrupts. Fixes #4257#4258
chaserb wants to merge 2 commits into
flowable:mainfrom
chaserb:fix/4257-error-subprocess-delete-reason

Conversation

@chaserb

@chaserb chaserb commented Aug 12, 2026

Copy link
Copy Markdown

Fixes 4257

ErrorPropagation.executeEventHandler deletes the executions an interrupting error event sub-process terminates without passing a delete reason, so ACT_HI_ACTINST.DELETE_REASON_ is left null and a terminated activity is indistinguishable in history from one that completed normally — which contradicts HistoricActivityInstance#getDeleteReason(), whose javadoc states that no reason is set precisely when an activity completes normally. Every other interrupting event sub-process start type records DeleteReason.EVENT_SUBPROCESS_INTERRUPTING, and boundary events record BOUNDARY_EVENT_INTERRUPTING; the error start is the only one that does not. This passes that same reason at both call sites, and adds the DeleteReasonTest case that was missing for this start type.

Check List:

Chase Barrett added 2 commits August 12, 2026 17:25
The test was written to demonstrate the defect, so it read as a report of
what was wrong rather than a check of what is now right. It asserts the
same value either way; only the framing changes.

Both new test classes were also missing the Apache license header.

@filiphr filiphr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @chaserb. Fix looks OK to me. I only have 2 comments for the testing so that we can simplify it a bit.

Comment on lines +31 to +38
class NoopDelegate implements JavaDelegate {

@Override
public void execute(DelegateExecution execution) {
// no-op
}

}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be needed. See my comment int he BPMN XMLs

<!-- Branch B: a start execution listener raises a BpmnError. -->
<sequenceFlow id="toThrowing" sourceRef="fork" targetRef="throwingTask"/>
<serviceTask id="throwingTask" name="Throwing Task"
flowable:class="org.flowable.engine.test.api.deletereason.NoopDelegate">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
flowable:class="org.flowable.engine.test.api.deletereason.NoopDelegate">
flowable:expression="${true}">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Interrupting error event sub-process leaves a null delete reason on the activities it terminates

2 participants