cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the finished, pending and upcoming tasks in the workflow at runtime?

kum9sud
Champ in-the-making
Champ in-the-making
We have the following model:
Start -> Service Task -> User Task -> Mail Task -> End
Suppose the current task under execution is User Task, is there a way to get the list of tasks that have been completed before this User Task(Service Task according to our model)
and the upcoming tasks that need to be executed after the completion of this User Task(Mail Task according to our model)
and unfinished tasks(suppose the mail task doesn't get triggered as the user has not completed the task assigned to him).

We have tried using "historyService.createHistoricActivityInstanceQuery().finished().processInstanceId(processid).list();" and "historyService.createHistoricActivityInstanceQuery().unfinished().processInstanceId(processid).list();"
but it fetches the task list only after the process is instantiated and completed and not during runtime.
3 REPLIES 3

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

is there a way to get the list of tasks that have been completed before this User Task(Service Task according to our model)
use http://activiti.org/userguide/index.html#history and HistoryService queries

and the upcoming tasks that need to be executed after the completion of this User Task(Mail Task according to our model)
I see 2 possibilities simulation (crystalball) or you can just simply parse xml file and see the next tasks in the row (BpmnModel stores this information too, you can get it from the repository service)

and unfinished tasks
see previous

Regards
Martin

kum9sud
Champ in-the-making
Champ in-the-making
Hi,

Does the Activiti-CrystalBalll include the Activiti-Explorer? If it does not, how can we integrate the two? And if Activiti-CrystalBall contains Activiti-Explorer, then is there a way we can make use of the Activiti-CrystalBall alone?

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

check the code of the module activiti-crystalball. There are jUnit tests.
You can check some resources in
http://gro-mar.github.io/activiti-crystalball/

Regards
Martin