<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Bug with TaskQuery.taskCandidateOrAssigned? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/bug-with-taskquery-taskcandidateorassigned/m-p/230382#M183512</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm seeing some behavior with using TaskQuery.taskCandidateOrAssigned that seems like a bug but wanted to check before opening an issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a process with two different user tasks, one called Manager with a candidate group manager and another called Review with no candidate group.&amp;nbsp; I have my own GroupEntityManager that implements the findGroupsByUser method and it is being called and working fine in most cases to get the groups for a user and return the right thing when using TaskQuery.taskCandidateUser for example.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the scenario.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Two process instances are created that are at the Manager user task.&amp;nbsp; One is assigned to user john and the other is unassigned.&amp;nbsp; Additionally, there is a process instance at the Review task and it is assigned to andy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using taskCandidateUser with user andy returns the unassigned Manager task which is correct.&amp;nbsp; It does not return the task assigned to john nor the Review task assigned to andy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, if I use taskCandidateOrAssigned instead, just the Review task is returned.&amp;nbsp; I would expect this to still return the unassigned task as it is a candidate.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Looking at the code, specifically Task.xml, it appears for the taskCandidateUser case, the SQL generated includes something like this which uses the candidateGroups retrieved from my GroupEntityManager:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;if test="candidateGroups != null &amp;amp;amp;&amp;amp;amp; candidateGroups.size() &amp;amp;gt; 0"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I.GROUP_ID_ IN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;foreach item="group" index="index" collection="candidateGroups"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; open="(" separator="," close=")"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #{group}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/foreach&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/if&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But in the case of using taskCandidateOrAssigned it is not, instead it is only using the internal table with this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;if test="candidateGroups == null"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and (RES.ASSIGNEE_ = #{userIdForCandidateAndAssignee} or (RES.ASSIGNEE_ is null and (I.USER_ID_ = #{userIdForCandidateAndAssignee}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or I.GROUP_ID_ IN (select g.GROUP_ID_ from ${prefix}ACT_ID_MEMBERSHIP g where g.USER_ID_ = #{userIdForCandidateAndAssignee} ) ) ) )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/if&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This seems like a bug to me, what is returned from taskCandidateOrAssigned should include everything returned from taskCandidateUser plus any assigned, and it shouldn't matter if a custom GroupEntityManager is used or not.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please confirm and let me know if I need to open an issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note, I'm using 5.19.0.2.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Mar 2016 16:58:13 GMT</pubDate>
    <dc:creator>schmke</dc:creator>
    <dc:date>2016-03-15T16:58:13Z</dc:date>
    <item>
      <title>Bug with TaskQuery.taskCandidateOrAssigned?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/bug-with-taskquery-taskcandidateorassigned/m-p/230382#M183512</link>
      <description>I'm seeing some behavior with using TaskQuery.taskCandidateOrAssigned that seems like a bug but wanted to check before opening an issue.I have a process with two different user tasks, one called Manager with a candidate group manager and another called Review with no candidate group.&amp;nbsp; I have my own</description>
      <pubDate>Tue, 15 Mar 2016 16:58:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/bug-with-taskquery-taskcandidateorassigned/m-p/230382#M183512</guid>
      <dc:creator>schmke</dc:creator>
      <dc:date>2016-03-15T16:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with TaskQuery.taskCandidateOrAssigned?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/bug-with-taskquery-taskcandidateorassigned/m-p/230383#M183513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm assuming this is yours: &lt;/SPAN&gt;&lt;A href="https://github.com/Activiti/Activiti/pull/846" rel="nofollow noopener noreferrer"&gt;https://github.com/Activiti/Activiti/pull/846&lt;/A&gt;&lt;SPAN&gt;? We'll discuss further there (but give us a couple of days, lots of PR's to process!)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2016 13:27:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/bug-with-taskquery-taskcandidateorassigned/m-p/230383#M183513</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2016-03-18T13:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with TaskQuery.taskCandidateOrAssigned?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/bug-with-taskquery-taskcandidateorassigned/m-p/230384#M183514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yep, that is it.&amp;nbsp; Thanks for taking a look.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2016 13:29:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/bug-with-taskquery-taskcandidateorassigned/m-p/230384#M183514</guid>
      <dc:creator>schmke</dc:creator>
      <dc:date>2016-03-18T13:29:54Z</dc:date>
    </item>
  </channel>
</rss>

