I'm not sure to understand what is the problem that you are trying to solve.
If you have a business process you know which groups/users are assigned to the tasks right?
Then you need to use the task service APIs to query for this tasks depending the user that is logged in to the system right?
From the User Task perspective you usually don't care about which process is requiring the task, you just get all the tasks associated with one user or group.
I am using like that.
ProcessInstance instance = (ProcessInstance) StatefulKnowledgeSession.getProcessInstance(processInstaceId);
WorkflowProcessInstance workflowProcessInstance = (WorkflowProcessInstance) instance;
In this way, you can get dynamic actor value, by giving variableName.
I think, it will be help you.