you usually build your task lists oriented interfaces using the user that is logged to retrieve his/her tasks. Why do you want to query the task generated by a process instance?
Can you elaborate on your business case?
I have several executing instances of a process X (for instance, 4 executing instances).
When I invoke 'taskClient.getTasksAssignedAsPotentialOwner("john",...)', I get assigned tasks for 'john' in all different running instances. However, I am interesting to retrieve only john's tasks in instance id=3.
I know, that's the idea, but if you create a task list john will see all his tasks and he will be able to choose in which task to work. If you want to know from the history logs which process create each task you have the Task.TaskData.workItemId reference that helps you to find the process where that task instance was created. Notice that there is a named query defined for that reason:
t.taskData.workItemId = :workItemId
<!-- hint name="org.hibernate.timeout" value="200"/ -->