<?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: find task id by process instance in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/find-task-id-by-process-instance/m-p/22392#M9807</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, obviously you are new to Activiti and workflow in general.&lt;BR /&gt;You are not directly creating a task, rather, you are creating a process instance based on the workflow definition&amp;nbsp;&lt;SPAN style="color: #666666; background-color: #ffffff;"&gt;ApplicationConstants.POST_APPROVAL_WORKFLOW_NAME.&lt;BR /&gt;&lt;BR /&gt;This process instance may include user tasks which show up over time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; background-color: #ffffff;"&gt;To retrieve all current tasks for a given process instance you can use the TaskService to retrieve the tasks from the process instance ID returned by your start command.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; background-color: #ffffff;"&gt;Once you have the process Instance:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit;"&gt;List&amp;lt;Task&amp;gt; tasks = taskService.createTaskQuery().processInstanceId(pid).list()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="color: #666666; background-color: #ffffff;"&gt;This will return a list of tasks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; background-color: #ffffff;"&gt;More details can be found in the Java API &lt;A href="https://www.activiti.org/javadocs/org/activiti/engine/TaskService.html" rel="nofollow noopener noreferrer"&gt;here&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; background-color: #ffffff;"&gt;Cheers,&lt;BR /&gt;greg&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; background-color: #ffffff;"&gt;bp3‌&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Mar 2017 13:50:23 GMT</pubDate>
    <dc:creator>gdharley</dc:creator>
    <dc:date>2017-03-01T13:50:23Z</dc:date>
    <item>
      <title>find task id by process instance</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/find-task-id-by-process-instance/m-p/22391#M9806</link>
      <description>I'm creating a task like this,ProcessInstance processInstance = runtimeService .startProcessInstanceByKey(ApplicationConstants.POST_APPROVAL_WORKFLOW_NAME, variablesMap);I want to assign the owner for this, how can I do it.If not, is it possible to find taskId from this then I can use taskService.se</description>
      <pubDate>Wed, 01 Mar 2017 04:28:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/find-task-id-by-process-instance/m-p/22391#M9806</guid>
      <dc:creator>goutham_pn</dc:creator>
      <dc:date>2017-03-01T04:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: find task id by process instance</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/find-task-id-by-process-instance/m-p/22392#M9807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, obviously you are new to Activiti and workflow in general.&lt;BR /&gt;You are not directly creating a task, rather, you are creating a process instance based on the workflow definition&amp;nbsp;&lt;SPAN style="color: #666666; background-color: #ffffff;"&gt;ApplicationConstants.POST_APPROVAL_WORKFLOW_NAME.&lt;BR /&gt;&lt;BR /&gt;This process instance may include user tasks which show up over time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; background-color: #ffffff;"&gt;To retrieve all current tasks for a given process instance you can use the TaskService to retrieve the tasks from the process instance ID returned by your start command.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; background-color: #ffffff;"&gt;Once you have the process Instance:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit;"&gt;List&amp;lt;Task&amp;gt; tasks = taskService.createTaskQuery().processInstanceId(pid).list()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="color: #666666; background-color: #ffffff;"&gt;This will return a list of tasks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; background-color: #ffffff;"&gt;More details can be found in the Java API &lt;A href="https://www.activiti.org/javadocs/org/activiti/engine/TaskService.html" rel="nofollow noopener noreferrer"&gt;here&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; background-color: #ffffff;"&gt;Cheers,&lt;BR /&gt;greg&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; background-color: #ffffff;"&gt;bp3‌&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Mar 2017 13:50:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/find-task-id-by-process-instance/m-p/22392#M9807</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-03-01T13:50:23Z</dc:date>
    </item>
  </channel>
</rss>

