Hello,
To access your variables you should use :
/**
* Return the WorkflowProcessInstance associated to a Task
* This instance allow to access the map of variables
* @return WorkflowProcessInstance managed
*/
public WorkflowProcessInstance getWorkflowProcessInstance(long processInstanceId){
return (WorkflowProcessInstance)kSession.getProcessInstance(processInstanceId);
}
kSession is a StatefullKnowledgeSession
then you access your process variable like this : getWorkflowProcessInstance(task.getProcessInstanceId()).getVariable("formObject");
Regards,