AnsweredAssumed Answered

Problem with TaskQuery when using custom GroupEntityManager and UserEntityManager

Question asked by xman-berlin on Jun 16, 2014
Latest reply on Jun 30, 2014 by trademak
Hi folks,

I'm facing an issue when I try to perform a task query using "taskCandidateOrAssigned" but using a custom GroupEntityManager. The problem is that the iBatis-query for groups is using actititi internal tables (ACT_ID_MEMBERSHIP) ignoring the configured custom GroupEntityManager (see Task.xml / commonSelectTaskByQueryCriteriaSql / bothCandidateAndAssigned).

I already saw that it is recommended to provide a custom TaskManager as well, but this would mean I'd have to reimplement the whole task query concept just because I need to provide a custom user-group-mapping.

A quick-and-dirty solution would be that in case of using "bothCandidateAndAssigned" the "TaskQuery.taskCandidateGroupIn" attribute (candidateGroups) would be used for the query, e.g.

        <when test="bothCandidateAndAssigned">
          <if test="userIdForCandidateAndAssignee != null">
            and (RES.ASSIGNEE_ = #{userIdForCandidateAndAssignee} or (RES.ASSIGNEE_ is null and I.USER_ID_ = #{userIdForCandidateAndAssignee} or I.GROUP_ID_ IN
            <foreach item="group" index="index" collection="candidateGroups"
                     open="(" separator="," close=")">
) )

Any other recommendation how I can solve this issue?