<?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 Select Tasks With Variables In Single Query in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/select-tasks-with-variables-in-single-query/m-p/64383#M40583</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everybody,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;is there a way to get a list of tasks with its variables in one query? Of course, I can get the required data the following way (example):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;List&amp;lt;Task&amp;gt; tasks = taskService.createTaskQuery().taskAssignee("mike").list();&lt;BR /&gt;for (Task task: tasks) {&lt;BR /&gt;&amp;nbsp; Map&amp;lt;String, Object&amp;gt; vars = taskService.getVariables(task.getId());&lt;BR /&gt;&amp;nbsp; System.out.println(task.getId() + " - " + task.getDueDate() + " - " + vars.get("var1") + " - " + vars.get("var2"));&lt;BR /&gt;}&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't really like that solution since there has to be done a seperate query task for each task which might cause a lot of single database queries… I would prefer if the variable map would be directly provided with the task:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;List&amp;lt;Task&amp;gt; tasks = taskService.createTaskQuery().taskAssignee("mike").list();&lt;BR /&gt;for (Task task: tasks) {&lt;BR /&gt;&amp;nbsp; Map&amp;lt;String, Object&amp;gt; vars = task.getVariables();&lt;BR /&gt;&amp;nbsp; System.out.println(task.getId() + " - " + task.getDueDate() + " - " + vars.get("var1") + " - " + vars.get("var2"));&lt;BR /&gt;}&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;But since this is not possible: Is there already another way I could handle my issue?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank You!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 May 2011 08:16:31 GMT</pubDate>
    <dc:creator>maier</dc:creator>
    <dc:date>2011-05-13T08:16:31Z</dc:date>
    <item>
      <title>Select Tasks With Variables In Single Query</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/select-tasks-with-variables-in-single-query/m-p/64383#M40583</link>
      <description>Hi everybody,is there a way to get a list of tasks with its variables in one query? Of course, I can get the required data the following way (example):List&amp;lt;Task&amp;gt; tasks = taskService.createTaskQuery().taskAssignee("mike").list();for (Task task: tasks) {&amp;nbsp; Map&amp;lt;String, Object&amp;gt; vars = taskSer</description>
      <pubDate>Fri, 13 May 2011 08:16:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/select-tasks-with-variables-in-single-query/m-p/64383#M40583</guid>
      <dc:creator>maier</dc:creator>
      <dc:date>2011-05-13T08:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Select Tasks With Variables In Single Query</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/select-tasks-with-variables-in-single-query/m-p/64384#M40584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm afraid this is not possible in one go at the moment, and nothing planned to expose this (would require change of task model API, exposing variables). You can leverage the paging to get a limited list of tasks for which you get the vars in a different query.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can also limit the results based on task-variable values if you want… (tQuery.taskVariariableValueEquals(…))&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 May 2011 09:54:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/select-tasks-with-variables-in-single-query/m-p/64384#M40584</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-05-13T09:54:38Z</dc:date>
    </item>
  </channel>
</rss>

