Automatic register lookup reaches the constructs bound to its transition - #6836
Open
TIVMOF wants to merge 9 commits into
Open
Automatic register lookup reaches the constructs bound to its transition#6836TIVMOF wants to merge 9 commits into
TIVMOF wants to merge 9 commits into
Conversation
…d to its transition Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Three conflicts, all this branch's additions meeting master's: - GenerateOnEvent.java.template: eclipse-dirigible#6824 split the topic bullet into a three-way step / create / transition branch, while this branch corrected the transition wording (the -transitioned channel is what the WORKFLOW routes, not every status write). Master's structure kept, this branch's wording applied to the transition branch. - IntentEmissionCoverageIT fixture: both sides appended entities and seeds to the same shared model - both kept, and the entry-statuses rows keep master's `stage:` classification (eclipse-dirigible#6814) rather than this branch's older unclassified copies. - IntentEmissionCoverageIT runtime: both sides appended an assertion method and its call - both kept, in the order they were written. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
Merged current
Heads-up on (3): the closing brace of the last method sits outside git's conflict region — shared by both sides — so splicing the blocks left Verified on the merged tree before pushing: |
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.
This PR:
Problem
resolves:persists everything it decides — the resolved relation, theoutcome:trace and thefound:/notFound:/ambiguous:status — through a singleupdatePropertiescall, which publishes no event at all. The constructs that react to a status change (generates:andpostings:bound toevent: { onTransition: ... }) listen on-transitioned, and the only publishers of that topic wereSetField,TransitionandGenerate.Resolvewas not among them; it does not referenceProduceranywhere.So an automatic resolution wrote the status to the database and told nobody, while a manual
transitions:button on the same entity reached every consumer — the automation's primary path silently doing nothing, its manual fallback working, and no log line either way. Both constructs use the same Fine/VehicleAssignment/Declaration domain as their worked examples in the assistant guide, about a thousand lines apart, and the composition those examples imply did not work.Change
Resolve.java.templatepublishes-transitionedafter the write, guarded on a status having actually been written — a lookup that only filled a relation transitioned nothing and announces nothing. It followsTransitionandGeneraterather thanSetField: those two are the non-BPMN publishers, using a plain reload-then-Producer.sendToTopic, whereasSetField'sProcess.executeAfterCommitonly makes sense inside a Flowable command, which aMessageHandleris not. The publish guard is the samestatus != nullas the write guard, so it can never fire without a committed write.The documentation line in
GenerateOnEvent.java.templateis corrected while here. It described-transitionedas "the channel every status write publishes", which is not true: a plain RESTupdate()publishes only-updated, and a targetedupdateProperty/updatePropertieswrite publishes nothing unless its own template does. It now names the four workflow-routed sources and states explicitly what it is not.Coverage
resolves:had noIntentEmissionCoverageITentry, so the status-write path was exercised end to end nowhere. It now has one: a self-contained register scenario (Zonematch key,Inspectorresolved value,Dutyregister,Patrolrecord,PatrolReportdownstream target) plus agenerates:bound toevent: { onTransition: Patrol, when: "Status == POSTED" }.The last entity is the point. Asserting only that
Inspectorwas filled in would have passed with the bug present — the row was always written, it just was not announced. The assertion that matters is that aPatrolReportexists, which is only possible if-transitionedwas published.Dutycarries two non-overlapping windows for one zone with the patrol's date inside the second, so resolving to inspector 2 proves the validity period decided it rather than the zone alone.An emission-layer assertion checks the generated
AssignInspectorResolve.javapublishes on the right topic and — by index comparison — that the publish sits under the status guard.Testing
The whole fixture parses through the real
IntentParser, which is what enforces theresolves:rules (the register must hold exactly one to-one to theset:target, bounds must be dates, match keys must exist, the status must be reachable). That check rejected the first draft withduplicate entity [Visit]— the fixture already had one — hencePatrol.Resolve.java.templatewas rendered through a real Velocity engine in both branches: the publish appears withwritesStatus=true, is absent withfalse, zero unresolved${...}either way.GenerateOnEvent.java.templatewas rendered in bothisCreatebranches, since the doc edit sits inside an#if/#else.The integration test has not been executed.
mvn -P quick-build install -pl tests/tests-integrations -amfails offline inengine-camel(the camel-component-maven-plugin cannot resolveAbstractGenerateMojo), which is environmental and unrelated to this change. The assertions are validated at the layers reachable without a running app — YAML parse, intent parse, template render, formatter — but the HTTP round-trip and the timing of the asynchronous resolution need a CI run before merge.🤖 Generated with Claude Code