AnsweredAssumed Answered

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

Question asked by kum9sud on Mar 14, 2016
Latest reply on Mar 30, 2016 by martin.grofcik
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.