<?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 Re: Get Previous Task Information in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/get-previous-task-information/m-p/111924#M78754</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I added a sample diagram for the second situation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Which one would be the previous task at User Task 3 according to the historyService&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 May 2012 07:18:11 GMT</pubDate>
    <dc:creator>muratto12</dc:creator>
    <dc:date>2012-05-17T07:18:11Z</dc:date>
    <item>
      <title>Get Previous Task Information</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/get-previous-task-information/m-p/111919#M78749</link>
      <description>Hi,How can I get previous task's Id or Information on a task? (by a execution listener, etc.) Thanks</description>
      <pubDate>Mon, 14 May 2012 05:39:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/get-previous-task-information/m-p/111919#M78749</guid>
      <dc:creator>muratto12</dc:creator>
      <dc:date>2012-05-14T05:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Get Previous Task Information</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/get-previous-task-information/m-p/111920#M78750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, can you elaborate on what exactly you are looking for? You might be looking for the HistoryService.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nils&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2012 08:15:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/get-previous-task-information/m-p/111920#M78750</guid>
      <dc:creator>nils1</dc:creator>
      <dc:date>2012-05-15T08:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: Get Previous Task Information</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/get-previous-task-information/m-p/111921#M78751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Users want to see who completed the previous task.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2012 09:54:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/get-previous-task-information/m-p/111921#M78751</guid>
      <dc:creator>muratto12</dc:creator>
      <dc:date>2012-05-15T09:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Get Previous Task Information</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/get-previous-task-information/m-p/111922#M78752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As Nils said, this can be done via the HistoryService.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Just look in the Javadoc for more details.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2012 14:54:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/get-previous-task-information/m-p/111922#M78752</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2012-05-15T14:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Get Previous Task Information</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/get-previous-task-information/m-p/111923#M78753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll try it with HistoryService. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, how would history service behave in these 2 scenarios.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. a multi instance task as a first step, and a task as a second step&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. two tasks joined at a paralel gateway as a first step, and a task as a second step&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What would be the previous task in these cases.&amp;nbsp; There are not only one previous task in these cases.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2012 16:04:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/get-previous-task-information/m-p/111923#M78753</guid>
      <dc:creator>muratto12</dc:creator>
      <dc:date>2012-05-15T16:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Get Previous Task Information</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/get-previous-task-information/m-p/111924#M78754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I added a sample diagram for the second situation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Which one would be the previous task at User Task 3 according to the historyService&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2012 07:18:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/get-previous-task-information/m-p/111924#M78754</guid>
      <dc:creator>muratto12</dc:creator>
      <dc:date>2012-05-17T07:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Get Previous Task Information</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/get-previous-task-information/m-p/111925#M78755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i think u need to give the HistoryService a hint on what could be the previous task connected to the task where u want to get the information, because a process instance can have many execution paths which do not nessessarily lead to your user task 3.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i use the following to get the task which was cancelled using a timer boundary listener when the sequence flow is taken via a execution listener on the sequence flow:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;@Named&lt;BR /&gt;@Stateless&lt;BR /&gt;public class EscalationListener {&lt;BR /&gt;&lt;BR /&gt; @Inject&lt;BR /&gt; HistoryService historyService;&lt;BR /&gt;&lt;BR /&gt; public void escalate(DelegateExecution execution, String otherTaskId)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; throws Exception {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; HistoricTaskInstance task = historyService&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .createHistoricTaskInstanceQuery()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .processInstanceId(execution.getProcessInstanceId()).&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .taskDefinitionKey(otherTaskId).singleResult();&lt;BR /&gt;&lt;BR /&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; // do some stuff with the task&lt;BR /&gt; }&lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;sequenceFlow id="flow13" name="" sourceRef="boundarytimer1" targetRef="servicetask2"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;extensionElements&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:executionListener event="take" expression="#{escalationListener.escalate(execution, 'usertask2')}"&amp;gt;&amp;lt;/activiti:executionListener&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/extensionElements&amp;gt;&lt;BR /&gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;The task to which the boundary timer is attached to is 'usertask2' and for this i want to get the task instance of the running process instance. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In your case u will need to give all your task ids (usertask1, usertask2, …) to the executionListener expression and within the execution listener u can use the history service to get their task end time with &lt;/SPAN&gt;&lt;EM&gt;task.getEndTime()&lt;/EM&gt;&lt;SPAN&gt; and decide which one u want to work with, e.g. by putting all task instances in a list and use a comparator based on the end date to sort them to your needs…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;hth&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2012 14:59:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/get-previous-task-information/m-p/111925#M78755</guid>
      <dc:creator>chris_joelly</dc:creator>
      <dc:date>2012-05-18T14:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: Get Previous Task Information</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/get-previous-task-information/m-p/111926#M78756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you very much for answers.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2012 04:01:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/get-previous-task-information/m-p/111926#M78756</guid>
      <dc:creator>muratto12</dc:creator>
      <dc:date>2012-05-21T04:01:17Z</dc:date>
    </item>
  </channel>
</rss>

