Fetching task name from active process instances

You have to parse the Bpmn XML or use the model api to get the sequence flows / flow nodes that are leaving the task. But you will have to add logic handling for things like gateways and subsequent non human tasks that are in between the current task and subsequent user task.

Search the forums for info on determine the next task such as Get / Preview next task