Skip to content

Result Reports

themarioga edited this page Nov 8, 2026 · 1 revision

Result Reports

An import can write a report per input file and layout, listing the rejected lines, or the rejected and the applied ones.

.resultReport(new ResultReport(ReportMode.REJECTED, FileFormat.CSV,
        LocalDirectoryChannel.of(Path.of("/data/reports")), "{sourceName}_{layout}_result"))
Property Meaning
mode NONE, REJECTED, REJECTED_AND_APPLIED
format CSV, XLSX, JSON or XML
channel A local directory or SFTP channel, with its onExistingFile
namePattern {sourceName} (source name without extension), {layout}, {timestamp:…} and variables

When a report is written

  • Only for a file processed successfully, after its post-success action.
  • One per layout that has at least one line in the report: a JSON file with rejected parents and children gives two reports, one per layout.
  • A report that cannot be delivered is a REPORT_FAILED warning; the file still counts as applied.

While a file is read, report lines are kept as JSON lines in the working directory, so memory does not grow with the number of rejections.

Contents

CSV and XLSX

The raw values of each line, in order of first appearance, then:

Column Content
LINE_NUMBER The line number
RESULT REJECTED or APPLIED
REASON <field>: <message> per error, joined with |
CODES The error codes, joined with ,
nif,sexo,LINE_NUMBER,RESULT,REASON,CODES
1,X,1,REJECTED,sexo: value 'X' has no translation,NO_TRANSLATION
abcdef,X,2,REJECTED,a: value is longer than 5 | b: value 'X' has no translation,"TOO_LONG,NO_TRANSLATION"

Formula injection is neutralized: a value starting with =, +, -, @, a tab or a carriage return is written with a leading ' ('=HYPERLINK(…)).

JSON

[{"LINE_NUMBER": 1, "RESULT": "REJECTED", "REASON": "sexo: value 'X' has no translation",
  "values": {"nif": "1", "sexo": "X"},
  "errors": [{"field": "sexo", "code": "NO_TRANSLATION", "args": {"value": "X"},
              "message": "value 'X' has no translation"}]}]

XML

<report>
  <line number="1" result="REJECTED">
    <reason>sexo: value 'X' has no translation</reason>
    <values><value name="nif">1</value><value name="sexo">X</value></values>
    <errors>
      <error code="NO_TRANSLATION" field="sexo">
        <message>value 'X' has no translation</message>
        <arg name="value">X</arg>
      </error>
    </errors>
  </line>
</report>

JSON and XML reports are not neutralized: they are not opened by spreadsheets.

Clone this wiki locally