<?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 Strange results with HistoricTaskInstanceQuery in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/strange-results-with-historictaskinstancequery/m-p/96668#M66450</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So here is what I'm trying to do:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to have a list of all tasks, which the current logged-in user has been assigned to in any unfinished process instance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So my query looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;HistoryService historyService = ProcessEngines.getDefaultProcessEngine().getHistoryService();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;String userId = ExplorerApp.get().getLoggedInUser().getId();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;List&amp;lt;HistoricTaskInstance&amp;gt; alreadyClaimedTasks = &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;historyService.createHistoricTaskInstanceQuery().processUnfinished().taskAssignee(userId).list();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The query is nested in the ClaimTaskClickListener, and it gets called before the task is assigned, so I can stop the assignment if I want to, because one of the already claimed tasks is connected to the current task. I need this to implement a Separaton of Duty between Tasks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I test this with a small process consisting of 4 user tasks it shows some strange behaviour. If I assign the first task, it gets added properly to the list. On assigning any additional task, the first task gets added again instead of the new task.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;To view the content of the list I use tomcat console outputs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been searching my code for an error quite some time now and haven't found a solution, so I hope you can help me out!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Matthias&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Aug 2012 15:05:11 GMT</pubDate>
    <dc:creator>matthias1</dc:creator>
    <dc:date>2012-08-20T15:05:11Z</dc:date>
    <item>
      <title>Strange results with HistoricTaskInstanceQuery</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/strange-results-with-historictaskinstancequery/m-p/96668#M66450</link>
      <description>Hey !So here is what I'm trying to do:I want to have a list of all tasks, which the current logged-in user has been assigned to in any unfinished process instance.So my query looks like this:HistoryService historyService = ProcessEngines.getDefaultProcessEngine().getHistoryService();String userId =</description>
      <pubDate>Mon, 20 Aug 2012 15:05:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/strange-results-with-historictaskinstancequery/m-p/96668#M66450</guid>
      <dc:creator>matthias1</dc:creator>
      <dc:date>2012-08-20T15:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Strange results with HistoricTaskInstanceQuery</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/strange-results-with-historictaskinstancequery/m-p/96669#M66451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since my post has no answers yet, I will try to specify the issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think the strange behaviour I described is connected to the fact, that my historyService, taskService, etc. are called from within a java ServiceLoader at runtime.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just tried a query like this: taskService.getTastEvents(taskId), while looking at the database and the output of the query at the same time. I was triggering events and while the database had for example 5 items listed, my query only showed 2 of those…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I'd like to know how and when the xxService parts get updated data from the database.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Matthias&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 14:08:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/strange-results-with-historictaskinstancequery/m-p/96669#M66451</guid>
      <dc:creator>matthias1</dc:creator>
      <dc:date>2012-08-23T14:08:37Z</dc:date>
    </item>
  </channel>
</rss>

