Since a variable amount of columns can be configured, a list parameter has to be resolved:
As a short reminder the XML configuration of the list parameter fieldList
<?php
...
<field id='fieldDelimiter' name='CONST_SA_CSV_FIELD_DELIMITER' desc='CONST_SA_CSV_FIELD_DELIMITER_DESC' worktable='yes' subtable='no' fixed='yes' datatype='varchar' required='yes'/>
<list id='fieldList' name='CONST_SA_CSV_COLUMN_MAPPING' worktable='no' subtable='yes' fixed='no' datatype='varchar' required='no' udl='yes'/>
...
This allowed us to configure a variable amount of columns for the export in the system activity.

To read the values contained in the subtable row by row, the values of the current row have to be resolved using the configured list. For this the method resolveInputParameterListValues is used:
Resolving data from the subtable and writing it into the CSV file
<?php
class csvSystemActivity extends AbstractSystemActivityAPI
{
...
private $fieldDelimiter;
private $csvFile;
private $csvFilePointer;
protected function exportCsv()
{
$this->debug('exportCsv start');
$this->loadGlobalSettings();
$this->openCsvFile('w');
$this->debug('exportCsv end');
}
protected function loadGlobalSettings()
{
$this->fieldDelimiter = $this->resolveInputParameter('fieldDelimiter');
}
protected function openCsvFile($mode)
{
$this->csvFile = $this->getTempPath() . DIRECTORY_SEPARATOR . 'test.csv';
$this->debug('csvFile: '.$this->csvFile);
$this->csvFilePointer = fopen($this->csvFile, $mode);
$this->debug('executeMethodForSubtable for '. $this->getFixSubtableName());
$this->executeMethodForSubtable('writeSubtableLineIntoFile', $this->getFixSubtableName());
}
protected function writeSubtableLineIntoFile()
{
$this->debug('writeSubtableLineIntoFile for '. $this->getFixSubtableName());
$subtableValues = $this->resolveInputParameterListValues('fieldList');
$csvLine = implode($this->fieldDelimiter, $subtableValues)."\r\n";
fwrite($this->csvFilePointer, $csvLine);
}
}
When we now execute the system activity, the subtable with the configured separator is exported into the file test.csv in the JobRouter temp directory.