Sorry, I thought you needed human tasks. Anyway, it is the same, inputs and outputs from tasks, that I described.
You can check in this process how process variables are used in the bpmn file:
https://github.com/calcacuervo/HumanTaskExamples/blob/master/human-task-web-ui-example/human-tasks-server-management/src/main/resources/process/jbpm5/humanTask.bpmn
In case it is not a human task, I imagine you will have your own WorkItemHandlers, right?
Then, to get the input, something like this should work:
workItem.getParameter("personInput");
Then modify it,
...
And then complete the task with
Map<String, Object> output;
output.put("personOutput")
manager.completeWorkItem(workItem.getId(), );