<?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 Getting 'current task' and determining its type in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/getting-current-task-and-determining-its-type/m-p/224381#M177511</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;As part of reporting/dashboarding functions in our software, I want to provide a "process instance state" report that can be accessed via REST services that we publish.&amp;nbsp; To that end, I get the "current task" for a process instance:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;taskService.createTaskQuery().processInstanceBusinessKey(processInstance.getBusinessKey()).list().get(0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this approach to getting the current task correct?&amp;nbsp; Let's assume for a moment lack of parallelism as our processes are fairly simple.&amp;nbsp; Can it be assumed that, while a process instance is active, there is always at least one active task that will be returned by this query?&amp;nbsp; If not, what other information should I be fetching about the process instance state that would provide a nice snapshot of what state it is in?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, while the Task object gives me good information, I can't see where to get the "type" of the task (e.g. UserTask, ScriptTask, ServiceTask, etc).&amp;nbsp; Is there such a getter?&amp;nbsp; If not, are there internal class names that I can compare against?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;john&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Aug 2016 12:03:20 GMT</pubDate>
    <dc:creator>jlilley</dc:creator>
    <dc:date>2016-08-24T12:03:20Z</dc:date>
    <item>
      <title>Getting 'current task' and determining its type</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/getting-current-task-and-determining-its-type/m-p/224381#M177511</link>
      <description>As part of reporting/dashboarding functions in our software, I want to provide a "process instance state" report that can be accessed via REST services that we publish.&amp;nbsp; To that end, I get the "current task" for a process instance:taskService.createTaskQuery().processInstanceBusinessKey(processInsta</description>
      <pubDate>Wed, 24 Aug 2016 12:03:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/getting-current-task-and-determining-its-type/m-p/224381#M177511</guid>
      <dc:creator>jlilley</dc:creator>
      <dc:date>2016-08-24T12:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Getting 'current task' and determining its type</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/getting-current-task-and-determining-its-type/m-p/224382#M177512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Can it be assumed that, while a process instance is active, there is always at least one active task that will be returned by this query?&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;yes&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Is there such a getter?&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;Type of the task is stored in the model/definition.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Martin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2016 05:37:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/getting-current-task-and-determining-its-type/m-p/224382#M177512</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2016-08-25T05:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: Getting 'current task' and determining its type</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/getting-current-task-and-determining-its-type/m-p/224383#M177513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hmmm, OK.&amp;nbsp; So how would one find the model, find the task definition, and extract the task type?&amp;nbsp; I realize that I could load the XML directly from its resource and parse it myself.&amp;nbsp; Looking for a shortcut.&amp;nbsp; Do I need to go at it from the Deployment interface?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;john&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2016 12:44:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/getting-current-task-and-determining-its-type/m-p/224383#M177513</guid>
      <dc:creator>jlilley</dc:creator>
      <dc:date>2016-08-25T12:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Getting 'current task' and determining its type</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/getting-current-task-and-determining-its-type/m-p/224384#M177514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;taskService.createTaskQuery() only returns user tasks. You would need to use runtimeService.createExecutionQuery() to get all running executions of a process instance. Every execution has an activityId property and that can be used to retrieve the Bpmn element with all the type info etc. RepositoryService.getBpmnModel gives you the BpmnModel of a process definition id and then you can use bpmnModel.getFlowElement(activityId) to get the specific Bpmn element and with that all its information.&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>Mon, 29 Aug 2016 07:27:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/getting-current-task-and-determining-its-type/m-p/224384#M177514</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2016-08-29T07:27:23Z</dc:date>
    </item>
  </channel>
</rss>

