[NAE-2231] Unable to change behavior of taskRef on finish event witho…#371
[NAE-2231] Unable to change behavior of taskRef on finish event witho…#371tuplle merged 2 commits intorelease/6.4.2from
Conversation
…ut error message - implement FinishTaskEventOutcome flag, which signals if the finished task still exists
WalkthroughAdds a boolean flag Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
src/main/java/com/netgrif/application/engine/workflow/domain/eventoutcomes/taskoutcomes/FinishTaskEventOutcome.java(1 hunks)src/main/java/com/netgrif/application/engine/workflow/web/responsebodies/eventoutcomes/LocalisedFinishTaskEventOutcome.java(1 hunks)
⏰ 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: 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 (2)
src/main/java/com/netgrif/application/engine/workflow/domain/eventoutcomes/taskoutcomes/FinishTaskEventOutcome.java (2)
13-16: LGTM!The field declaration is clear and well-documented.
24-24: LGTM!The field initialization correctly delegates to the helper method.
...if/application/engine/workflow/domain/eventoutcomes/taskoutcomes/FinishTaskEventOutcome.java
Show resolved
Hide resolved
...cation/engine/workflow/web/responsebodies/eventoutcomes/LocalisedFinishTaskEventOutcome.java
Show resolved
Hide resolved
...cation/engine/workflow/web/responsebodies/eventoutcomes/LocalisedFinishTaskEventOutcome.java
Show resolved
Hide resolved
…ut error message - Bump Elasticsearch image version in docker-compose from 7.17.4 to 7.17.28. - Fix null-check and equality handling in task execution logic. - Remove unnecessary whitespace in LocalisedFinishTaskEventOutcome.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (2)
src/main/java/com/netgrif/application/engine/workflow/web/responsebodies/eventoutcomes/LocalisedFinishTaskEventOutcome.java (1)
11-12: Field declaration is correct.The use of
Booleanwrapper type allows for null values, which is appropriate for this response body class. The@Getterannotation will generate the accessor method.Note: A previous review comment suggested renaming the field to
taskStillExecutablefor a more conventional getter name, but this is a minor style consideration.src/main/java/com/netgrif/application/engine/workflow/domain/eventoutcomes/taskoutcomes/FinishTaskEventOutcome.java (1)
33-36: Consider additional null safety and method naming clarity.The implementation has improved with the
task != nullcheck andObjects.equals, but two concerns remain:
Potential NPE: While
taskis checked for null, there's no guarantee thattask.getStringId()won't throw an exception or return null. IfgetStringId()can return null, the current logic is safe; if it can throw, additional handling may be needed.Method naming: The name
isTaskStillExecutablesuggests checking whether a task can be executed, but the implementation only verifies existence in the case's task collection. A name likeisTaskStillPresentordoesTaskStillExistwould more accurately reflect the logic.To verify the safety of
task.getStringId(), run:#!/bin/bash # Description: Check Task.getStringId() implementation and usage patterns # Find the Task class definition and getStringId method echo "=== Finding Task class and getStringId method ===" ast-grep --pattern $'class Task { $$$ getStringId() { $$$ } $$$ }' # Check if getStringId can return null echo -e "\n=== Checking for null checks on getStringId calls ===" rg -nP --type=java -C3 '\.getStringId\(\)\s*(!= null|== null|\?\.)' # Look for @Nullable or @NotNull annotations on getStringId echo -e "\n=== Checking for nullability annotations ===" rg -nP --type=java -B5 'getStringId\s*\(' | rg -P '(@Nullable|@NotNull|@NonNull)'
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
docker-compose.yml(1 hunks)src/main/java/com/netgrif/application/engine/workflow/domain/eventoutcomes/taskoutcomes/FinishTaskEventOutcome.java(1 hunks)src/main/java/com/netgrif/application/engine/workflow/web/responsebodies/eventoutcomes/LocalisedFinishTaskEventOutcome.java(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
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.
📚 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:
src/main/java/com/netgrif/application/engine/workflow/web/responsebodies/eventoutcomes/LocalisedFinishTaskEventOutcome.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). (1)
- GitHub Check: Build
🔇 Additional comments (5)
src/main/java/com/netgrif/application/engine/workflow/web/responsebodies/eventoutcomes/LocalisedFinishTaskEventOutcome.java (2)
5-5: LGTM!The import is correctly added to support the
@Getterannotation.
16-18: Constructor initialization looks good.The null check before accessing
outcome.isTaskStillExecutable()is appropriate and prevents potential NPEs.src/main/java/com/netgrif/application/engine/workflow/domain/eventoutcomes/taskoutcomes/FinishTaskEventOutcome.java (3)
9-9: LGTM!The
Objectsimport is correctly added to support null-safe equality checks in the helper method.
14-17: Field declaration and documentation are clear.The javadoc clearly describes the field's purpose, and using a primitive
booleanis appropriate for this domain object.
25-25: Constructor initialization is well-structured.Delegating the logic to the helper method keeps the constructor clean and promotes code reuse.
Description
I have added a flag to the FinishTaskEventOutcome. The boolean flag is true if the task, that was finished, is still executable. This information needs frontend to prohibit reloading on non-existing tasks
Fixes NAE-2231
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?
Manually. I tested multiple situations for the updated code conditions
Test Configuration
Checklist:
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.