<?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: is this posssible to get details of completed  task  using processinstance id? in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/is-this-posssible-to-get-details-of-completed-task-using/m-p/41209#M17286</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;B&gt;Niklas Menke&lt;/B&gt;‌&lt;BR /&gt;Greetings,&lt;BR /&gt;&lt;BR /&gt;Thanks for Quick Response..&lt;BR /&gt;&lt;BR /&gt;currently i getting processinstance id&amp;nbsp; for myuser using below code:&lt;BR /&gt;List&amp;lt;HistoricProcessInstance&amp;gt; historicProcessInstances = this.historyService.createHistoricProcessInstanceQuery().finished().startedBy(userid).list();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for(int i=0;i&amp;lt;historicProcessInstances.size();i++){&lt;/P&gt;&lt;P&gt;List&amp;lt;Task&amp;gt; taskList = this.taskService.createTaskQuery().processInstanceId(historicProcessInstances.get(i).getId()).orderByTaskCreateTime().desc().list();&lt;BR /&gt;for(Task task : taskList){&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;&amp;nbsp;&amp;nbsp; &amp;nbsp;ProcessDefinition processDefinition = this.repositoryService.getProcessDefinition(task.getProcessDefinitionId());&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;&amp;nbsp;&amp;nbsp; &amp;nbsp;TaskResponse taskResponse = new TaskResponse(task);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this code is working if task is pending or not complete with change in &lt;BR /&gt;List&amp;lt;HistoricProcessInstance&amp;gt; historicProcessInstances = this.historyService.createHistoricProcessInstanceQuery().unfinished().startedBy(userid).list();&lt;BR /&gt;&lt;BR /&gt;i replace my code to you suggest code but for completed task not working in my case to get task response.&lt;BR /&gt;in my case i want task response details of that completed task&lt;BR /&gt;Is this Possible to get task response after task completed?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Another question i have for related task response.&lt;BR /&gt;&lt;BR /&gt;after task completed the data stored in task response as do in unfinished task?&lt;BR /&gt;&lt;BR /&gt;or &lt;BR /&gt;&lt;BR /&gt;in future i want to get of details earlier task which is already completed.does this data stored in task response at any place which i can get when i required?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Apr 2017 04:02:52 GMT</pubDate>
    <dc:creator>jigpra</dc:creator>
    <dc:date>2017-04-05T04:02:52Z</dc:date>
    <item>
      <title>is this posssible to get details of completed  task  using processinstance id?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/is-this-posssible-to-get-details-of-completed-task-using/m-p/41207#M17284</link>
      <description>I want to get details of all finished task&amp;nbsp; with the data using process instance id.how can i?is this possible to get request data after completed flow of bpm?</description>
      <pubDate>Tue, 04 Apr 2017 12:18:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/is-this-posssible-to-get-details-of-completed-task-using/m-p/41207#M17284</guid>
      <dc:creator>jigpra</dc:creator>
      <dc:date>2017-04-04T12:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: is this posssible to get details of completed  task  using processinstance id?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/is-this-posssible-to-get-details-of-completed-task-using/m-p/41208#M17285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;have you tried something like this?:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;historyService.createHistoricTaskInstanceQuery()&lt;/P&gt;&lt;P&gt;.finished()&lt;/P&gt;&lt;P&gt;.includeProcessVariables()&lt;/P&gt;&lt;P&gt;.includeTaskLocalVariables()&lt;/P&gt;&lt;P&gt;.processInstanceId(processInstanceId)&lt;/P&gt;&lt;P&gt;.list()&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Apr 2017 12:57:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/is-this-posssible-to-get-details-of-completed-task-using/m-p/41208#M17285</guid>
      <dc:creator>nikmenke</dc:creator>
      <dc:date>2017-04-04T12:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: is this posssible to get details of completed  task  using processinstance id?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/is-this-posssible-to-get-details-of-completed-task-using/m-p/41209#M17286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;B&gt;Niklas Menke&lt;/B&gt;‌&lt;BR /&gt;Greetings,&lt;BR /&gt;&lt;BR /&gt;Thanks for Quick Response..&lt;BR /&gt;&lt;BR /&gt;currently i getting processinstance id&amp;nbsp; for myuser using below code:&lt;BR /&gt;List&amp;lt;HistoricProcessInstance&amp;gt; historicProcessInstances = this.historyService.createHistoricProcessInstanceQuery().finished().startedBy(userid).list();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for(int i=0;i&amp;lt;historicProcessInstances.size();i++){&lt;/P&gt;&lt;P&gt;List&amp;lt;Task&amp;gt; taskList = this.taskService.createTaskQuery().processInstanceId(historicProcessInstances.get(i).getId()).orderByTaskCreateTime().desc().list();&lt;BR /&gt;for(Task task : taskList){&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;&amp;nbsp;&amp;nbsp; &amp;nbsp;ProcessDefinition processDefinition = this.repositoryService.getProcessDefinition(task.getProcessDefinitionId());&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;&amp;nbsp;&amp;nbsp; &amp;nbsp;TaskResponse taskResponse = new TaskResponse(task);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this code is working if task is pending or not complete with change in &lt;BR /&gt;List&amp;lt;HistoricProcessInstance&amp;gt; historicProcessInstances = this.historyService.createHistoricProcessInstanceQuery().unfinished().startedBy(userid).list();&lt;BR /&gt;&lt;BR /&gt;i replace my code to you suggest code but for completed task not working in my case to get task response.&lt;BR /&gt;in my case i want task response details of that completed task&lt;BR /&gt;Is this Possible to get task response after task completed?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Another question i have for related task response.&lt;BR /&gt;&lt;BR /&gt;after task completed the data stored in task response as do in unfinished task?&lt;BR /&gt;&lt;BR /&gt;or &lt;BR /&gt;&lt;BR /&gt;in future i want to get of details earlier task which is already completed.does this data stored in task response at any place which i can get when i required?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Apr 2017 04:02:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/is-this-posssible-to-get-details-of-completed-task-using/m-p/41209#M17286</guid>
      <dc:creator>jigpra</dc:creator>
      <dc:date>2017-04-05T04:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: is this posssible to get details of completed  task  using processinstance id?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/is-this-posssible-to-get-details-of-completed-task-using/m-p/41210#M17287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;B&gt;jigar Prajapati&lt;/B&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;I want to get details of all finished task&amp;nbsp; with the data using process instance id.&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;What kind of data do you want to retrieve from completed tasks? If possible, could you please describe your business use case more?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, Activiti provide History features which allow you to retrieve completed tasks details. Please have a look at the documentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- REST API for HistoricDetail: &lt;A class="link-titled" href="https://www.activiti.org/userguide/#restHistoricDetailGet" title="https://www.activiti.org/userguide/#restHistoricDetailGet" rel="nofollow noopener noreferrer"&gt;Activiti User Guide&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Java: &lt;A class="link-titled" href="https://www.activiti.org/userguide/#historyQueryDetail" title="https://www.activiti.org/userguide/#historyQueryDetail" rel="nofollow noopener noreferrer"&gt;Activiti User Guide&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Thong&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Apr 2017 06:27:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/is-this-posssible-to-get-details-of-completed-task-using/m-p/41210#M17287</guid>
      <dc:creator>thuynh</dc:creator>
      <dc:date>2017-04-05T06:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: is this posssible to get details of completed  task  using processinstance id?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/is-this-posssible-to-get-details-of-completed-task-using/m-p/41211#M17288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;everytime you work with finished tasks or processinstances you have to query the history. So It is the HistoricTaskInstanceResponse you would need. In the history are all variables, all tasks and all process instances stored. For both, running and completed instances and tasks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;for(int i=0;i&amp;lt;historicProcessInstances.size();i++){&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;List&amp;lt;HistoricTaskInstance&amp;gt; taskList = this.historyService.createHistoricTaskInstanceQuery().processInstanceId(historicProcessInstances.get(i).getId()).orderByTaskCreateTime().desc().list();&lt;BR /&gt;for(HistoricTaskInstance task : taskList){&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;&amp;nbsp;&amp;nbsp; &amp;nbsp;ProcessDefinition processDefinition = this.repositoryService.getProcessDefinition(task.getProcessDefinitionId());&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; HistoricTaskInstanceRespone taskResponse = new TaskResponse();&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;taskResponse.setId(task.getId());&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&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;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;}&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;}&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;But if you are working with rest why don't you just use following call to get the historic tasks?&lt;/P&gt;&lt;PRE style="color: black; background: #eeeeee; border: 1px dashed #666666; padding: 1.25em 1.5625em 1.125em;"&gt;GET history/historic-task-instances&lt;/PRE&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;Hope this helps,&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;Niklas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Apr 2017 07:25:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/is-this-posssible-to-get-details-of-completed-task-using/m-p/41211#M17288</guid>
      <dc:creator>nikmenke</dc:creator>
      <dc:date>2017-04-05T07:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: is this posssible to get details of completed  task  using processinstance id?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/is-this-posssible-to-get-details-of-completed-task-using/m-p/41212#M17289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A __default_attr="165382" __jive_macro_name="user" _jive_internal="true" data-id="165382" data-objecttype="3" data-type="person" href="https://community.alfresco.com/people/nikmenke" rel="nofollow noopener noreferrer"&gt;&lt;/A&gt;‌&amp;nbsp; and &lt;A __default_attr="164357" __jive_macro_name="user" _jive_internal="true" data-id="164357" data-objecttype="3" data-type="person" href="https://community.alfresco.com/people/thuynh" rel="nofollow noopener noreferrer"&gt;&lt;/A&gt; &lt;BR /&gt;I use your code to get details of that task/request which is completed.&lt;BR /&gt;but unfortunately my further process is to get details of task using process instance id.&lt;BR /&gt;i think when workflow completed the task response for that process id will deleted &lt;BR /&gt;and currently i want&amp;nbsp; to get task response of completed task.&lt;BR /&gt;your code retrieve the information for historicalinsstance but in further&amp;nbsp; i use&amp;nbsp; that historical instance id to get task details using taskservice when task is completed .&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;here is following screenshot of my localhost with postman&lt;BR /&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://connect.hyland.com/legacyfs/online/alfresco/13207_alfresco1.png" style="width: 620px; height: 326px;" /&gt;&lt;IMG alt="when request completed /end event complted" class="image-2 jive-image j-img-original" src="https://connect.hyland.com/legacyfs/online/alfresco/13211_alfresco2.png" style="width: 620px; height: 331px;" /&gt;&lt;BR /&gt;&lt;BR /&gt;in above screen shot i use above method which i discussed earlier in reply&lt;BR /&gt;the data is in proper manner as string for my output&lt;BR /&gt;i retrieve this info using taskservice and processinsatnce id&lt;BR /&gt;if task is completed (ended) then retrieve me null task&lt;BR /&gt;else retrieve me data of that task.&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Apr 2017 07:51:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/is-this-posssible-to-get-details-of-completed-task-using/m-p/41212#M17289</guid>
      <dc:creator>jigpra</dc:creator>
      <dc:date>2017-04-05T07:51:54Z</dc:date>
    </item>
  </channel>
</rss>

