Skip to content

Make historic variable cleanup dependent scope type aware - #4275

Merged
filiphr merged 1 commit into
flowable:mainfrom
filiphr:historic-dependent-scope-cleanup
Sep 16, 2026
Merged

filiphr merged 1 commit into
flowable:mainfrom
filiphr:historic-dependent-scope-cleanup

Conversation

@filiphr

@filiphr filiphr commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Runtime cleanup honours the dependent scope types registered on an engine configuration, historic cleanup did not: such rows have no process instance id, and the CMMN historic delete pinned the scope type to 'cmmn', so they leaked along with their byte arrays. All dependent scope variables use the instance id as scope id, so the cleanup keys off that, which covers the whole BPMN execution tree in one statement.

Adds a scope types aware find and (bulk) delete alongside the existing single scope type methods, used from DefaultHistoryManager, DefaultCmmnHistoryManager and CmmnHistoryHelper.

Also fixes findHistoricalVariableInstancesBySubScopeIdAndScopeType, which passed a sub scope id to the scope id statement and matcher.

Runtime cleanup honours the dependent scope types registered on an engine
configuration, historic cleanup did not: such rows have no process instance
id, and the CMMN historic delete pinned the scope type to 'cmmn', so they
leaked along with their byte arrays. All dependent scope variables use the
instance id as scope id, so the cleanup keys off that, which covers the
whole BPMN execution tree in one statement.

Adds a scope types aware find and (bulk) delete alongside the existing
single scope type methods, used from DefaultHistoryManager,
DefaultCmmnHistoryManager and CmmnHistoryHelper.

Also fixes findHistoricalVariableInstancesBySubScopeIdAndScopeType, which
passed a sub scope id to the scope id statement and matcher.
@filiphr
filiphr merged commit 923a2aa into flowable:main Sep 16, 2026
3 checks passed
@filiphr
filiphr deleted the historic-dependent-scope-cleanup branch September 16, 2026 12:08
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.

1 participant