Skip to content

Conversation

@Retoocs
Copy link
Contributor

@Retoocs Retoocs commented Nov 13, 2025

Description

  1. Optimize database reads and writes in core services, such as TaskService, WorkflowService.
  2. Optimize logging across the service layer in the application
  3. Slighty optimize some algorithms (f.e. in DataService, EventService, authorization resolving, ...)
  4. fix some warning and errors across the service layer

Implements NAE-2235

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?

By unit tests and manually

Test Configuration

Name Tested on
OS Ubuntu 24.04.1 LTS
Runtime Java 21
Dependency Manager Maven 3.6.3
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 @...
  • 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

  • Refactor
    • Unified task/case/import/delete operations to use parameter objects for more consistent behavior.
  • Bug Fixes
    • Improved resource handling and null-safety to reduce import/delete failures and unexpected errors.
  • Style
    • Standardized logging for clearer, safer diagnostics.
  • New Features
    • More precise operation outcomes and messaging for task and case workflows.

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

- update loggers for MinIoStorageService and mail package
- update loggers in PetriNetService
- fix cacheable self-invocation in PetriNetService
- remove code that is commented out in PetriNetService
- fix nullptr exception in PetriNetService.findByImportId
- resolve some warnings in PetriNetService
- optimize ProcessRoleService.delete
- add todos
- remove redundant method overload in ProcessRoleService
- implement create case performance test
- update method calls after parameters change
- add nets for WorkflowPerformanceTest
- update WorkflowService.deleteCase
- optimize WorkflowService.deleteSubtreeRootedAt
- optimize logging in TaskService
- change task service method parameters
- more optimization for TaskService.assignTask
- optimize TaskService.cancelTask and TaskService.cancelTasksWithoutReload
- update TaskService.fillMissingAttributes for delegateTask
- update WorkflowPerformanceTest
- light optimization of DataService.getData
- light optimization of DataService.setData
- light optimization of DataService.getDataGroups
- light optimizations in workflow package
- optimize authorization services
- begin implementation of MVC performance tests
- fix nullptr in TaskAuthorizationService
- update WorkflowMvcPerformanceTest
- introduce optimizations and fixes in ActionDelegate
- add javadoc
- fix variable initialization in ImportPetriNetParams
@Retoocs Retoocs self-assigned this Nov 13, 2025
@Retoocs Retoocs added the improvement A change that improves on an existing feature label Nov 13, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 13, 2025

Walkthrough

Consolidates many service overloads into builder-style parameter objects (ImportPetriNetParams, DeletePetriNetParams, CreateCaseParams, TaskParams, DelegateTaskParams, DeleteCaseParams), updates controllers/tests to use them, tightens logging to parameterized SLF4J, and applies assorted null-safety and minor API/visibility refinements across the engine.

Changes

Cohort / File(s) Summary
New parameter/outcome types
application-engine/src/main/java/com/netgrif/application/engine/petrinet/params/ImportPetriNetParams.java, .../DeletePetriNetParams.java
application-engine/src/main/java/com/netgrif/application/engine/workflow/params/CreateCaseParams.java, DeleteCaseParams.java, TaskParams.java, DelegateTaskParams.java
application-engine/src/main/java/com/netgrif/application/engine/workflow/domain/outcomes/ReloadTaskOutcome.java
Added Lombok-backed builder/value classes and a ReloadTaskOutcome used to consolidate call-sites and carry operation metadata.
PetriNet import/delete API
application-engine/src/main/java/.../petrinet/service/PetriNetService.java
application-engine/src/main/java/.../petrinet/service/interfaces/IPetriNetService.java
Replaced multiple importPetriNet overloads with importPetriNet(ImportPetriNetParams) and replaced deletePetriNet overloads with deletePetriNet(DeletePetriNetParams); added validation helpers and rule evaluation hooks.
Workflow create/delete API
application-engine/src/main/java/.../workflow/service/WorkflowService.java
application-engine/src/main/java/.../workflow/service/interfaces/IWorkflowService.java
Consolidated createCase/deleteCase to accept CreateCaseParams/DeleteCaseParams; added helpers for attribute validation and default title resolution; changed resolveUserRef signature to include save-flag.
Task APIs and flows
application-engine/src/main/java/.../workflow/service/TaskService.java
application-engine/src/main/java/.../workflow/service/interfaces/ITaskService.java
Collapsed assign/finish/cancel/delegate overloads to TaskParams/DelegateTaskParams-based methods; reloadTasks now returns ReloadTaskOutcome and accepts lazyCaseSave; added fill/validate helpers and adjusted lifecycle/save semantics.
Controllers / Web layer
application-engine/src/main/java/.../workflow/web/WorkflowController.java, PublicWorkflowController.java, AbstractTaskController.java
Updated controller endpoints to build and pass CreateCaseParams/DeleteCaseParams/TaskParams/DelegateTaskParams; adjusted charset handling and parameterized logging.
Action & import helpers
application-engine/src/main/groovy/.../migration/ActionMigration.groovy, .../startup/ImportHelper.groovy, ActionDelegate.groovy
Switched service calls to use new param builders; wrapped InputStream usage with try-with-resources; converted some helpers to static; outcomes unified to typed outcome objects.
Menu / Dashboard / Import-export
application-engine/src/main/java/.../menu/services/*, .../workflow/service/FilterImportExportService.java, MenuImportExportService.java
Replaced direct service overload calls with CreateCaseParams/TaskParams/DeleteCaseParams builders and adjusted internal flows accordingly.
Logging & minor cleans
many files under application-engine/src/main/java/... (auth, elastic, mail, minio, executors, startup runners, etc.)
Replaced string concatenation logs with parameterized SLF4J messages; small visibility/type cleanups and minor null-check/collection idiom updates.
Process XMLs
application-engine/src/main/resources/petriNets/engine-processes/*
Replaced workflowService.deleteCase(...) calls in actions with direct deleteCase(...) invocations.
Tests
application-engine/src/test/groovy/** (numerous test files)
Updated 60+ tests to construct and pass ImportPetriNetParams, CreateCaseParams, DeleteCaseParams, TaskParams, DelegateTaskParams to match new service signatures; adjusted stream/resource handling in some tests.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

  • Areas to focus during review:
    • PetriNetService / IPetriNetService import and delete consolidation — ensure parameter validation, resource closing, and version handling preserved.
    • TaskService and ITaskService signature changes — verify reload/save semantics, Transition exceptions, and migration of many call-sites.
    • CreateCaseParams/TaskParams/DelegateTaskParams builders — inspect custom builder methods (process cloning, id synchronization) for correctness.
    • Authorization and TaskAuthorizationService logic changes (removal of UserService, admin shortcuts) — confirm no permission regressions.
    • Test updates — spot-check a representative subset of updated tests for correct construction of param objects and resource cleanup.

Possibly related PRs

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.16% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'NAE-2235 Improve Efficiency of Database Reads and Saves' is concise and clearly describes the main change—optimizing database operations and logging across core services.

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.

@Retoocs Retoocs marked this pull request as ready for review November 13, 2025 15:30
@coderabbitai coderabbitai bot added the Large label Nov 13, 2025
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: 21

Caution

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

⚠️ Outside diff range comments (5)
application-engine/src/main/groovy/com/netgrif/application/engine/validation/service/ValidationService.groovy (2)

39-64: Consider removing or documenting the commented code.

This large block of commented-out code for additional field types reduces readability. If these are planned features, track them in issues and remove the comments. If they're not needed, delete them entirely.


28-28: Add null check to prevent potential NPE.

There's no null check on validation.getValidationRule() before calling trim().split(). If getValidationRule() returns null, this will throw a NullPointerException.

Apply this diff to add a null check:

-            List<String> rules = validation.getValidationRule().trim().split(" ")
+            List<String> rules = validation.getValidationRule()?.trim()?.split(" ")
+            if (rules == null || rules.size() < 1) {
+                return
+            }
-            if (rules.size() >= 1) {
                AbstractFieldValidation instance = new AbstractFieldValidation()
                // ... rest of the code
-            }
application-engine/src/main/java/com/netgrif/application/engine/mail/MailService.java (1)

102-109: Address the TODO: Remove commented-out code.

The commented-out testConnection method and its TODO should be cleaned up to improve code maintainability.

Do you want me to open an issue to track the removal of this dead code, or should it be removed in this PR?

application-engine/src/main/java/com/netgrif/application/engine/startup/runner/DefaultFiltersRunner.java (1)

432-498: Reuse the retrieved logged user

You already fetched the acting user just above. Reusing that instance (and the converted LoggedUser) here removes two extra service lookups and keeps the executor identity consistent across create/assign/finish. Suggested change:

-        AbstractUser loggedUser = this.userService.getLoggedOrSystem();
+        AbstractUser loggedUser = this.userService.getLoggedOrSystem();
+        LoggedUser actingUser = ActorTransformer.toLoggedUser(loggedUser);
...
-            Case filterCase = this.workflowService.createCase(CreateCaseParams.with()
+            Case filterCase = this.workflowService.createCase(CreateCaseParams.with()
                     .process(filterNet)
                     .title(title)
                     .color(null)
-                    .author(ActorTransformer.toLoggedUser(loggedUser))
+                    .author(actingUser)
                     .build()).getCase();
...
-            this.taskService.assignTask(TaskParams.with()
-                    .task(newFilterTask)
-                    .user(this.userService.getLoggedOrSystem())
-                    .build());
+            this.taskService.assignTask(TaskParams.with()
+                    .task(newFilterTask)
+                    .user(actingUser)
+                    .build());
...
-            this.taskService.finishTask(TaskParams.with()
-                    .task(newFilterTask)
-                    .user(this.userService.getLoggedOrSystem())
-                    .build());
+            this.taskService.finishTask(TaskParams.with()
+                    .task(newFilterTask)
+                    .user(actingUser)
+                    .build());
application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskAuthorizationService.java (1)

54-117: Restore impersonation-aware permission checks

By replacing every getSelfOrImpersonated() usage with bare getStringId()/isAdmin() we regress impersonation flows in two ways:

  1. When an admin impersonates another account, all permission maps remain keyed by the impersonated identity. Looking up task.getUsers().get(user.getStringId()) (and comparing task.getUserId() to user.getStringId()) now misses that entry, so impersonated users lose their explicit permissions and can no longer finish/assign/cancel their own tasks.
  2. The early admin shortcuts now consult loggedUser.isAdmin(), which still reflects the real operator. An admin impersonating a non-admin suddenly bypasses all permission checks, meaning the impersonation sandbox is no longer enforced.

Both are functional/security regressions in production impersonation scenarios. Please reinstate the impersonation-aware identity before proceeding—e.g.:

-        if (!task.getUsers().containsKey(user.getStringId())) {
+        String effectiveUserId = user.getSelfOrImpersonated().getStringId();
+        if (!task.getUsers().containsKey(effectiveUserId)) {
             return null;
         }
-        Map<String, Boolean> userPermissions = task.getUsers().get(user.getStringId());
+        Map<String, Boolean> userPermissions = task.getUsers().get(effectiveUserId);

and similarly

-        if (loggedUser.isAdmin()) {
+        if (loggedUser.getSelfOrImpersonated().isAdmin()) {
             return true;
         }

and

-        return task.getUserId().equals(user.getStringId())
+        String effectiveUserId = user.getSelfOrImpersonated().getStringId();
+        return task.getUserId().equals(effectiveUserId)

across the affected methods.

Also applies to: 168-209

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2f11efc and c97efa0.

📒 Files selected for processing (107)
  • application-engine/src/main/groovy/com/netgrif/application/engine/migration/ActionMigration.groovy (3 hunks)
  • application-engine/src/main/groovy/com/netgrif/application/engine/petrinet/domain/dataset/logic/action/ActionDelegate.groovy (15 hunks)
  • application-engine/src/main/groovy/com/netgrif/application/engine/startup/ImportHelper.groovy (5 hunks)
  • application-engine/src/main/groovy/com/netgrif/application/engine/validation/service/ValidationService.groovy (2 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/auth/service/LoginAttemptService.java (3 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/auth/service/RegistrationService.java (5 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/auth/web/UserControllerAdvice.java (1 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/configuration/security/ImpersonationRequestFilter.java (2 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticCaseMappingService.java (6 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticCaseService.java (2 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticIndexService.java (1 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticPetriNetService.java (2 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticTaskQueueManager.java (1 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ReindexingTask.java (2 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/executors/Executor.java (3 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/files/minio/MinIoStorageService.java (1 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/mail/MailAttemptService.java (2 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/mail/MailService.java (3 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/menu/services/DashboardItemServiceImpl.java (3 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/menu/services/DashboardManagementServiceImpl.java (3 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/menu/services/MenuItemService.java (4 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/petrinet/domain/repositories/PetriNetRepository.java (1 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/petrinet/params/DeletePetriNetParams.java (1 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/petrinet/params/ImportPetriNetParams.java (1 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/petrinet/service/PetriNetService.java (13 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/petrinet/service/ProcessRoleService.java (9 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/petrinet/service/interfaces/IPetriNetService.java (4 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/petrinet/web/PetriNetController.java (4 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/startup/ApplicationRunnerOrderResolver.java (2 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/startup/runner/AnonymousRoleRunner.java (1 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/startup/runner/DefaultDashboardRunner.java (1 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/startup/runner/DefaultFiltersRunner.java (3 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/startup/runner/DefaultRoleRunner.java (1 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/domain/outcomes/ReloadTaskOutcome.java (1 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/params/CreateCaseParams.java (1 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/params/DelegateTaskParams.java (1 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/params/DeleteCaseParams.java (1 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/params/TaskParams.java (1 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/AbstractAuthorizationService.java (2 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/CaseSearchService.java (3 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/ConfigurableMenuService.java (0 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/DataService.java (21 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/EventService.java (7 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/FilterImportExportService.java (3 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/MenuImportExportService.java (3 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/MongoSearchService.java (1 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskAuthorizationService.java (5 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskSearchService.java (2 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskService.java (20 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/WorkflowAuthorizationService.java (3 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/WorkflowService.java (11 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/interfaces/IEventService.java (1 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/interfaces/ITaskService.java (3 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/interfaces/IWorkflowService.java (2 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/web/AbstractTaskController.java (4 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/web/PublicWorkflowController.java (2 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/web/RestResponseExceptionHandler.java (1 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/web/WorkflowController.java (4 hunks)
  • application-engine/src/main/resources/petriNets/engine-processes/import_filters.xml (2 hunks)
  • application-engine/src/main/resources/petriNets/engine-processes/menu/menu_item.xml (3 hunks)
  • application-engine/src/main/resources/petriNets/engine-processes/menu/tabbed_case_view_configuration.xml (2 hunks)
  • application-engine/src/main/resources/petriNets/engine-processes/menu/tabbed_ticket_view_configuration.xml (2 hunks)
  • application-engine/src/main/resources/petriNets/engine-processes/preference_filter_item.xml (1 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/action/AssignActionTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/action/MenuItemApiTest.groovy (3 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/auth/SecurityContextTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/auth/TaskAuthorizationServiceTest.groovy (9 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/auth/WorkflowAuthorizationServiceTest.groovy (6 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/elastic/DataSearchRequestTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/elastic/ElasticTaskTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/elastic/ReindexTest.groovy (3 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/export/service/ExportServiceTest.groovy (4 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/filters/FilterImportExportTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/importer/PredefinedRolesPermissionsTest.groovy (3 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/importer/UserListTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/insurance/EncryptionTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/ipc/AssignCancelFinishWithCaseTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/ipc/CaseApiTest.groovy (3 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/ipc/TaskApiTest.groovy (7 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/pdf/service/PdfGeneratorTest.groovy (15 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/permissions/ElasticSearchViewPermissionTest.groovy (8 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/permissions/QueryDSLViewPermissionTest.groovy (10 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/ArcOrderTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/FunctionsTest.groovy (8 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/ImporterTest.groovy (7 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/PetriNetTest.groovy (5 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/CaseFieldTest.groovy (4 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/ChangeBehaviorTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/ChangeCasePropertyTest.groovy (4 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/ChangeFieldValueInitTest.groovy (3 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/ChoiceFieldTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/DynamicCaseNameTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/DynamicChoicesTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/DynamicDefaultValueTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/DynamicEnumerationTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/DynamicValidationPerformanceTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/FileFieldTest.groovy (3 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/FileListFieldTest.groovy (3 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/MapFieldTest.groovy (5 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/service/CachePetriNetServiceTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/web/PetriNetControllerTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/DataServiceTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/NewInitTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/SetDataOnButtonTest.groovy (3 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/TaskRefInitTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/TaskRefPropagationTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/UserRefsTest.groovy (2 hunks)
⛔ Files not processed due to max files limit (19)
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/WorkflowServiceTest.groovy
  • application-engine/src/test/java/com/netgrif/application/engine/importer/ConstructorAndDestructorTest.java
  • application-engine/src/test/java/com/netgrif/application/engine/importer/ImporterTest.java
  • application-engine/src/test/java/com/netgrif/application/engine/petrinet/service/ProcessRoleServiceTest.java
  • application-engine/src/test/java/com/netgrif/application/engine/workflow/WorkflowMvcPerformanceTest.java
  • application-engine/src/test/java/com/netgrif/application/engine/workflow/WorkflowPerformanceTest.java
  • application-engine/src/test/java/com/netgrif/application/engine/workflow/service/TaskServiceTest.java
  • application-engine/src/test/java/com/netgrif/application/engine/workflow/web/VariableArcsTest.java
  • application-engine/src/test/resources/change_caseref_value_action_test.xml
  • application-engine/src/test/resources/petriNets/test_create_case_performance.xml
  • application-engine/src/test/resources/petriNets/test_create_case_performance_with_action.xml
  • application-engine/src/test/resources/petriNets/test_task_event.xml
  • application-engine/src/test/resources/petriNets/test_task_event_with_action.xml
  • nae-object-library/src/main/java/com/netgrif/application/engine/objects/workflow/domain/Case.java
  • nae-object-library/src/main/java/com/netgrif/application/engine/objects/workflow/domain/ProcessResourceId.java
  • nae-object-library/src/main/java/com/netgrif/application/engine/objects/workflow/domain/Task.java
  • nae-object-library/src/main/java/com/netgrif/application/engine/objects/workflow/domain/eventoutcomes/caseoutcomes/ChangeCasePropertyOutcome.java
  • nae-spring-core-adapter/src/main/java/com/netgrif/application/engine/adapter/spring/petrinet/service/ProcessRoleService.java
  • nae-user-ce/src/main/java/com/netgrif/application/engine/auth/service/UserServiceImpl.java
💤 Files with no reviewable changes (1)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/ConfigurableMenuService.java
🧰 Additional context used
🧠 Learnings (16)
📚 Learning: 2025-10-20T11:44:44.907Z
Learnt from: machacjozef
Repo: netgrif/application-engine PR: 367
File: application-engine/src/main/resources/application.yaml:24-24
Timestamp: 2025-10-20T11:44:44.907Z
Learning: In the netgrif/application-engine project, the correction of the Elasticsearch task index name from "_taks" to "_task" in application.yaml was approved by maintainer machacjozef, indicating that any data migration concerns for this typo fix are handled separately or not applicable to their deployment scenario.

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticTaskQueueManager.java
  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticIndexService.java
  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ReindexingTask.java
  • application-engine/src/test/groovy/com/netgrif/application/engine/elastic/ElasticTaskTest.groovy
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/web/AbstractTaskController.java
  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticCaseMappingService.java
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskService.java
📚 Learning: 2025-08-20T07:27:02.660Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 339
File: application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticTaskQueueManager.java:38-45
Timestamp: 2025-08-20T07:27:02.660Z
Learning: When reviewing ElasticTaskQueueManager changes, task.getTask().getId() returns the document identifier while task.getTaskId() returns the business task identifier. The queue operations should use consistent identifiers throughout the lifecycle (scheduling, processing, cleanup).

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticTaskQueueManager.java
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/interfaces/ITaskService.java
  • application-engine/src/test/groovy/com/netgrif/application/engine/action/MenuItemApiTest.groovy
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/web/AbstractTaskController.java
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskService.java
📚 Learning: 2025-11-07T13:11:20.622Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 378
File: application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticQueueManager.java:145-149
Timestamp: 2025-11-07T13:11:20.622Z
Learning: In the netgrif/application-engine project, failed Elasticsearch bulk operations in ElasticQueueManager should not be retried or re-queued within the flush() method. The system relies on scheduled reindexing and manual reindex endpoints as fallback mechanisms for failed operations, making in-method retries unnecessary and potentially problematic (could cause deadlocks, capacity issues, or infinite loops with bad data).

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticTaskQueueManager.java
  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ReindexingTask.java
📚 Learning: 2025-07-31T23:40:46.499Z
Learnt from: tuplle
Repo: netgrif/application-engine PR: 334
File: application-engine/src/main/java/com/netgrif/application/engine/petrinet/service/PetriNetService.java:204-214
Timestamp: 2025-07-31T23:40:46.499Z
Learning: In the PetriNetService.importPetriNet method, existingNet.getVersion() cannot be null because all existing nets in the system were deployed through processes that ensure every net always has a version assigned.

Applied to files:

  • application-engine/src/test/groovy/com/netgrif/application/engine/ipc/TaskApiTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/auth/WorkflowAuthorizationServiceTest.groovy
  • application-engine/src/main/java/com/netgrif/application/engine/petrinet/params/ImportPetriNetParams.java
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/ChoiceFieldTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/ipc/CaseApiTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/MapFieldTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/SetDataOnButtonTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/CaseFieldTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/elastic/DataSearchRequestTest.groovy
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/MenuImportExportService.java
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/DynamicEnumerationTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/importer/UserListTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/insurance/EncryptionTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/ArcOrderTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/FunctionsTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/elastic/ElasticTaskTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/DynamicDefaultValueTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/PetriNetTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/service/CachePetriNetServiceTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/UserRefsTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/ImporterTest.groovy
  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticPetriNetService.java
  • application-engine/src/main/groovy/com/netgrif/application/engine/startup/ImportHelper.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/auth/TaskAuthorizationServiceTest.groovy
  • application-engine/src/main/java/com/netgrif/application/engine/petrinet/web/PetriNetController.java
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/DynamicValidationPerformanceTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/ChangeFieldValueInitTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/action/AssignActionTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/FileListFieldTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/permissions/ElasticSearchViewPermissionTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/elastic/ReindexTest.groovy
  • application-engine/src/main/groovy/com/netgrif/application/engine/migration/ActionMigration.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/DataServiceTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/importer/PredefinedRolesPermissionsTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/FileFieldTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/web/PetriNetControllerTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/pdf/service/PdfGeneratorTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/TaskRefInitTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/ChangeCasePropertyTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/NewInitTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/auth/SecurityContextTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/ipc/AssignCancelFinishWithCaseTest.groovy
  • application-engine/src/main/java/com/netgrif/application/engine/petrinet/service/PetriNetService.java
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/DynamicChoicesTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/DynamicCaseNameTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/ChangeBehaviorTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/TaskRefPropagationTest.groovy
  • application-engine/src/main/java/com/netgrif/application/engine/petrinet/service/interfaces/IPetriNetService.java
📚 Learning: 2025-07-29T17:19:18.300Z
Learnt from: tuplle
Repo: netgrif/application-engine PR: 331
File: application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticPetriNetService.java:45-46
Timestamp: 2025-07-29T17:19:18.300Z
Learning: In ElasticPetriNetService class, petriNetService is properly initialized using Lazy setter injection rather than constructor injection. This pattern with Lazy Autowired setter methods is commonly used in Spring to resolve circular dependencies and is a valid alternative to constructor injection.

Applied to files:

  • application-engine/src/test/groovy/com/netgrif/application/engine/ipc/TaskApiTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/auth/WorkflowAuthorizationServiceTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/SetDataOnButtonTest.groovy
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/MenuImportExportService.java
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/DataService.java
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/WorkflowAuthorizationService.java
  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticPetriNetService.java
  • application-engine/src/test/groovy/com/netgrif/application/engine/auth/TaskAuthorizationServiceTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/FileListFieldTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/permissions/ElasticSearchViewPermissionTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/FileFieldTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/TaskRefInitTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/ChangeCasePropertyTest.groovy
  • application-engine/src/main/java/com/netgrif/application/engine/petrinet/service/PetriNetService.java
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/ChangeBehaviorTest.groovy
📚 Learning: 2025-09-05T10:21:54.893Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 350
File: application-engine/src/test/groovy/com/netgrif/application/engine/export/service/ExportServiceTest.groovy:135-135
Timestamp: 2025-09-05T10:21:54.893Z
Learning: In ExportServiceTest.groovy, writing to src/test/resources is intentional to simulate production behavior where the working tree is mutated during file exports. This mirrors how the system works in production.

Applied to files:

  • application-engine/src/test/groovy/com/netgrif/application/engine/auth/WorkflowAuthorizationServiceTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/MapFieldTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/SetDataOnButtonTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/export/service/ExportServiceTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/FunctionsTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/elastic/ElasticTaskTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/PetriNetTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/auth/TaskAuthorizationServiceTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/elastic/ReindexTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/DataServiceTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/FileFieldTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/pdf/service/PdfGeneratorTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/NewInitTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/auth/SecurityContextTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/TaskRefPropagationTest.groovy
📚 Learning: 2025-09-05T10:17:28.577Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 350
File: application-engine/src/test/groovy/com/netgrif/application/engine/export/service/ExportServiceTest.groovy:82-82
Timestamp: 2025-09-05T10:17:28.577Z
Learning: In the application-engine test suite, testHelper.truncateDbs() follows a two-phase approach: first it clears the databases, then it executes superCreator to create the admin user. This means Optional.get() is safe when retrieving the admin user after truncateDbs() because the admin user is guaranteed to exist.

Applied to files:

  • application-engine/src/test/groovy/com/netgrif/application/engine/auth/WorkflowAuthorizationServiceTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/elastic/DataSearchRequestTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/UserRefsTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/auth/TaskAuthorizationServiceTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/permissions/ElasticSearchViewPermissionTest.groovy
📚 Learning: 2025-06-23T13:30:13.096Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 318
File: nae-object-library/src/main/java/com/netgrif/application/engine/objects/workflow/domain/menu/MenuItemConstants.java:60-62
Timestamp: 2025-06-23T13:30:13.096Z
Learning: In MenuItemConstants enum in nae-object-library/src/main/java/com/netgrif/application/engine/objects/workflow/domain/menu/MenuItemConstants.java, the field `attributeId` will be renamed to `value` to make it more generic and appropriate for both dataset attribute identifiers and technical constants like PATH_SEPARATOR.

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/menu/services/DashboardItemServiceImpl.java
  • application-engine/src/main/resources/petriNets/engine-processes/menu/menu_item.xml
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/MenuImportExportService.java
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/DataService.java
  • application-engine/src/main/java/com/netgrif/application/engine/menu/services/MenuItemService.java
  • application-engine/src/test/groovy/com/netgrif/application/engine/action/MenuItemApiTest.groovy
📚 Learning: 2025-10-20T11:46:37.958Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 373
File: application-engine/src/main/java/com/netgrif/application/engine/actions/ActionApiImpl.java:105-107
Timestamp: 2025-10-20T11:46:37.958Z
Learning: In ActionApiImpl, the processIdentifier parameter in searchCases() is intentionally unused because it's required by the ActionApi interface for plugin implementations. This implementation returns cases from all processes without filtering by processIdentifier.

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/menu/services/DashboardItemServiceImpl.java
  • application-engine/src/main/java/com/netgrif/application/engine/menu/services/DashboardManagementServiceImpl.java
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/CaseSearchService.java
📚 Learning: 2025-09-29T10:31:31.469Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 362
File: application-engine/src/main/java/com/netgrif/application/engine/petrinet/web/ProcessRoleController.java:43-45
Timestamp: 2025-09-29T10:31:31.469Z
Learning: In the Netgrif application engine, when Authentication objects reach controller endpoints, auth.getPrincipal() always returns a LoggedUser instance and is never null, so defensive casting checks are not necessary in controller methods.

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/auth/web/UserControllerAdvice.java
  • application-engine/src/main/java/com/netgrif/application/engine/configuration/security/ImpersonationRequestFilter.java
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/WorkflowAuthorizationService.java
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/interfaces/ITaskService.java
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskAuthorizationService.java
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskService.java
📚 Learning: 2025-08-19T20:07:15.621Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 339
File: application-engine/src/test/groovy/com/netgrif/application/engine/filters/FilterImportExportTest.groovy:341-341
Timestamp: 2025-08-19T20:07:15.621Z
Learning: In the Elasticsearch migration, the stringId property was removed from ElasticCase and ElasticTask, with the id property now containing the MongoDB case/task object ID directly. This consolidation eliminates redundancy and simplifies the data model.

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/startup/runner/DefaultFiltersRunner.java
  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ReindexingTask.java
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/DataService.java
  • application-engine/src/test/groovy/com/netgrif/application/engine/elastic/ElasticTaskTest.groovy
  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticCaseService.java
  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticCaseMappingService.java
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/ChangeCasePropertyTest.groovy
📚 Learning: 2025-07-31T08:05:21.587Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 329
File: nae-user-ce/src/main/java/com/netgrif/application/engine/auth/service/RealmServiceImpl.java:39-39
Timestamp: 2025-07-31T08:05:21.587Z
Learning: In the Netgrif Application Engine, the domain Realm class (com.netgrif.application.engine.objects.auth.domain.Realm) is abstract and cannot be instantiated. The concrete implementation is in the adapter package (com.netgrif.application.engine.adapter.spring.auth.domain.Realm) which extends the abstract domain class. Services must instantiate the concrete adapter class and cast it when saving to repositories that accept the abstract domain type.

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/WorkflowAuthorizationService.java
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskAuthorizationService.java
  • application-engine/src/test/groovy/com/netgrif/application/engine/action/AssignActionTest.groovy
📚 Learning: 2025-09-29T10:31:57.325Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 362
File: application-engine/src/main/java/com/netgrif/application/engine/petrinet/service/ProcessRoleService.java:513-529
Timestamp: 2025-09-29T10:31:57.325Z
Learning: PetriNet.getStringId() returns a simple ObjectId string representation (_id.toString()), not a composite Netgrif ID format, so new ObjectId(petriNetId) works correctly when petriNetId comes from PetriNet.getStringId().

Applied to files:

  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/FileListFieldTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/FileFieldTest.groovy
  • application-engine/src/main/java/com/netgrif/application/engine/petrinet/service/PetriNetService.java
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskService.java
📚 Learning: 2025-09-04T11:09:31.264Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 350
File: application-engine/src/main/java/com/netgrif/application/engine/startup/runner/SuperCreatorRunner.java:56-63
Timestamp: 2025-09-04T11:09:31.264Z
Learning: In SuperCreatorRunner.java, when creating a user with PasswordCredential via setCredential("password", passwordCredential), there's no need to also call setPassword() as it would be redundant - the PasswordCredential already contains the password information needed by UserServiceImpl.createUser().

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/auth/service/RegistrationService.java
📚 Learning: 2025-08-19T20:13:40.087Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 339
File: nae-object-library/src/main/java/com/netgrif/application/engine/objects/elastic/domain/CaseField.java:16-16
Timestamp: 2025-08-19T20:13:40.087Z
Learning: In CaseField.java, fulltextValue is mapped as a keyword field type in Elasticsearch (for exact matches, filtering, aggregations), while the separate caseValue field serves different Elasticsearch query requirements, allowing the system to support multiple query patterns on the same data through different field mappings.

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticCaseMappingService.java
📚 Learning: 2025-08-19T20:07:43.748Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 339
File: nae-object-library/src/main/java/com/netgrif/application/engine/objects/elastic/domain/CaseField.java:16-16
Timestamp: 2025-08-19T20:07:43.748Z
Learning: In CaseField.java, the separate caseValue field (List<String>) is intentionally maintained alongside fulltextValue for specific Elasticsearch query requirements, rather than being derived on-the-fly from fulltextValue.

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticCaseMappingService.java
🧬 Code graph analysis (13)
application-engine/src/main/java/com/netgrif/application/engine/workflow/service/FilterImportExportService.java (1)
nae-object-library/src/main/java/com/netgrif/application/engine/objects/auth/domain/ActorTransformer.java (1)
  • ActorTransformer (10-131)
application-engine/src/main/java/com/netgrif/application/engine/petrinet/params/ImportPetriNetParams.java (3)
application-engine/src/main/java/com/netgrif/application/engine/petrinet/params/DeletePetriNetParams.java (1)
  • Data (12-25)
application-engine/src/main/java/com/netgrif/application/engine/workflow/params/DeleteCaseParams.java (1)
  • Data (15-55)
application-engine/src/main/java/com/netgrif/application/engine/workflow/params/TaskParams.java (1)
  • Data (17-70)
application-engine/src/main/java/com/netgrif/application/engine/workflow/params/CreateCaseParams.java (4)
application-engine/src/main/java/com/netgrif/application/engine/petrinet/params/DeletePetriNetParams.java (1)
  • Data (12-25)
application-engine/src/main/java/com/netgrif/application/engine/petrinet/params/ImportPetriNetParams.java (1)
  • Data (17-51)
application-engine/src/main/java/com/netgrif/application/engine/workflow/params/DelegateTaskParams.java (1)
  • Data (17-45)
application-engine/src/main/java/com/netgrif/application/engine/workflow/params/DeleteCaseParams.java (1)
  • Data (15-55)
application-engine/src/main/java/com/netgrif/application/engine/workflow/params/DeleteCaseParams.java (3)
application-engine/src/main/java/com/netgrif/application/engine/petrinet/params/DeletePetriNetParams.java (1)
  • Data (12-25)
application-engine/src/main/java/com/netgrif/application/engine/workflow/params/DelegateTaskParams.java (1)
  • Data (17-45)
application-engine/src/main/java/com/netgrif/application/engine/workflow/params/TaskParams.java (1)
  • Data (17-70)
application-engine/src/main/java/com/netgrif/application/engine/workflow/service/MenuImportExportService.java (1)
nae-object-library/src/main/java/com/netgrif/application/engine/objects/auth/domain/ActorTransformer.java (1)
  • ActorTransformer (10-131)
application-engine/src/main/java/com/netgrif/application/engine/petrinet/params/DeletePetriNetParams.java (1)
application-engine/src/main/java/com/netgrif/application/engine/workflow/params/DeleteCaseParams.java (1)
  • Data (15-55)
application-engine/src/main/java/com/netgrif/application/engine/startup/runner/DefaultFiltersRunner.java (1)
nae-object-library/src/main/java/com/netgrif/application/engine/objects/auth/domain/ActorTransformer.java (1)
  • ActorTransformer (10-131)
application-engine/src/main/java/com/netgrif/application/engine/workflow/params/TaskParams.java (3)
application-engine/src/main/java/com/netgrif/application/engine/workflow/params/CreateCaseParams.java (1)
  • Data (19-70)
application-engine/src/main/java/com/netgrif/application/engine/workflow/params/DelegateTaskParams.java (1)
  • Data (17-45)
application-engine/src/main/java/com/netgrif/application/engine/workflow/params/DeleteCaseParams.java (1)
  • Data (15-55)
application-engine/src/main/java/com/netgrif/application/engine/petrinet/web/PetriNetController.java (1)
application-engine/src/main/java/com/netgrif/application/engine/workflow/web/responsebodies/MessageResource.java (1)
  • MessageResource (10-31)
application-engine/src/main/java/com/netgrif/application/engine/workflow/params/DelegateTaskParams.java (2)
application-engine/src/main/java/com/netgrif/application/engine/workflow/params/DeleteCaseParams.java (1)
  • Data (15-55)
application-engine/src/main/java/com/netgrif/application/engine/workflow/params/TaskParams.java (1)
  • Data (17-70)
application-engine/src/main/java/com/netgrif/application/engine/workflow/service/WorkflowService.java (1)
nae-object-library/src/main/java/com/netgrif/application/engine/objects/auth/domain/ActorTransformer.java (1)
  • ActorTransformer (10-131)
application-engine/src/main/java/com/netgrif/application/engine/workflow/web/WorkflowController.java (1)
application-engine/src/main/java/com/netgrif/application/engine/workflow/web/responsebodies/MessageResource.java (1)
  • MessageResource (10-31)
application-engine/src/main/java/com/netgrif/application/engine/petrinet/service/PetriNetService.java (1)
nae-object-library/src/main/java/com/netgrif/application/engine/objects/auth/domain/ActorTransformer.java (1)
  • ActorTransformer (10-131)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Test
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed

- fix possible leak with try-with-resources
- fix incorrect counter in a log message
- add stack trace in an error message
- remove token from log messages to reduce security risk
- override builder methods in DelegateTaskParams
- improve consistency in WorkflowController
- fix possible input stream leak in test files
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: 3

♻️ Duplicate comments (1)
application-engine/src/main/java/com/netgrif/application/engine/auth/service/RegistrationService.java (1)

101-101: Token exposure in logs remains a concern.

The full token value is still logged, which poses a security risk if logs are accessed by unauthorized parties. While this is now at DEBUG level (typically disabled in production), consider logging only a partial hash or omitting the token entirely.

Note: This concern was previously raised and only the logging syntax was modernized in this change.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c97efa0 and a86d7d9.

📒 Files selected for processing (10)
  • application-engine/src/main/groovy/com/netgrif/application/engine/migration/ActionMigration.groovy (2 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/auth/service/RegistrationService.java (6 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticTaskQueueManager.java (1 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/mail/MailService.java (3 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/params/DelegateTaskParams.java (1 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskService.java (20 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/web/WorkflowController.java (4 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/elastic/DataSearchRequestTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/DynamicChoicesTest.groovy (2 hunks)
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/SetDataOnButtonTest.groovy (3 hunks)
🧰 Additional context used
🧠 Learnings (12)
📓 Common learnings
Learnt from: Retoocs
Repo: netgrif/application-engine PR: 383
File: application-engine/src/main/java/com/netgrif/application/engine/startup/ApplicationRunnerOrderResolver.java:43-43
Timestamp: 2025-11-14T10:22:01.624Z
Learning: For the netgrif/application-engine repository, avoid flagging trivial or nitpick-level issues such as redundant null checks, minor code style improvements, or obvious simplifications that don't affect functionality or introduce bugs. Focus review comments on substantive issues like logic errors, security concerns, performance problems, or breaking changes.
📚 Learning: 2025-07-31T23:40:46.499Z
Learnt from: tuplle
Repo: netgrif/application-engine PR: 334
File: application-engine/src/main/java/com/netgrif/application/engine/petrinet/service/PetriNetService.java:204-214
Timestamp: 2025-07-31T23:40:46.499Z
Learning: In the PetriNetService.importPetriNet method, existingNet.getVersion() cannot be null because all existing nets in the system were deployed through processes that ensure every net always has a version assigned.

Applied to files:

  • application-engine/src/main/groovy/com/netgrif/application/engine/migration/ActionMigration.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/SetDataOnButtonTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/DynamicChoicesTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/elastic/DataSearchRequestTest.groovy
📚 Learning: 2025-09-05T10:21:54.893Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 350
File: application-engine/src/test/groovy/com/netgrif/application/engine/export/service/ExportServiceTest.groovy:135-135
Timestamp: 2025-09-05T10:21:54.893Z
Learning: In ExportServiceTest.groovy, writing to src/test/resources is intentional to simulate production behavior where the working tree is mutated during file exports. This mirrors how the system works in production.

Applied to files:

  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/SetDataOnButtonTest.groovy
  • application-engine/src/test/groovy/com/netgrif/application/engine/elastic/DataSearchRequestTest.groovy
📚 Learning: 2025-07-29T17:19:18.300Z
Learnt from: tuplle
Repo: netgrif/application-engine PR: 331
File: application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticPetriNetService.java:45-46
Timestamp: 2025-07-29T17:19:18.300Z
Learning: In ElasticPetriNetService class, petriNetService is properly initialized using Lazy setter injection rather than constructor injection. This pattern with Lazy Autowired setter methods is commonly used in Spring to resolve circular dependencies and is a valid alternative to constructor injection.

Applied to files:

  • application-engine/src/test/groovy/com/netgrif/application/engine/workflow/SetDataOnButtonTest.groovy
📚 Learning: 2025-08-20T07:27:02.660Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 339
File: application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticTaskQueueManager.java:38-45
Timestamp: 2025-08-20T07:27:02.660Z
Learning: When reviewing ElasticTaskQueueManager changes, task.getTask().getId() returns the document identifier while task.getTaskId() returns the business task identifier. The queue operations should use consistent identifiers throughout the lifecycle (scheduling, processing, cleanup).

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticTaskQueueManager.java
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/params/DelegateTaskParams.java
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskService.java
📚 Learning: 2025-10-20T11:44:44.907Z
Learnt from: machacjozef
Repo: netgrif/application-engine PR: 367
File: application-engine/src/main/resources/application.yaml:24-24
Timestamp: 2025-10-20T11:44:44.907Z
Learning: In the netgrif/application-engine project, the correction of the Elasticsearch task index name from "_taks" to "_task" in application.yaml was approved by maintainer machacjozef, indicating that any data migration concerns for this typo fix are handled separately or not applicable to their deployment scenario.

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticTaskQueueManager.java
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskService.java
📚 Learning: 2025-11-07T13:11:20.622Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 378
File: application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticQueueManager.java:145-149
Timestamp: 2025-11-07T13:11:20.622Z
Learning: In the netgrif/application-engine project, failed Elasticsearch bulk operations in ElasticQueueManager should not be retried or re-queued within the flush() method. The system relies on scheduled reindexing and manual reindex endpoints as fallback mechanisms for failed operations, making in-method retries unnecessary and potentially problematic (could cause deadlocks, capacity issues, or infinite loops with bad data).

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticTaskQueueManager.java
📚 Learning: 2025-11-14T09:31:48.833Z
Learnt from: Retoocs
Repo: netgrif/application-engine PR: 383
File: application-engine/src/main/java/com/netgrif/application/engine/configuration/security/ImpersonationRequestFilter.java:87-87
Timestamp: 2025-11-14T09:31:48.833Z
Learning: In the ImpersonationRequestFilter.java file within the security configuration, logging the full principal object (including its toString() representation) in the warn statement when a non-LoggedUser principal is encountered is acceptable, even though it may include PII. The team prefers the additional debugging context over restricting the log to just the class name.

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/auth/service/RegistrationService.java
📚 Learning: 2025-09-04T11:09:31.264Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 350
File: application-engine/src/main/java/com/netgrif/application/engine/startup/runner/SuperCreatorRunner.java:56-63
Timestamp: 2025-09-04T11:09:31.264Z
Learning: In SuperCreatorRunner.java, when creating a user with PasswordCredential via setCredential("password", passwordCredential), there's no need to also call setPassword() as it would be redundant - the PasswordCredential already contains the password information needed by UserServiceImpl.createUser().

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/auth/service/RegistrationService.java
📚 Learning: 2025-09-05T10:17:28.577Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 350
File: application-engine/src/test/groovy/com/netgrif/application/engine/export/service/ExportServiceTest.groovy:82-82
Timestamp: 2025-09-05T10:17:28.577Z
Learning: In the application-engine test suite, testHelper.truncateDbs() follows a two-phase approach: first it clears the databases, then it executes superCreator to create the admin user. This means Optional.get() is safe when retrieving the admin user after truncateDbs() because the admin user is guaranteed to exist.

Applied to files:

  • application-engine/src/test/groovy/com/netgrif/application/engine/elastic/DataSearchRequestTest.groovy
📚 Learning: 2025-09-29T10:31:31.469Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 362
File: application-engine/src/main/java/com/netgrif/application/engine/petrinet/web/ProcessRoleController.java:43-45
Timestamp: 2025-09-29T10:31:31.469Z
Learning: In the Netgrif application engine, when Authentication objects reach controller endpoints, auth.getPrincipal() always returns a LoggedUser instance and is never null, so defensive casting checks are not necessary in controller methods.

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskService.java
📚 Learning: 2025-09-29T10:31:57.325Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 362
File: application-engine/src/main/java/com/netgrif/application/engine/petrinet/service/ProcessRoleService.java:513-529
Timestamp: 2025-09-29T10:31:57.325Z
Learning: PetriNet.getStringId() returns a simple ObjectId string representation (_id.toString()), not a composite Netgrif ID format, so new ObjectId(petriNetId) works correctly when petriNetId comes from PetriNet.getStringId().

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskService.java
🧬 Code graph analysis (2)
application-engine/src/main/java/com/netgrif/application/engine/workflow/web/WorkflowController.java (1)
application-engine/src/main/java/com/netgrif/application/engine/workflow/web/responsebodies/MessageResource.java (1)
  • MessageResource (10-31)
application-engine/src/main/java/com/netgrif/application/engine/workflow/params/DelegateTaskParams.java (2)
application-engine/src/main/java/com/netgrif/application/engine/workflow/params/TaskParams.java (1)
  • Data (17-70)
application-engine/src/main/java/com/netgrif/application/engine/workflow/params/DeleteCaseParams.java (1)
  • Data (15-55)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: Test
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
🔇 Additional comments (23)
application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticTaskQueueManager.java (1)

59-59: Previous feedback addressed - logging improvement looks good.

The parameterized logging with the exception object as the third parameter is now correctly implemented. This ensures both the error message and full stack trace are captured, which improves debuggability while maintaining efficient logging performance.

application-engine/src/test/groovy/com/netgrif/application/engine/workflow/SetDataOnButtonTest.groovy (2)

72-78: Excellent fix for the resource leak!

The use of .withCloseable (Groovy's try-with-resources equivalent) ensures the FileInputStream is properly closed after use, directly addressing the resource leak concern from the previous review. The ImportPetriNetParams builder is correctly configured with all required parameters.


94-95: LGTM: Consistent with PR's parameter-object refactoring.

The migration to TaskParams for assignTask and finishTask operations aligns with the PR's objective to consolidate method overloads into builder-style parameter objects. The usage is straightforward and correct.

application-engine/src/test/groovy/com/netgrif/application/engine/elastic/DataSearchRequestTest.groovy (2)

5-5: LGTM: Import updates support the API refactoring.

The import changes appropriately add the necessary types (Case, Task, ImportPetriNetParams) and consolidate dataset imports with a wildcard, which is acceptable in test files.

Also applies to: 12-15


96-103: Excellent: Resource leak fixed and builder pattern adopted correctly.

The refactoring properly addresses the previous resource leak concern by wrapping the FileInputStream in Groovy's withCloseable, ensuring the stream is always closed. The migration to ImportPetriNetParams builder pattern is implemented correctly and aligns with the project-wide API standardization described in the PR objectives.

application-engine/src/test/groovy/com/netgrif/application/engine/petrinet/domain/dataset/DynamicChoicesTest.groovy (2)

5-5: Import of ImportPetriNetParams matches the new parameter-object API.

The new import is consistent with the refactor towards builder-style params and keeps this test aligned with the updated IPetriNetService API.


54-63: Resource handling and import parameterization look correct.

Using FileInputStream(...).withCloseable {} ensures the stream is closed, and the ImportPetriNetParams builder correctly mirrors the previous (InputStream, VersionType, User) call. The explicit assert optNet.getNet() != null before using optNet is also sound.

application-engine/src/main/java/com/netgrif/application/engine/auth/service/RegistrationService.java (2)

69-69: LGTM! Correct fix for total count tracking.

The totalReset counter properly accumulates the count across all pagination iterations, and the final log message now reports the accurate total number of expired tokens reset.

Also applies to: 82-82, 87-87


95-95: LGTM! Parameterized logging improves code quality.

The migration to SLF4J parameterized logging is a best practice that improves performance by avoiding unnecessary string concatenation when the log level is disabled.

Also applies to: 133-133, 138-138, 164-164, 183-183, 187-187, 200-200

application-engine/src/main/groovy/com/netgrif/application/engine/migration/ActionMigration.groovy (2)

7-7: LGTM! Resource leak fixed and parameter builder adopted.

The try-with-resources pattern ensures the InputStream is properly closed, addressing the resource leak concern from the previous review. The migration to ImportPetriNetParams aligns with the PR's goal of standardizing service calls with parameter-builder objects.

Also applies to: 28-33


60-60: LGTM! Appropriate use of static modifiers.

Converting migrateDataSetActions and migrateDataRefActions to static methods is appropriate since they operate only on their parameters without requiring instance state. This improves clarity and follows best practices.

Also applies to: 68-68

application-engine/src/main/java/com/netgrif/application/engine/workflow/params/DelegateTaskParams.java (1)

46-73: LGTM! Custom builder methods properly synchronize entity and ID fields.

The custom builder methods correctly mirror the pattern established in TaskParams and DeleteCaseParams, ensuring that setting an entity (task, newAssignee, delegator) automatically populates the corresponding ID field. The null-safety checks prevent NPEs when calling getStringId().

application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskService.java (7)

132-159: LGTM! TaskParams pattern cleanly consolidates method parameters.

The refactor to TaskParams provides a cleaner API and the automatic attribute population via fillAndValidateAttributes (line 133) reduces boilerplate at call sites. The consistent extraction pattern and proper event/action flow are well-structured.


344-388: LGTM! fillAndValidateAttributes helpers intelligently populate missing attributes.

Both overloads follow a sound sequence: resolve task first, then useCase (which depends on task), then users. The DelegateTaskParams version properly validates that newAssignee can be resolved (lines 379-386) and throws informative exceptions when requirements aren't met.


492-551: LGTM! reloadTasks refactor adds valuable lazy-save optimization.

The new ReloadTaskOutcome return type provides callers with visibility into whether tasks were executed and whether the case was saved. The lazyCaseSave flag (line 492) allows callers to defer expensive save operations until necessary, and the logic correctly ensures the case is saved before executing auto-triggered tasks (lines 543-546).


627-655: LGTM! validateData improvements enhance error messaging and clarity.

Separating field and dataField retrieval (lines 629-630) improves readability, and the enhanced error messages (lines 642, 644, 649, 651) that include field names when available will significantly aid debugging validation failures.


814-816: LGTM! Early returns avoid unnecessary repository operations.

These guard clauses prevent saveAll/deleteAll calls on empty lists, eliminating unnecessary round-trips to MongoDB and Elasticsearch. Simple but effective optimization aligned with the PR's efficiency goals.

Also applies to: 950-952


833-853: LGTM! AtomicBoolean tracking minimizes unnecessary task saves.

The isTaskModified flag (line 833) ensures the task is persisted only when user references actually change (lines 840, 843, 847), avoiding wasteful save operations when resolveUserRef doesn't modify state. Good optimization.


390-409: LGTM! returnTokens now returns Case for better composability.

Changing the return type from void to Case (line 390) enables method chaining and functional composition, and the implementation correctly returns the saved case (line 408).

application-engine/src/main/java/com/netgrif/application/engine/workflow/web/WorkflowController.java (4)

89-95: LGTM! CreateCaseParams builder consolidates case creation parameters.

The refactor to CreateCaseParams.with() provides a cleaner, more maintainable API and aligns with the parameter-object pattern adopted across the workflow services.


190-190: LGTM! URL decoding now uses the modern Charset overload consistently.

Both calls now use URLDecoder.decode(caseId, StandardCharsets.UTF_8) instead of the older .name() variant, eliminating the need to handle UnsupportedEncodingException and making the code cleaner.

Also applies to: 220-220


225-227: LGTM! DeleteCaseParams builder consolidates deletion parameters.

Consistent with the CreateCaseParams pattern and the broader parameter-object refactor across the codebase.


196-196: LGTM! Logging now uses SLF4J parameterized messages.

The placeholder-based formatting (log.error("... [{}] failed:", caseId, e)) is more efficient than string concatenation and follows SLF4J best practices.

Also applies to: 232-232

- fix ActionMigration.migrateActions to fail on every successful import
@coderabbitai coderabbitai bot added the Medium label Nov 14, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Nov 14, 2025
# Conflicts:
#	application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticCaseMappingService.java
#	application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticCaseService.java
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: 2

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/elastic/service/ElasticIndexService.java (1)

188-197: Align deleteIndex logging with the actual delete outcome

The switch to parameterized logging is fine, but the message "Index: {} has been deleted!" is logged before the delete call and regardless of its boolean result. If delete() returns false or fails silently, logs will still state that the index has been deleted, which is misleading operationally.

Consider logging after the delete call and basing the log level/message on the returned value, e.g.:

-        if (this.indexExists(indexName)) {
-            log.warn("Index: {} has been deleted!", indexName);
-            return elasticsearchTemplate.indexOps(IndexCoordinates.of(indexName)).delete();
-        } else {
-            log.warn("Index: {} not found!", indexName);
-        }
+        if (this.indexExists(indexName)) {
+            boolean deleted = elasticsearchTemplate.indexOps(IndexCoordinates.of(indexName)).delete();
+            if (deleted) {
+                log.info("Index: {} deleted", indexName);
+            } else {
+                log.warn("Index: {} could not be deleted", indexName);
+            }
+            return deleted;
+        } else {
+            log.warn("Index: {} not found", indexName);
+        }

This keeps the new parameterized style while making logs accurately reflect the operation result.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a0eb9f2 and 0b54a21.

📒 Files selected for processing (3)
  • application-engine/src/main/groovy/com/netgrif/application/engine/petrinet/domain/dataset/logic/action/ActionDelegate.groovy (15 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticCaseMappingService.java (7 hunks)
  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticIndexService.java (1 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: Retoocs
Repo: netgrif/application-engine PR: 383
File: application-engine/src/main/java/com/netgrif/application/engine/startup/ApplicationRunnerOrderResolver.java:43-43
Timestamp: 2025-11-14T10:22:01.634Z
Learning: For the netgrif/application-engine repository, avoid flagging trivial or nitpick-level issues such as redundant null checks, minor code style improvements, or obvious simplifications that don't affect functionality or introduce bugs. Focus review comments on substantive issues like logic errors, security concerns, performance problems, or breaking changes.
📚 Learning: 2025-10-20T11:44:44.907Z
Learnt from: machacjozef
Repo: netgrif/application-engine PR: 367
File: application-engine/src/main/resources/application.yaml:24-24
Timestamp: 2025-10-20T11:44:44.907Z
Learning: In the netgrif/application-engine project, the correction of the Elasticsearch task index name from "_taks" to "_task" in application.yaml was approved by maintainer machacjozef, indicating that any data migration concerns for this typo fix are handled separately or not applicable to their deployment scenario.

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticIndexService.java
  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticCaseMappingService.java
📚 Learning: 2025-11-04T11:47:03.897Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 378
File: nae-spring-core-adapter/src/main/java/com/netgrif/application/engine/adapter/spring/elastic/domain/ElasticCase.java:16-16
Timestamp: 2025-11-04T11:47:03.897Z
Learning: In the netgrif/application-engine project, ElasticsearchRunner is responsible for creating Elasticsearch indexes automatically based on configuration. Spring Data's automatic index creation via the Document annotation's createIndex attribute should be disabled (set to false) to prevent conflicts with this centralized index management approach.

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticIndexService.java
📚 Learning: 2025-08-19T20:07:15.621Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 339
File: application-engine/src/test/groovy/com/netgrif/application/engine/filters/FilterImportExportTest.groovy:341-341
Timestamp: 2025-08-19T20:07:15.621Z
Learning: In the Elasticsearch migration, the stringId property was removed from ElasticCase and ElasticTask, with the id property now containing the MongoDB case/task object ID directly. This consolidation eliminates redundancy and simplifies the data model.

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticCaseMappingService.java
📚 Learning: 2025-08-19T20:13:40.087Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 339
File: nae-object-library/src/main/java/com/netgrif/application/engine/objects/elastic/domain/CaseField.java:16-16
Timestamp: 2025-08-19T20:13:40.087Z
Learning: In CaseField.java, fulltextValue is mapped as a keyword field type in Elasticsearch (for exact matches, filtering, aggregations), while the separate caseValue field serves different Elasticsearch query requirements, allowing the system to support multiple query patterns on the same data through different field mappings.

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticCaseMappingService.java
📚 Learning: 2025-08-19T20:07:43.748Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 339
File: nae-object-library/src/main/java/com/netgrif/application/engine/objects/elastic/domain/CaseField.java:16-16
Timestamp: 2025-08-19T20:07:43.748Z
Learning: In CaseField.java, the separate caseValue field (List<String>) is intentionally maintained alongside fulltextValue for specific Elasticsearch query requirements, rather than being derived on-the-fly from fulltextValue.

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticCaseMappingService.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: Build
  • GitHub Check: task-list-completed
🔇 Additional comments (9)
application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticCaseMappingService.java (1)

166-166: LGTM! Logging improvements follow SLF4J best practices.

The conversion from string concatenation to parameterized logging is correctly implemented across all six statements. This change improves performance by deferring string construction until the log level is confirmed active, and enhances readability through the standard placeholder pattern.

Also applies to: 183-183, 197-197, 262-262, 276-276, 319-319

application-engine/src/main/groovy/com/netgrif/application/engine/petrinet/domain/dataset/logic/action/ActionDelegate.groovy (8)

52-52: LGTM! New imports support parameter-object refactoring.

The new imports (ChangeCasePropertyOutcome, FinishTaskEventOutcome, MenuProcessRunner, and parameter builder classes) are consistent with the PR's goal of consolidating method overloads into builder-pattern APIs.

Also applies to: 57-57, 75-75, 77-79


635-642: LGTM! Task operation chain correctly uses builder pattern.

The refactoring properly chains task outcomes (assign → setData → finish) using the new TaskParams builder, and each outcome uses .getTask() from the previous step to maintain state continuity.


881-882: LGTM! Adds missing outcome tracking for case property changes.

The addition of ChangeCasePropertyOutcome ensures that case property modifications are properly tracked in the outcome chain, enabling frontend notifications of these changes.


987-1002: LGTM! Task operations consistently refactored with builder pattern.

All task operations (assign, cancel, finish) are consistently refactored to use TaskParams builder, with proper outcome tracking via the addTaskOutcomeAndReturnTask helper method.

Also applies to: 1010-1023, 1036-1049


1182-1184: LGTM! Consistent routing through getData(Task) overload.

The method now delegates to the getData(Task, params) overload, ensuring consistent data retrieval logic and reducing code duplication.


1383-1387: LGTM! Improved null safety with Optional handling.

The refactoring to use Optional<AbstractUser> improves null safety across user lookup methods. The explicit isEmpty() checks with clear error messages enhance debugging and prevent NPEs.

Also applies to: 1430-1433, 1451-1457


1776-1776: LGTM! Consistent use of DeleteCaseParams.

Both deleteFilter and deleteMenuItem correctly use the new DeleteCaseParams parameter object pattern, consistent with the PR's refactoring goals.

Also applies to: 2014-2014


2803-2803: Fix incorrect syntax on line 2808: MenuItemConstants.FIELD_NODE_NAME.value references a String constant.

FIELD_NODE_NAME in MenuItemConstants is defined as a String constant ("nodeName"), not an enum member. Calling .value on a String constant will fail. Remove the .value accessor to use the constant directly as MenuItemConstants.FIELD_NODE_NAME.

The reference to MenuProcessRunner.MENU_NET_IDENTIFIER on line 2803 is correct (defined as "menu_item" in MenuProcessRunner.java:27).

⛔ Skipped due to learnings
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 318
File: nae-object-library/src/main/java/com/netgrif/application/engine/objects/workflow/domain/menu/MenuItemConstants.java:60-62
Timestamp: 2025-06-23T13:30:13.096Z
Learning: In MenuItemConstants enum in nae-object-library/src/main/java/com/netgrif/application/engine/objects/workflow/domain/menu/MenuItemConstants.java, the field `attributeId` will be renamed to `value` to make it more generic and appropriate for both dataset attribute identifiers and technical constants like PATH_SEPARATOR.

- fix ActionDelegate.createCase outcomes initialization
- fix ActionDelegate.deleteCase outcomes initialization
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: 4

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/groovy/com/netgrif/application/engine/petrinet/domain/dataset/logic/action/ActionDelegate.groovy (1)

2823-2832: PATH_SEPARATOR.value in getCorrectedUri is likely incorrect and may return the wrong type.

Everywhere else in this class MenuItemConstants.PATH_SEPARATOR is used directly as the path separator (e.g., comparisons and lastIndexOf(MenuItemConstants.PATH_SEPARATOR)), implying it is already a String. Here only, String rootPath = MenuItemConstants.PATH_SEPARATOR.value accesses a .value property, which for a String would expose its internal char[]. That means rootPath/getCorrectedUri could now return a char[] instead of the intended root-path String, leading to subtle type/behavior issues.

Unless PATH_SEPARATOR has been redefined to a custom object with a String value (which would make the other usages inconsistent), this line should use the constant directly.

Concrete fix:

-    String getCorrectedUri(String uncheckedPath) {
-        String rootPath = MenuItemConstants.PATH_SEPARATOR.value
+    String getCorrectedUri(String uncheckedPath) {
+        String rootPath = MenuItemConstants.PATH_SEPARATOR
         if (uncheckedPath == "") {
             return rootPath
         }
         int lastIdx = uncheckedPath.lastIndexOf(MenuItemConstants.PATH_SEPARATOR)
         if (lastIdx == -1) {
             return rootPath
         }
         return uncheckedPath
     }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0b54a21 and acf4945.

📒 Files selected for processing (1)
  • application-engine/src/main/groovy/com/netgrif/application/engine/petrinet/domain/dataset/logic/action/ActionDelegate.groovy (15 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: Retoocs
Repo: netgrif/application-engine PR: 383
File: application-engine/src/main/java/com/netgrif/application/engine/startup/ApplicationRunnerOrderResolver.java:43-43
Timestamp: 2025-11-14T10:22:01.634Z
Learning: For the netgrif/application-engine repository, avoid flagging trivial or nitpick-level issues such as redundant null checks, minor code style improvements, or obvious simplifications that don't affect functionality or introduce bugs. Focus review comments on substantive issues like logic errors, security concerns, performance problems, or breaking changes.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: Build
  • GitHub Check: task-list-completed
🔇 Additional comments (8)
application-engine/src/main/groovy/com/netgrif/application/engine/petrinet/domain/dataset/logic/action/ActionDelegate.groovy (8)

52-52: Imports for new outcomes and param objects are consistent.

The added imports for ChangeCasePropertyOutcome, DeleteCaseEventOutcome, FinishTaskEventOutcome, MenuProcessRunner, and the CreateCaseParams/DeleteCaseParams/TaskParams classes are all used below and align with the refactored APIs. No issues here.

Also applies to: 54-54, 58-58, 76-76, 78-80


636-642: Outcome chaining in addTaskOutcomes looks correct.

Assign → setData → finish is executed in order, and each of AssignTaskEventOutcome, SetDataEventOutcome, and FinishTaskEventOutcome is added to this.outcomes, which matches the event-stream pattern used elsewhere in this class.


868-884: ChangeCasePropertyOutcome integration is appropriate.

Emitting new ChangeCasePropertyOutcome(useCase) after mutating case (and task) properties ensures these changes participate in the outcome chain without altering existing functional behavior.


952-990: createCase/deleteCase refactor to param objects and outcomes is sound.

Using CreateCaseParams.with()/DeleteCaseParams centralizes arguments, and both createCase overloads plus the two deleteCase overloads now capture and push the respective CreateCaseEventOutcome/DeleteCaseEventOutcome into this.outcomes before returning the Case. This aligns with the rest of the delegate’s outcome handling and should improve consistency for consumers.


992-1009: Task operations now consistently use TaskParams builders.

assignTask, cancelTask, and finishTask use TaskParams.with() for both task-id and task-based overloads, feeding everything through addTaskOutcomeAndReturnTask so outcomes are always collected. This unifies behavior and keeps the DSL surface clean. Please just double-check that the new TaskParams-based service methods preserve the same defaults (e.g., effective user, params) as the previous overloads they replace.

Also applies to: 1015-1030, 1041-1055


1147-1163: TODO about deprecated setDataWithPropagation noted.

No functional change here; the TODO is a reasonable reminder to clean up deprecated helpers in a later pass. Nothing to block this PR.


1188-1191: Delegating getData(String taskId, ...) through the Task overload is an improvement.

Resolving the task once and reusing getData(Task, ...) removes duplication and keeps all data-loading logic in one place.


1437-1440: Null guard in deleteUser(String email) avoids follow-up failures.

Early-returning when userService.findByEmail returns null prevents passing a null user into downstream logic and replaces an implicit NPE with a clear error log.

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

Labels

improvement A change that improves on an existing feature Large Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants