How to get upcoming tasks

how to get upcoming usertask(tasks which we want to go next) which are target references from any usertask or exclusive gateways.

Suppose My BPMN XML is like below:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

repositoryService.getBpmnModel will allow you to get that information.