Accessing root stage

Our case model looks like this:


Through an API call we return information about open tasks. One information is the stage which the task is part of. For this I’m using something like:

cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceId(task.getPropagatedStageInstanceId()).singleResult()

So far so good.

My fist question:
Let’s say “Client Task” is active, then I get back the stage “Client Input”. How can I do it to receive the stage “Data Provision” instead?

My second question:
How can I achieve the same for tasks within the process “Validation”? Meaning to also retrieve stage “Data Provision”.

Happy day,
Sulamith