Skip to main content

Process Document

The Process Document screen is the single processing entry point of NomaUBL. It runs one document template against one (or many) source files and:

  1. resolves the template's source property (XML or UBL);
  2. dispatches to the matching pipeline — XSL transform for XML spools, direct validation for already-formed UBL invoices;
  3. validates against XSD + Schematron, persists to the database, and (depending on the Send to PA option) submits to the Plateforme Agréée or stops at a local-only status.

The Process XML and Process UBL pages of earlier releases are gone — the form below switches its controls to match the template you pick. One page, one REST route (POST /api/process), one CLI flag (-process).

The page applies regardless of source system — JD Edwards, SAP, NetSuite or a custom ERP.


Picking the source

The first decision a document template makes is its Source. It is set on the Documents → Document tab → Source field and read here:

SourceWhen to pick itWhat runs
XMLXML spool from any ERP needing transformation to UBL. JDE BIP output, SAP IDoc-derived XML, NetSuite saved-search XML, custom ERP exports.XSL transform → UBL 2.1 → XSD + Schematron → DB → optional PA submit. The page exposes the Mode selector (AUTO / SINGLE / BURST / UBL) and the Send to PA toggle.
UBLThe file is already a UBL 2.1 invoice (your ERP emits UBL natively, or the file came from an upstream PA in UBL form).Parse the invoice, extract (doc, dct, kco) from cbc:ID, validate, persist, optionally submit. The page exposes a Validate only mode and a Send to PA toggle.

Once the template is selected, the Source field on the form shows the resolved value and the rest of the form reconfigures itself.


Pipeline at a glance

📄 Source filepicked or uploaded⚙ template.sourcedecision⚙ XML pipelineXSL → UBL · AUTO / SINGLE / BURST / UBL⚙ UBL pipelineparse cbc:ID · validate · persistXMLUBL✅ ValidateXSD + Schematron💾 DB persistF564231 + UHTMPL = template📡 Plateforme AgrééeUse settings · Force send🏠 Local 99XXSkip sendingsendskip

replaceMode = Y purges the five UBL tables (F564231 / F564233 / F564234 / F564235 / F564236) for the matching (doc, dct, kco) triplet before reprocessing — same semantics on the XML and UBL paths.


The form

The form has four common controls plus per-source extras.

FieldSourceDescription
TemplatebothDocument template (the resource type document). The selector lists every template in config-documents.json.
SourcebothRead-only display of the template's resolved source. Switching templates updates this field and reshapes the form.
Select FilebothTwo buttons — Upload File (browser file picker) or Browse Server (open the embedded file browser against dirInput). XML uploads are copied to the template's working directory; UBL uploads land in <dirInput>/ubl/.
ModeXMLAUTO (default), SINGLE, BURST or UBL. See Modes (XML source) below.
Send to PAXMLUse settings (default) or Skip sending.
ModeUBLProcess & Validate (default) or Validate only.
Send to PAUBLUse settings, Force send or Skip sending. Force send is the UBL-only override that bypasses the e-invoicing template's sendToPA flag.
ReplacebothSkip keeps existing rows untouched; Overwrite purges the five UBL tables for the same (doc, dct, kco) and re-imports cleanly.

Modes (XML source)

ModeOutputTypical use
AUTOPDF or UBLResolves the per-document mode from UBL Defaults → Document Type / BAR Routing. Recommended default in production — handy when a single XML spool mixes invoices (resolved to UBL) and non-invoice documents (resolved to SINGLE / BURST).
SINGLEPDFRenders the entire XML spool as a single PDF. Useful for non-invoice documents that need PDF formatting only.
BURSTPDF + XML indexBursts the source spool on a key (typical of multi-document spools), produces one PDF per key value and an XML index file describing the resulting set. The index is consumed by downstream applications that need to dispatch each output independently.
UBLUBL 2.1 + PDFRuns the document XSL to UBL 2.1, validates, persists, and (per Send to PA) submits. Recommended explicit setting once AUTO's routing has been validated for a template.

AUTO is not its own pipeline — it dispatches each document of the source XML to SINGLE, BURST or UBL according to Document Types. Only the UBL branch chains validation, persistence and PA submission; SINGLE / BURST produce PDF output and stop there.


Modes (UBL source)

ModeWhat runs
Process & Validate (default)Parse the UBL invoice, extract (doc, dct, kco) from cbc:ID (regex on the template), validate XSD + Schematron, persist to F564231 / F564233 / F564234 / F564235 / F564236, write the lifecycle event. Send to PA applies.
Validate onlyRun XSD + Schematron only. No DB write, no PA submission. The result table shows every error with severity / source / rule / message — same columns as the Integration Errors page. Use it as a quick check before committing the file to the database.

No more filename convention. UBL processing always derives (doc, dct, kco) from the invoice's cbc:ID via the template's idPattern regex. The DOC_DCT_KCO_ubl.xml naming convention is no longer required — filenames can be anything.


REST API

POST /api/process
Content-Type: application/json

{
"template": "invoices",
"file": "/path/to/file.xml",
"mode": "AUTO", // XML source
"validateOnly": false, // UBL source
"sendToPA": "", // UBL: "" | "Y" | "N"
"noSend": false, // XML: skip submit
"replaceMode": false // both: purge before re-insert
}

The route replaces the legacy /api/run (XML) and /api/process-ubl (UBL) endpoints, and the response is streamed as a series of log events plus a final outcome marker — same shape on both sides, so a single client integration covers both pipelines.


CLI

nomaubl.sh process <config.json> <template> <fileOrDir> [type] [flags]

Replaces the legacy -xml and -ubl flags. The CLI reads the template's source from config-documents.json and dispatches to the matching pipeline. See Command Line for the full flag set.


Tips & best practices

  • Pick the right source on the template, not at run time. Source lives on the document template — the Process Document form just reads it. Setting it once in Documents keeps every entry point (this page, Fetch Input, the CLI, the scheduler) consistent.
  • Use Validate only before persisting. When importing UBL files from a new upstream system, run Validate only first to surface XSD / Schematron failures without polluting the database.
  • AUTO for production, explicit for debugging. Production templates usually want AUTO so the document-types table drives the per-row dispatch. When debugging a single template, switch to the explicit UBL mode so the trace is unambiguous.
  • Replace = Overwrite purges five tables. Header (F564231), lines (F564233), VAT (F564234), lifecycle (F564235) and validation errors (F564236) — the previous run's lifecycle and errors won't bleed into the new run.
  • For batch unattended runs, prefer Sync → Fetch Input. This page is the right tool for ad-hoc one-document or one-spool runs. Fetch Input iterates the same pipeline on multiple files at once with the per-template config baked in.