AnsweredAssumed Answered

Select tasks by candidateUser or candidateGroups

Question asked by fersmi on Sep 18, 2012
Latest reply on May 19, 2017 by haja
Hi,
I tried select all task by candidateUser or candidateGroups in TaskQuery
taskService.createTaskQuery().taskCandidateGroupIn(roleNames).taskCandidateUser(user.getUsername()).orderByDueDate().asc().list();
but I got
ActivitiException - Invalid query usage: cannot set both candidateUser and candidateGroupIn

My question is: If this select is not allowed why in iBatis query mapping is this:

    <if test="candidateUser != null || candidateGroups != null">
        and T.ASSIGNEE_ is null
        and I.TYPE_ = 'candidate'
        and
        (
          <if test="candidateUser != null">
            I.USER_ID_ = #{candidateUser}         
          </if>
          <if test="candidateUser != null &amp;&amp; candidateGroups != null &amp;&amp; candidateGroups.size() &gt; 0">
            or
          </if>
          <if test="candidateGroups != null &amp;&amp; candidateGroups.size() &gt; 0">
            I.GROUP_ID_ IN
            <foreach item="group" index="index" collection="candidateGroups"
                     open="(" separator="," close=")">
              #{group}
            </foreach>
          </if>
        )
      </if>

The mapping allows both candidateUser or candidateGroups at the same time.

And I need taht query!!

Outcomes