Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-10801

Filtering by candidateUser in an OR query does not resolve candidate groups

      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:

      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()

        This is the controller panel for Smart Panels app

            [CAM-10801] Filtering by candidateUser in an OR query does not resolve candidate groups

            There is a pull request [CAM-10801: filtering by candidateUser in an OR query does not resolve candidate groups](https://github.com/camunda/camunda-bpm-platform/pull/473) for it.

            The [TaskQueryImpl.java](https://github.com/camunda/camunda-bpm-platform/blob/7.12.0-alpha3/engine/src/main/java/org/camunda/bpm/engine/impl/TaskQueryImpl.java) class changed, and the [TaskCandidateTest.java](https://github.com/camunda/camunda-bpm-platform/blob/7.12.0-alpha3/engine/src/test/java/org/camunda/bpm/engine/test/bpmn/usertask/TaskCandidateTest.java) class got a new testcase.

            • the `getCandidateGroups()` method now resolves the `candidateUser`'s groups in case of an 'or' query too, so the `TaskQuery` returns correct results.
            • the `getCandidateGroups()` is working for non 'or' queries exactly the same way as before.
            • the `getGroupsForCandidateUser(...)` method caches it's results now, as suggested in the implementation notes.
            • the `TaskCandidateTest.java` class has got a new testcase to test the conditions where the the error occured before

            László Pálossy added a comment - There is a pull request [CAM-10801: filtering by candidateUser in an OR query does not resolve candidate groups] ( https://github.com/camunda/camunda-bpm-platform/pull/473 ) for it. The [TaskQueryImpl.java] ( https://github.com/camunda/camunda-bpm-platform/blob/7.12.0-alpha3/engine/src/main/java/org/camunda/bpm/engine/impl/TaskQueryImpl.java ) class changed, and the [TaskCandidateTest.java] ( https://github.com/camunda/camunda-bpm-platform/blob/7.12.0-alpha3/engine/src/test/java/org/camunda/bpm/engine/test/bpmn/usertask/TaskCandidateTest.java ) class got a new testcase. the `getCandidateGroups()` method now resolves the `candidateUser`'s groups in case of an 'or' query too, so the `TaskQuery` returns correct results. the `getCandidateGroups()` is working for non 'or' queries exactly the same way as before. the `getGroupsForCandidateUser(...)` method caches it's results now, as suggested in the implementation notes. the `TaskCandidateTest.java` class has got a new testcase to test the conditions where the the error occured before

            Hi palossyl,

            Thanks for providing a fix. We'll review it in the next days.

            Cheers,
            Thorben

            Thorben Lindhauer added a comment - Hi palossyl , Thanks for providing a fix. We'll review it in the next days. Cheers, Thorben

              Unassigned Unassigned
              thorben.lindhauer Thorben Lindhauer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: