Watched Folders
The Watched folders page lets NomaUBL fetch source documents straight from directories — typically the network share where JD Edwards drops its report outputs — instead of waiting for files to be pushed into the input folder. Each run lists the configured folders, keeps the new files, converts PDFs to XML in parallel (XML and UBL files are copied as is) into the document template's input folder, then runs one batch per template — the single-JVM batch for an XML or PDF template, the per-file loop for a UBL template.
Open it from the sidebar under Sync → Watched folders; Save and Refresh sit in the page header. The configuration ships empty: nothing runs until a folder is configured and a job is scheduled.
At a glance
Folders
Each watched folder is a collapsible card: its header shows the number, the directory and a one-line summary; click it to open the fields, × removes the folder, + Add folder appends one. Parallel conversions (default 4), above the cards, sets how many PDFs are converted at once; the batch itself keeps its own thread pool.
Folder
| Field | Description |
|---|---|
| Directory | The folder to scan — a mounted share or a local folder (e.g. /data/mnt/jde_outputs); %APP_HOME% / %ENV% accepted. When it is the template's own input folder, the row is a plain batch trigger — see Input folder mode. |
| Pattern | File-name glob of the files to pick up (e.g. R42565_*). Defaults to *.xml on the template's input folder. |
| Template | The document template the files are processed with — XML, PDF and UBL templates are all supported. |
| Manifest | JD Edwards PDF only: optional pdf2xml manifest (a JDE-native XML sample). Blank = DD-alias mode. |
Scan
| Field | Description |
|---|---|
| Window | Since last scan (default): files newer than the last scan minus the overlap. All files: every matching file whatever its date, with no watermark — the check against already processed files alone prevents a second run. |
| Overlap (hours) | Since last scan only — rescan window below the last scan (default 2); a failed file is retried while it stays inside it. |
| Last scan | Since last scan only — the watermark written by every run (UTC instant). Clear it or type a date (yyyy-MM-dd, yyyy-MM-ddTHH:mm:ss in server time, or an ISO instant) to rescan from that point; a first scan without one takes only the overlap. |
| Require mount | When ticked, the directory must be a mounted share — an unmounted mount point is reported instead of being read as empty. |
Batch
The options of the template's batch, as on a scheduled Directory job:
| Field | Description |
|---|---|
| Replace | Replace mode: a file already processed is taken again. Avoid it with All files unless the files are removed after processing. |
| Send to PA | Template settings (default), Y – Force (UBL templates) or N – Skip. |
| Mode | Processing mode of an XML batch: AUTO (default, resolved per document), SINGLE, BURST or UBL. |
Folders feeding the same template must carry the same batch options: the first row wins, and a mismatch is logged.
How a run works
- List — every folder is listed for files matching its pattern — newer than last scan − overlap, or all of them with All files. A folder scanned for the first time, without a date, only takes the overlap window — use a backfill date for history.
- Filter — files already processed (source file name found in the archive) or already waiting as XML in the template's input folder are dropped, unless the folder is in replace mode.
- Convert — PDFs are converted to XML in parallel into the template's input folder; XML and UBL files are copied as is. For a PDF-source template, any text PDF goes through the template's PDF extraction settings instead of the JD Edwards converter.
- Process — once every conversion is done, one batch runs per template: the single-JVM batch for an XML or PDF template, with the batch's own parallelism; the per-file loop for a UBL template, failed files being moved to the errors folder.
The last-scan date advances on every run. A file that fails is retried while it stays inside the overlap window and reported by name — it never blocks the others: inside a batch, a file that fails is marked failed and moved to the errors folder while the other files finish.
One batch at a time. A template's batch locks its input folder for its whole duration, so a second batch cannot start on the same files. A manual or scheduled scan that finds the folder locked still converts the new files, leaves the batch to the running one and says so in its log.
Input folder mode
A folder whose Directory is the template's own input folder is a plain batch trigger: no copy, no date, no check against processed files — the batch takes what the folder holds. It is the watched-folder form of a scheduled Directory job.
Run now
The Run now group runs the saved configuration on demand:
- Dry run — only lists what would be converted and processed.
- Scan and process — runs the full pickup in the background: the run's log shows live under the buttons, so the page never waits on a request that outlives the proxy timeout.
- An optional backfill date widens every folder's window for this run only.
Scheduling and command line
- Scheduled — under global → Scheduling → Batch Document Processing, add a batch job with the source Watched folders, every N minutes or daily at a fixed time. The job can target a single folder (picked from the configured directories) or all of them. The Directory and BIP sources remain available.
- Command line —
nomaubl.sh watch-folders <env> [--folder N] [--since <date>] [--dry-run] [--no-process]. - API —
POST /api/watch-folders/run.
Tips & best practices
- Keep the overlap larger than the copy time. A file still being written when the scan passes is picked up on the next run as long as it stays inside the window.
- Tick Require mount on network shares. An unmounted share otherwise looks like an empty folder and nothing is processed, silently.
- Start with a dry run. It shows exactly which files a new folder would pick up before anything is converted.
- Give one template one set of batch options. Two folders feeding the same template with different options are processed with the first row's options.