I'm converting a flow from straight single thread, to use a batch processor. So, I'm converting most of the flow variables to recordVars. Some questions i can't find in the docs:
You can access recordVars form Java or Groovy component using the following:
import com.mulesoft.module.batch.record.BatchUtils;
...
BatchUtils.getRecord(message).getVariable('myVar');