Skip to content

fix(engine): use stored process definition key for MDC - #3109

Merged
kthoms merged 2 commits into
mainfrom
backport/fluxnova-300-process-data-context-definition-key
Jun 14, 2026
Merged

kthoms merged 2 commits into
mainfrom
backport/fluxnova-300-process-data-context-definition-key

Conversation

@hauptmedia

Copy link
Copy Markdown
Collaborator

Summary

This backports a small Fluxnova engine fix for ProcessDataContext: when the MDC logging context needs the process definition key, the engine now reads the already stored execution property via ExecutionEntity#getProcessDefinitionKey() instead of resolving the full process definition and then calling getKey() on it.

Problem

Before this change, ProcessDataContext#pushSection populated the configured processDefinitionKey MDC property through:

execution.getProcessDefinition().getKey()

That makes MDC population depend on resolving/loading the process definition even though the execution already carries the process definition key directly. For logging-context setup this is unnecessary work and can cause avoidable process-definition access on a path that should only copy execution metadata into MDC.

Fix

Use:

execution.getProcessDefinitionKey()

This keeps the logging-context behavior the same from the caller's perspective, but avoids resolving the full process definition for the key.

Test coverage

Added ProcessDataContextTest#pushSectionUsesStoredProcessDefinitionKeyForMdc.

The test is intentionally not self-referential: it configures only the processDefinitionKey MDC property, stubs execution.getProcessDefinitionKey() with a concrete value, asserts that the value is written to MDC, and verifies that execution.getProcessDefinition() is never called.

Backport attribution

Backported and adapted from Fluxnova:

Adaptation notes:

  • Namespace adapted from Fluxnova to Operaton.
  • Added an Operaton-owned JUnit 5 unit test with AssertJ/Mockito.

Verification

  • git diff --check
  • ./mvnw -pl engine -Dskip.frontend.build=true -Dtest=ProcessDataContextTest test

Use ExecutionEntity#getProcessDefinitionKey() when populating the process definition key logging context. This avoids resolving the full process definition just to read the key.

Backported and adapted from Fluxnova commit 705979e55288c506eb37e30408910d2ee9ee47ad in finos/fluxnova-bpm-platform.

Also seen in Fluxnova commit 9cc0f792c8901f91969c272f599721fa4219f68f.

Original author: Mannuru, ReddyKishore <[email protected]>
@github-actions github-actions Bot added lang:java Pull requests that update Java code scope:core-api Changes to the core API: engine, dmn-engine, feel-engine, REST API, OpenAPI scope:tests Changes affecting only test code labels Jun 9, 2026
@hauptmedia hauptmedia added the backport:fluxnova Changes backported from Fluxnova label Jun 9, 2026
@sonarqubecloud

Copy link
Copy Markdown

@kthoms kthoms 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.

LGTM

@kthoms kthoms added this to the 2.1.2 milestone Jun 14, 2026
@kthoms kthoms added the backport:patch-release Should be ported back to the latest feature release branch. label Jun 14, 2026
@kthoms
kthoms merged commit 3b52cf0 into main Jun 14, 2026
18 checks passed
@kthoms
kthoms deleted the backport/fluxnova-300-process-data-context-definition-key branch June 14, 2026 14:34
kthoms pushed a commit that referenced this pull request Jun 14, 2026
* fix(engine): use stored process definition key for MDC

Use ExecutionEntity#getProcessDefinitionKey() when populating the process definition key logging context. This avoids resolving the full process definition just to read the key.

Backported and adapted from Fluxnova commit 705979e55288c506eb37e30408910d2ee9ee47ad in finos/fluxnova-bpm-platform.

Also seen in Fluxnova commit 9cc0f792c8901f91969c272f599721fa4219f68f.

Original author: Mannuru, ReddyKishore <[email protected]>

* test: mock process engine configuration in ProcessDataContextTest

(cherry picked from commit 3b52cf0)
@kthoms

kthoms commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Cherry-picked for 2.1.2

@kthoms kthoms added the noteworthy Should be documented in the release notes label Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:fluxnova Changes backported from Fluxnova backport:patch-release Should be ported back to the latest feature release branch. lang:java Pull requests that update Java code noteworthy Should be documented in the release notes scope:core-api Changes to the core API: engine, dmn-engine, feel-engine, REST API, OpenAPI scope:tests Changes affecting only test code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants