<?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: How to trace the path executed to reach an task in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160563#M114529</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;example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;historyService.createHistoricTaskInstanceQuery().processInstanceId(processInstanceId).list();&lt;BR /&gt;&lt;/CODE&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>Wed, 30 Apr 2014 06:23:37 GMT</pubDate>
    <dc:creator>martin_grofcik</dc:creator>
    <dc:date>2014-04-30T06:23:37Z</dc:date>
    <item>
      <title>How to trace the path executed to reach an task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160560#M114526</link>
      <description>Hi allI need to execute some code on an TaskListener that depends on the path used by the process to reach the task.In other words, i need to know the entire trace the current token has done until the moment.If it's not possible, could i add an listerner in a sequence flow ?any kind of help is welco</description>
      <pubDate>Mon, 28 Apr 2014 21:31:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160560#M114526</guid>
      <dc:creator>gualberto</dc:creator>
      <dc:date>2014-04-28T21:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to trace the path executed to reach an task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160561#M114527</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;You could use HistoryService to get path to the current node for the process instance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Another possibility is to set process variable in process instance execution and base decision in the task listener on the value in variable.&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>Tue, 29 Apr 2014 06:22:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160561#M114527</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2014-04-29T06:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to trace the path executed to reach an task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160562#M114528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Martin&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I could not found any query available from the History Service that returns the path information.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you post some example code ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Apr 2014 02:02:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160562#M114528</guid>
      <dc:creator>gualberto</dc:creator>
      <dc:date>2014-04-30T02:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to trace the path executed to reach an task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160563#M114529</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;example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;historyService.createHistoricTaskInstanceQuery().processInstanceId(processInstanceId).list();&lt;BR /&gt;&lt;/CODE&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>Wed, 30 Apr 2014 06:23:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160563#M114529</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2014-04-30T06:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to trace the path executed to reach an task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160564#M114530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Martin&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm really appreciating your help, but after reading the HistoricActivityInstance Javadocs I have not seen how it will help on this case, because it don't exposes any 'getExecutionPath' method (or something like this).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you please elaborate it ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Apr 2014 14:22:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160564#M114530</guid>
      <dc:creator>gualberto</dc:creator>
      <dc:date>2014-04-30T14:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to trace the path executed to reach an task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160565#M114531</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;Working example could be found here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://github.com/Activiti/Activiti/blob/0a353c17ed011a6285be297f0a292a7957bca416/modules/activiti-engine/src/test/java/org/activiti/engine/test/history/HistoricTaskInstanceTest.java" rel="nofollow noopener noreferrer"&gt;https://github.com/Activiti/Activiti/blob/0a353c17ed011a6285be297f0a292a7957bca416/modules/activiti-engine/src/test/java/org/activiti/engine/test/history/HistoricTaskInstanceTest.java&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;e.g. method:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;testHistoricTaskInstanceQuery.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;query:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;historyService.createHistoricTaskInstanceQuery().processInstanceId(processInstanceId).list();&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Returns list of task from the history for the given processInstance. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In the case of parallel paths you have to take process definition into consideration to get execution path.&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>Fri, 02 May 2014 06:11:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160565#M114531</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2014-05-02T06:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to trace the path executed to reach an task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160566#M114532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Martin&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I checked the HistoricTaskInstance example but i have not found anything to help with the transitions, then i tried my luck looking up the source code on Git and found something that worked great to me, see:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import org.activiti.engine.delegate.DelegateExecution;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import org.activiti.engine.delegate.ExecutionListener;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import org.activiti.engine.impl.pvm.delegate.ExecutionListenerExecution;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;public class MyRuntimeListener implements ExecutionListener {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; @Override&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; public void notify(DelegateExecution de) throws Exception {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; System.out.println(((ExecutionListenerExecution)de).getEventSource().getId());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This way i add an ExecutionListener on my transitions and now i can take decisions based on transition's ID.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have seen on docs that we must avoid classes from "impl" package. So how can i get this ID without the "forbidden" ExecutionListenerExecution ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you very much for the help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 May 2014 00:26:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160566#M114532</guid>
      <dc:creator>gualberto</dc:creator>
      <dc:date>2014-05-03T00:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to trace the path executed to reach an task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160567#M114533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Could you use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;org.activiti.engine.delegate.DelegateExecution#getCurrentActivityId&lt;BR /&gt;&lt;/CODE&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Maartin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2014 07:44:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160567#M114533</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2014-05-05T07:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to trace the path executed to reach an task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160568#M114534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Martin&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately, DelegateExecution#getCurrentActivityId does not return the sequence flow id, but the source of it. So, if we have multiple outgoing flows it's impossible know exactly which one was taken.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The solution i found, after read the sources, was the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;public class MyRuntimeListener implements ExecutionListener {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; @Override&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; public void notify(DelegateExecution de) throws Exception {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; System.out.println(((ExecutionListenerExecution)de).getEventSource().getId());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course, i am using "downcasting", what it's wrong, but is there any other way ?&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, 27 May 2014 00:06:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160568#M114534</guid>
      <dc:creator>gualberto</dc:creator>
      <dc:date>2014-05-27T00:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to trace the path executed to reach an task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160569#M114535</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;You are right with the flow recognition. I think listeners are the easiest way.&lt;/SPAN&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>Tue, 27 May 2014 06:53:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160569#M114535</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2014-05-27T06:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to trace the path executed to reach an task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160570#M114536</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;SPAN&gt;System.out.println(((ExecutionListenerExecution)de).getEventSource().getId()) returns id defined in XML.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to return Previous activity's instance ID ( ID generated at runtime ) in current Activity's execution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Sep 2016 13:38:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160570#M114536</guid>
      <dc:creator>piyush_kaizen</dc:creator>
      <dc:date>2016-09-08T13:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to trace the path executed to reach an task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160571#M114537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Piyush,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, use history service.&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>Fri, 09 Sep 2016 07:47:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160571#M114537</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2016-09-09T07:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to trace the path executed to reach an task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160572#M114538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Martin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do u mean I should pickup last activity of that process using HistoryService ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What if I am using Asynchronous Activities ? Then It won't be reliable right ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2016 09:08:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160572#M114538</guid>
      <dc:creator>piyush_kaizen</dc:creator>
      <dc:date>2016-09-09T09:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to trace the path executed to reach an task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160573#M114539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Piyush,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;re: previous activiti Id: all activities can be stored in the event log. You can extend logging as you wish.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In the history service you can use an ordering to sort activities. You can take last, previous…. according to ordering.&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>Mon, 12 Sep 2016 07:07:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-trace-the-path-executed-to-reach-an-task/m-p/160573#M114539</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2016-09-12T07:07:03Z</dc:date>
    </item>
  </channel>
</rss>

