Skip to content

Conversation

@renczesstefan
Copy link
Member

@renczesstefan renczesstefan commented Jan 21, 2026

Description

Added flag whether to execute events on getData in DataService.

Fixes NAE-2359

Dependencies

No new dependencies were introduced.

Third party dependencies

  • No new dependencies were introduced.

Blocking Pull requests

There are no dependencies on other PR.

How Has Been This Tested?

This was tested manually and with unit tests.

Test Configuration

Name Tested on
OS macOS Tahoe 26.2
Runtime Java 21
Dependency Manager Maven 3.9.9n
Framework version Spring Boot 3.4.4
Run parameters
Other configuration

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes have been checked, personally or remotely, with @machacjozef
  • I have commented my code, particularly in hard-to-understand areas
  • I have resolved all conflicts with the target branch of the PR
  • I have updated and synced my code with the target branch
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes:
    • Lint test
    • Unit tests
    • Integration tests
  • I have checked my contribution with code analysis tools:
  • I have made corresponding changes to the documentation:
    • Developer documentation
    • User Guides
    • Migration Guides

Summary by CodeRabbit

  • New Features
    • Added optional event control to data retrieval operations, allowing selective event emission during data access.
    • Enhanced data-group retrieval with flexible event publishing configuration.

✏️ Tip: You can customize this high-level summary in your review settings.

…ps resolving

- added flag whether events are disabled when getting data
- added new interface methods to ensure backward compatibility
@renczesstefan renczesstefan self-assigned this Jan 21, 2026
@renczesstefan renczesstefan added bugfix A change that fixes a bug Medium labels Jan 21, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

Walkthrough

Added boolean eventsEnabled parameter to data retrieval APIs in DataService and IDataService interfaces to conditionally gate event publishing. Updated method overloads for getData() and getDataGroups() to accept and propagate the flag throughout nested data collection logic. Modified AbstractTaskController to use the new overload.

Changes

Cohort / File(s) Summary
Data Service Interface
application-engine/src/main/java/com/netgrif/application/engine/workflow/service/interfaces/IDataService.java
Added 6 new method overloads with boolean eventsEnabled parameter for getData() (4 variants) and getDataGroups() (2 variants) to enable explicit control over event emission per API call.
Data Service Implementation
application-engine/src/main/java/com/netgrif/application/engine/workflow/service/DataService.java
Implemented 6 new overloaded methods with eventsEnabled flag propagation. Updated internal call sites and event publishing logic to conditionally execute PRE/POST data events and publisher notifications based on the flag. Extended data-group and task-ref collection paths to thread the parameter through nested logic.
Controller
application-engine/src/main/java/com/netgrif/application/engine/workflow/web/AbstractTaskController.java
Updated call to getDataGroups() in setData() method to use new overload with boolean argument set to false.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: SetData endpoint behavior modification regarding getData event execution on dataGroups.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
application-engine/src/main/java/com/netgrif/application/engine/workflow/service/DataService.java (1)

165-218: Wrap final GetDataEvent publication with eventsEnabled check for consistency.

The final event published at line 218 (publisher.publishEvent(new GetDataEvent(outcome, user))) is not gated by the eventsEnabled flag, while the per-field PRE/POST events at lines 166-167 and 201-202 correctly respect this flag. This creates an inconsistency: when eventsEnabled=false, callers expect event publication to be suppressed, but this completion event still fires regardless.

Suggested fix
         LongStream.range(0L, dataSetFields.size())
                 .forEach(index -> dataSetFields.get((int) index).setOrder(index));
         outcome.setData(dataSetFields);
-        publisher.publishEvent(new GetDataEvent(outcome, user));
+        if (eventsEnabled) {
+            publisher.publishEvent(new GetDataEvent(outcome, user));
+        }
         return outcome;
🤖 Fix all issues with AI agents
In
`@application-engine/src/main/java/com/netgrif/application/engine/workflow/service/interfaces/IDataService.java`:
- Around line 30-43: Add Javadoc to the new IDataService.getData overloads
documenting the eventsEnabled parameter: update the interface methods (all
getData variants that include the boolean eventsEnabled) to include a
description of what eventsEnabled controls (e.g., when false suppress PRE/POST
data events and publisher notifications), default behavior when omitted, and any
side effects or expectations for callers; ensure the Javadoc appears on each
overloaded signature that accepts eventsEnabled and clearly states its purpose
and behavior.

@machacjozef machacjozef merged commit 6c67705 into release/7.0.0-rev9 Jan 21, 2026
7 checks passed
@machacjozef machacjozef deleted the NAE-2359 branch January 21, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix A change that fixes a bug Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants