feat(intent): posts: stage 2 - handler template + resolver/renderer#6406
Merged
Conversation
… wiring
Builds the posts: handler on the proven postings skeleton (flattened - no header doc):
- buildPosts now resolves the full descriptor: trigger (event: `create` | numeric status seed id ->
-created/-transitioned topic + status guard), the composition-child coordinates for forEach
(itemsEntity/Fk/perspective), target coordinates, the idempotency back-reference, and the rendered
set: assignments.
- postSetExpr renders each set: value to Java over source/item: item copy (item.X), null-safe
negation (-item.X), source copy (source.X), integer constant, quoted string.
- Posts.java.template: a MessageHandler on the source's -transitioned/-created topic that, idempotent
by the back-reference, emits one target row per forEach item (or one per source) through the target
repository. Registered in the events template.js (collection: posts) + a generateUtils.js
`case "posts"` mapping/sanitizing the glue -> template params.
- glue.put("posts", ...) wires it into the .glue output.
Verified: engine-intent 217/217; GluePostsTest asserts the resolved descriptor (status guard id 2 ->
Status property; GoodsIssueItem/GoodsIssue child; StockMovement target + GoodsIssue back-ref; and the
rendered exprs incl. `item.Quantity == null ? null : item.Quantity.negate()`). Note `event:` not `on:`
(YAML boolean keyword). Generation/boot verify of the emitted handler + inventory adoption are the
next stage.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Stage 2 of
posts:(event-driven row posting; stage 1 model+glue merged as #6405). Builds thegenerated handler on the proven
postings:skeleton, flattened (no header document - N rowsstraight into the target).
Changes
buildPostsresolver - the full glue descriptor: trigger (event:=create|numeric status seed id → the
-created/-transitionedtopic + a status guard), the composition-childcoordinates for
forEach(itemsEntity/Fk/perspective), target coordinates, theidempotentByback-reference, and the rendered
set:assignments.postSetExprrenderer - eachset:value → a Java expression oversource/item: item copy(
item.X), null-safe negation (-item.X), source copy (source.X), integer constant, quoted string.Posts.java.template- aMessageHandleron the source's-transitioned/-createdtopic that,idempotent by the back-reference, emits one target row per
forEachitem (or one per source)through the target's generated repository.
template.js(collection: posts) + agenerateUtils.jscase "posts"(maps/sanitizes the glue → template params).
glue.put("posts", ...)wires it into the.glue.Authoring
Verification
engine-intent217/217.GluePostsTestasserts the resolved descriptor end-to-end:event: 2→status guard on the
Statusproperty;GoodsIssueItem/GoodsIssuecomposition child;StockMovementtarget +
GoodsIssueback-ref; and the rendered Java exprs (incl.item.Quantity == null ? null : item.Quantity.negate()). The handler template mirrors the provenPosting.java.template.Follow-up (stage 3)
Generation/boot verification of the emitted handler (compiles + posts identical rows) and adoption in
kf-mod-inventory(retire the 6*PostDelegates + the adjustment poster).event:numeric-id →optional status-name resolution is a nicety.
🤖 Generated with Claude Code