I have a Task Query as json to filter tasks by states: SUSPENDED, RESUMED, PARKED and order by priority:
After that, I would like to extend this query: filtering by ((suspended or resumed or parked states) and applicationId) order by priority but it is not as my expectation:
The result: SELECT * FROM IWA_Task WHERE (Column(IWA_TaskQuery.State) = 4 || Column(IWA_TaskQuery.State) = 5 || (Column(IWA_TaskQuery.State) = 8 && Column(IWA_TaskQuery.ApplicationId) = 1)) ORDER BY Column(CurrentPriority) ASCENDING ==> Tasks with Suspended state and Resumed state are not filtered by applicationId
The result: SELECT * FROM IWA_Task WHERE ((Column(IWA_TaskQuery.State) = 4 || Column(IWA_TaskQuery.State) = 5 || Column(IWA_TaskQuery.State) = 8) && Column(IWA_TaskQuery.ApplicationId) = 1) ==> Priority order is lost Do you have any suggestions? Or is it a bug of task json query? asked 18.05.2017 at 02:59 lttung |
Hi Flavio, The problem is from Json:
Why is query2 the same as query1 before filtering by app but different after that? answered 18.05.2017 at 23:31 lttung Hi @lttung, thanks for pointing out the deserialization bug. We will analyze it. Here the link to the issue: https://jira.axonivy.com/jira/browse/XIVY-1923: CaseQuey / TaskQuery json deserialization removes AND-condition when it has only one condition
(22.05.2017 at 04:10)
Flavio Sadeghi ♦♦
|
The following snipped creates your expected query:
Resulting Query:
Way 1: The first 'operator' is a OR-operator. As a result, the root-operator is a or-operator and therefore any further operators are attached to this root-(or-)operator, which results in your written condition. Way 2: The method I would say: the TaskQuery API is a perfect fluent API. When using it to combine multiple condition is is a bit tricky... answered 18.05.2017 at 09:33 Flavio Sadeghi ♦♦ |
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 18.05.2017 at 02:59
Seen: 2,366 times
Last updated: 22.05.2017 at 04:10