cancel
Showing results for 
Search instead for 
Did you mean: 

How to trace the path executed to reach an task

gualberto
Champ in-the-making
Champ in-the-making
Hi all

I 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 welcome

best regards
13 REPLIES 13

piyush_kaizen
Champ in-the-making
Champ in-the-making
Hi,
System.out.println(((ExecutionListenerExecution)de).getEventSource().getId()) returns id defined in XML.
Is there a way to return Previous activity's instance ID ( ID generated at runtime ) in current Activity's execution.

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Piyush,

Yes, use history service.

Regards
Martin

piyush_kaizen
Champ in-the-making
Champ in-the-making
Thanks Martin,
Do u mean I should pickup last activity of that process using HistoryService ?
What if I am using Asynchronous Activities ? Then It won't be reliable right ?

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Piyush,

re: previous activiti Id: all activities can be stored in the event log. You can extend logging as you wish.
In the history service you can use an ordering to sort activities. You can take last, previous…. according to ordering.

Regards
Martin