feat(intent): generateSnapshot delegate — render + store a document copy on issue#6377
Merged
Conversation
…rd copies A sibling of function: Attachment (#6371) for SYSTEM-GENERATED copies (e.g. the printed invoice stored on issue) rather than user-uploaded files. Same composition-child + CMS + file-metadata machinery, but read-only and versioned. - IntentParser: `snapshot` added to ENTITY_FUNCTIONS. - EntityIntent: isSnapshot() + isFileChild() (attachment or snapshot — shared injection). - EdmIntentGenerator: a file-child gets the injected metadata columns + synthesized Id + audit (now keyed on isFileChild). A Snapshot additionally gets a read-only, major `Version` column carrying the new DOCUMENT_VERSION widget (the copy's sequence within its master, for special treatment in forms/print), and is marked attachmentReadOnly="true" alongside attachmentEntity. - EntityController template: the `/upload` verb is gated off when attachmentReadOnly — a Snapshot controller exposes download + list only (no upload; copies are created server-side by the forthcoming generateSnapshot serviceTask). The read-only Harmonia Files panel (#6373) already keys on attachmentReadOnly (download only, no upload/remove). Verified: EdmIntentGeneratorTest (metadata + Id + Version/DOCUMENT_VERSION + attachmentReadOnly); a generated CompanySnapshotController has @get /{id}/download and NO @post /upload, and the model carries Version(DOCUMENT_VERSION) + attachmentReadOnly=true. Part A of the Sales-Invoice snapshot flow. Follow-ups: C (server-side print render) and D (generateSnapshot BPM serviceTask + delegate, mint on issue). Depends on #6371. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…opy on issue
Part D of the Sales-Invoice snapshot flow: generates the JavaDelegate a process wires as a
`delegate:` service task to mint an immutable printed copy of a document on issue (the number
stays across amendments; only the snapshot Version increments).
- SnapshotSupport builds the `snapshots` glue collection — one descriptor per function: Snapshot
child of a DOCUMENT master (which has a PrintFeeder to render from): master, master PK (the
process variable), the snapshot entity/perspective/master-FK, language.
- GlueIntentGenerator emits the `snapshots` collection into the .glue.
- generateUtils adds the `snapshots` case (sanitizes the perspective → javaPerspective, its own loop
like printFeeders/settlements).
- Snapshot.java.template generates gen/events/<Master>SnapshotGenerator.java: reads the master id
from the process variable, reuses the master's generated PrintFeeder (same gen.events package) for
the {document, items} payload, renders server-side via sdk.print.Print (#6376), stores the PDF via
sdk.cms.Attachments (#6370), and writes a <Snapshot> row with Version = max existing + 1 (gap-free
— snapshots are immutable). Bound by the BPMN via the existing `delegate:` (flowable:class) path —
no new parser/BPMN wiring, and ServiceTaskHandlerGenerator already skips a delegate: task.
Verified: on the SalesInvoice document master with a function: Snapshot child + a `generateSnapshot`
delegate step, the .glue carries the snapshots descriptor, gen/events/SalesInvoiceSnapshotGenerator
.java is emitted, and it compiles cleanly into the client bean container (538 beans, no javac errors).
Depends on: #6374 (function: Snapshot type — the PR base), #6376 (sdk.print.Print), #6371/#6370
(sdk.cms.Attachments). Follow-up: KF adoption wires generateSnapshot into the SalesInvoice process
after markIssued + the Confirm/Amend loop; a full process-run e2e mints the first snapshot on issue.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
delchev
force-pushed
the
feat/intent-snapshot-generate
branch
from
July 22, 2026 12:11
3e27ad3 to
c2fbf22
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Part D of the Sales-Invoice snapshot flow: generates the
JavaDelegatea process wires as adelegate:service task to mint an immutable printed copy of a document on issue. The number stays across amendments — only the snapshot Version increments.Changes
SnapshotSupportbuilds thesnapshotsglue collection — one descriptor perfunction: Snapshotchild of a document master (which has aPrintFeederto render from): master, master PK (the process variable), the snapshot entity / perspective / master-FK, language.GlueIntentGeneratoremitssnapshotsinto the.glue.generateUtilsadds thesnapshotscase (sanitizesperspective → javaPerspective, its own loop likeprintFeeders/settlements).Snapshot.java.templategeneratesgen/events/<Master>SnapshotGenerator.java: reads the master id from the process variable, reuses the master's generatedPrintFeeder(samegen.eventspackage) for the{document, items}payload, renders server-side viasdk.print.Print(feat(document): server-side print rendering (sdk.print.Print + PrintFacade) #6376), stores the PDF viasdk.cms.Attachments(feat(cms): Attachments SDK helper + facade (record file attachments, PR-1) #6370), and writes a<Snapshot>row withVersion = max existing + 1(gap-free — snapshots are immutable). Bound by the BPMN via the existingdelegate:(flowable:class) path — no new parser/BPMN wiring, andServiceTaskHandlerGeneratoralready skips adelegate:task.Verified
On the
SalesInvoicedocument master with afunction: Snapshotchild + agenerateSnapshotdelegate step: the.gluecarries the snapshots descriptor,gen/events/SalesInvoiceSnapshotGenerator.javais emitted, and it compiles cleanly into the client bean container (538 beans, no javac errors). All delegate references resolve (PrintFeeder,Print.render,Attachments.store, the snapshot entity/repo).Depends on
function: Snapshottype — PR base), feat(document): server-side print rendering (sdk.print.Print + PrintFacade) #6376 (sdk.print.Print), feat(intent): function: Attachment — file-attachment composition child (end-to-end) #6371/feat(cms): Attachments SDK helper + facade (record file attachments, PR-1) #6370 (sdk.cms.Attachments).Follow-up: KF adoption wires
generateSnapshotinto the SalesInvoice process (aftermarkIssued) + the Confirm/Amend loop; a full process-run e2e mints the first snapshot on issue. Pairs with first-class document numbering (kf-catalog UPSTREAM_PLAN #11a) for the number-stays/version-increments guarantee.🤖 Generated with Claude Code