-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
AAE-28952 Fix process variable sorting #1631
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This reverts commit 24d9dc3.
918d3d1
to
58cfa1a
Compare
|
jesty
approved these changes
Dec 11, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue link: AAE-28952
In all the filter types, the parsing of variable value has been delegated to the framework instead of using the custom extraction functions, in order to avoid having many hard-coded functions, hence the class CustomPostgreSQL is significantly reduced.
The only two remaining custom functions are:
The filtering and sorting logic has changed, except for the root filters (Task and ProcessInstance root attributes like status, createdDate,...). Since now the framework is handling the variable parsing, the classes that implemented the conditions are now reduced and they basically implement two interfaces:
Since the task and process variables filtering is obtained by adding predicates in the having clause, i.e. a group by clause is present, this leaded to wrong results when the repository was executing the count query. To fix this, the SQL window function "OVER()" has been used. To use it, a custom version of the JpaSpecificationExecutor has been implemented, which, with the aid of a the @CountOverFulWindow annotation, uses the "COUNT (*) OVER()" to count the results only when using TaskSpecification and ProcessInstanceSpecification and when there's a group by clause.
It also includes the changing in the "sort" object inner parameter regarding the process variable key in the filters request, because it was too significant for the overall logic to change it in a different PR.
processVariableKeys (array) -> processVariableKey(string)