Thank you for your response.
I think, I can get the process scoped variables somehow like:
ksession.getProcessInstance(selectedTask.getProcessInstanceId())).getVariable("payload");
But how can I get variables in a different scope?
I see, I can define variables with e.g. task scope in the designer, but how to access them? I think I could use that for my external form rendering. Means I read a task-scoped variable 'formName' to decide, which JSF page is associated with the current task.
I don't want to use REST for that.
Regards