Hi Jaber,
What's mean 'next task'?
If you mean the task of the next step, I am afraid to say there is no way to do that, because util execution arrival the activity, the related task could be created and be queried.
If you mean the history task, you could use historyService.createHistoryTaskQuery() to do query.
Regards.