Scenario:
- There is a task t with candidate group g
- There is a user u who is a member of g
When:
- I make a task query with an or query, such as taskService.createTaskQuery().or().candidateUser("u").endOr().list()
Current behavior:
- t is not returned
Expected behavior:
- t is returned (as is also the case if no or query is used, such as taskService.createTaskQuery().candidateUser("u").list())
Reason:
- The logic that gets the candidate groups of a query (https://github.com/camunda/camunda-bpm-platform/blob/7.12.0-alpha3/engine/src/main/java/org/camunda/bpm/engine/impl/TaskQueryImpl.java#L929-L969) only resolves the candidate user's groups in case it is not an or query
Implementation notes:
- To avoid inconsistencies, the query for a user's groups should only be made once, even if I use multiple or queries with the same condition (e.g. taskService.createTaskQuery().or().candidateUser("u").endOr().or().candidateUser("u").endOr().list()