<?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 Query .list() returning wrong size when used with parameter includeProcessVariables() or includeTaskLocalVariables() in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/query-list-returning-wrong-size-when-used-with-parameter/m-p/220121#M173251</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I got incorrect results count when using the .list() method on queries with includeProcessVariables() or includeTaskLocalVariables() parameters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I don't use .list() but just .count() the result is correct.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I couldn't reproduce the issue in an unit test with new data because I think the issue is related to my existing process variables.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Below are the tests I did :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;sql&amp;gt;SELECT COUNT(DISTINCT PROC_INST_ID_) FROM ACT_RU_EXECUTION; – = 1140&amp;lt;/sql&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;runtimeService.createProcessInstanceQuery().count(); // Returns 1140 : correct&lt;BR /&gt;runtimeService.createProcessInstanceQuery().list().size(); // Returns 1140 : correct&lt;BR /&gt;runtimeService.createProcessInstanceQuery().includeProcessVariables().count(); // Returns 1140 : correct&lt;BR /&gt;runtimeService.createProcessInstanceQuery().includeProcessVariables().list().size(); // Returns 916 : INCORRECT&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;sql&amp;gt;SELECT COUNT(*) FROM ACT_RU_TASK; – = 1182&amp;lt;/sql&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;taskService.createTaskQuery().count(); // Returns 1182 : correct&lt;BR /&gt;taskService.createTaskQuery().list().size(); // Returns 1182 : correct&lt;BR /&gt;taskService.createTaskQuery().includeTaskLocalVariables().count(); // Returns 1182 : correct&lt;BR /&gt;taskService.createTaskQuery().includeTaskLocalVariables().list().size(); // Returns 1182 : correct&lt;BR /&gt;taskService.createTaskQuery().includeProcessVariables().count(); // Returns 1182 : correct&lt;BR /&gt;taskService.createTaskQuery().includeProcessVariables().list().size(); // Returns 917 : INCORRECT&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;sql&amp;gt;SELECT COUNT(*) FROM ACT_HI_TASKINST; – = 6589&amp;lt;/sql&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;historyService.createHistoricTaskInstanceQuery().count(); // Returns 6589 : correct&lt;BR /&gt;historyService.createHistoricTaskInstanceQuery().list().size(); // Returns 6589 : correct&lt;BR /&gt;historyService.createHistoricTaskInstanceQuery().includeTaskLocalVariables().count(); // Returns 6589 : correct&lt;BR /&gt;historyService.createHistoricTaskInstanceQuery().includeTaskLocalVariables().list().size(); // Returns 1256 : INCORRECT&lt;BR /&gt;historyService.createHistoricTaskInstanceQuery().includeProcessVariables().count(); // Returns 6589 : correct&lt;BR /&gt;historyService.createHistoricTaskInstanceQuery().includeProcessVariables().list().size(); // Returns 1256 : INCORRECT&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Aug 2016 08:54:29 GMT</pubDate>
    <dc:creator>ilalaina</dc:creator>
    <dc:date>2016-08-04T08:54:29Z</dc:date>
    <item>
      <title>Query .list() returning wrong size when used with parameter includeProcessVariables() or includeTaskLocalVariables()</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/query-list-returning-wrong-size-when-used-with-parameter/m-p/220121#M173251</link>
      <description>Hi all,I got incorrect results count when using the .list() method on queries with includeProcessVariables() or includeTaskLocalVariables() parameters.If I don't use .list() but just .count() the result is correct.I couldn't reproduce the issue in an unit test with new data because I think the issue</description>
      <pubDate>Thu, 04 Aug 2016 08:54:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/query-list-returning-wrong-size-when-used-with-parameter/m-p/220121#M173251</guid>
      <dc:creator>ilalaina</dc:creator>
      <dc:date>2016-08-04T08:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Query .list() returning wrong size when used with parameter includeProcessVariables() or includeTaskLocalVariables()</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/query-list-returning-wrong-size-when-used-with-parameter/m-p/220122#M173252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Same situation&amp;nbsp; that we have faced on production system.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help will make us glad.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2016 12:19:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/query-list-returning-wrong-size-when-used-with-parameter/m-p/220122#M173252</guid>
      <dc:creator>doganmesut</dc:creator>
      <dc:date>2016-08-05T12:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Query .list() returning wrong size when used with parameter includeProcessVariables() or includeTaskLocalVariables()</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/query-list-returning-wrong-size-when-used-with-parameter/m-p/220123#M173253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Would you capture the SQL sent to database? It seems to be a "inner join" x "outer join" problem… Capturing the SQL sent to database would clarify that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In case you use PostgreSQL, you change postgresql.conf enabling &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;log_min_duration_statement = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, all statements will be recorded in log (be careful to not enable this in production servers!!!)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Order RDBMS would have similar feature to enable statements log (AFAIK, MS SQL and Oracle both have similar feature).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edson&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Aug 2016 20:14:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/query-list-returning-wrong-size-when-used-with-parameter/m-p/220123#M173253</guid>
      <dc:creator>edsonrichter</dc:creator>
      <dc:date>2016-08-06T20:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Query .list() returning wrong size when used with parameter includeProcessVariables() or includeTaskLocalVariables()</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/query-list-returning-wrong-size-when-used-with-parameter/m-p/220124#M173254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'd like to share the solution I found : it was due to a hardcoded limit in ProcessEngineConfigurationImpl.java :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Line 520:&amp;nbsp;&amp;nbsp; protected int executionQueryLimit = 20000;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Line 521:&amp;nbsp;&amp;nbsp; protected int taskQueryLimit = 20000;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Line 522:&amp;nbsp;&amp;nbsp; protected int historicTaskQueryLimit = 20000;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Line 523:&amp;nbsp;&amp;nbsp; protected int historicProcessInstancesQueryLimit = 20000;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When fetching process variables a join with the table ACT_RU_VARIABLE is performed before computing, and if you have many variables the results are limited to 20000 rows.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The solution is to increase these limits in the process engine configuration :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SpringProcessEngineConfiguration config = new SpringProcessEngineConfiguration();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;config.setExecutionQueryLimit(LIMIT);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;config.setTaskQueryLimit(LIMIT);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;config.setHistoricTaskQueryLimit(LIMIT);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;config.setHistoricProcessInstancesQueryLimit(LIMIT);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Aug 2016 08:20:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/query-list-returning-wrong-size-when-used-with-parameter/m-p/220124#M173254</guid>
      <dc:creator>ilalaina</dc:creator>
      <dc:date>2016-08-12T08:20:18Z</dc:date>
    </item>
  </channel>
</rss>

