Skip to content

spec: one document, many recipients - attach: recordPrint and the fan-out scoping rule - #20

Open
delchev wants to merge 1 commit into
mainfrom
spec/record-print
Open

spec: one document, many recipients - attach: recordPrint and the fan-out scoping rule#20
delchev wants to merge 1 commit into
mainfrom
spec/record-print

Conversation

@delchev

@delchev delchev commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Closes the "Planned" entry that named this gap.

forEach + attach: print attaches each row's own document, which is what a per-row document (a payslip) needs. The mirror shape had no syntax: one document sent to many recipients, where the rows ARE the recipients and the attachment belongs to the record they hang off - a request for quotation mailed to each invited supplier, an agenda mailed to each participant.

attach: recordPrint renders the fan-out's anchor record: fan-out-only (outside one, attach: print already renders that record), the anchor is what must satisfy the document requirement, language / languageFrom select ITS render language, and a conforming generator MUST render the document once per fan-out rather than once per recipient.

The section also settles the point the gap entry left open - an explicit scoping rule when both records are addressable: a bare path resolves against the ROW, the reserved prefix record. addresses the anchor (one field of it), the recipient may never be record-scoped, and record. outside a fan-out is rejected. Implicit mixing is how a message quotes the wrong party, and nothing in the rendered text would show it.

Also normative: a forEach on a schedules[].notify or a notifications[] entry MUST be rejected - the first already runs once per matched row, the second is about the event record, so an accepted declaration there changes nothing and sends a different message than the one written down.

Appendix A gains the attach: recordPrint row.

Proven out by the reference implementation: eclipse-dirigible/dirigible#6740.

`forEach` + `attach: print` attaches each row's own document. The mirror
shape - one document to many recipients, where the rows ARE the recipients
and the attachment belongs to the record they hang off - had no syntax.

`attach: recordPrint` renders the fan-out's anchor record, once, for
everybody; the anchor is what must be a document, and its language knobs
select the single render's language.

The accompanying scoping rule settles what the gap entry left open: inside
a fan-out a bare path resolves against the ROW and the reserved `record.`
prefix addresses the anchor (one field of it), the recipient may never be
record-scoped, and `record.` outside a fan-out is rejected.

A `forEach` on a schedules[].notify or a notifications[] entry is rejected
rather than ignored - both already say what they are about, so an accepted
declaration there would silently send a different message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant