-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Historic process instances query withIncidents combined with orQueries provides incorrect results #3182
Comments
Hello @Bernd-Focke-MT , Thank you for reaching out to us with this. Best regards, |
Hello @Bernd-Focke-MT, I was able to reproduce and confirm the bug. Thanks for the heads up about the root cause being the different JOIN with the Incidents table. Best, |
Hello @Bernd-Focke-MT, We will not be able to work on this any time soon. Let us know if you consider to make a code contribution. Best regards, |
Hello, I'm working on fixing this issue. Along with this fix, I'll also be pushing changes to the related issue to the same PR. |
Hello @kmannuru, It's great that you want to make a contribution on this.
Best, |
Environment
Camunda 7.18
Description
REST API for (historic) process instances (/rest/history/prpocess-instance) provide incorrect results in some specific cases:
When querying historic process instances with the filter " withIncidents" AND “orQueries” (processVariableA == “value1” OR processVariableA == “value2” )" incorrect result is provided.
Steps to reproduce
Create a request querying historic process instances with the filter " withIncidents" AND “orQueries” (processVariableA == “value1” OR processVariableA == “value2” )" like the following:
Observed Behavior
The search result contains wrong results: e.g. process instances with incidents but also process instances without incidents.
Expected behavior
The search result should contain process instances with incidents only AND with one of the given variables.
Root Cause
We have identified, that the SQL Query is created with “left join” instead of an “inner join”:
In case
withIncidents
is part of the conjunction, aninner join
is required. In casewithIncidents
is part of the OR query, aleft join
is still required.Solution Ideas
JOIN_TYPE
only incident related filter is part of orQuery, e.g.:This will work if incident related filter is either with AND or in OR query. Also the
JOIN_TYPE
is affecting only this table. However, we need to consider other scenario and check what's the state of Task orQuery.Hints
Links
Breakdown
Pull requests
Dev2QA handover
The text was updated successfully, but these errors were encountered: