intent: a decision whose then:/else: targets itself is refused like next: <self> (#7292) - #7311
Merged
Merged
Conversation
…ext: <self> (#7292) #7274 (#7226) refused `next: <self>` on a process step at parse - a self-targeting sequence flow the engine spins on. The same spin one key over was still accepted: `checkDecisionTarget` only checked that the target EXISTS, so `- { name: rated, kind: decision, if: ..., then: rated, else: done }` emitted a sequence flow from the exclusive gateway to itself. A gateway has no wait state, so Flowable spins on it exactly as it did on the `next` self-loop - the spin that made the ResilienceBpmnTest fixture bug worth a parse rule in the first place. `then`/`else` naming the decision itself is now refused with the same sentence as `next`, located on the decision. Deliberately untouched, as the issue asks: `onError: <self>` (an unbounded retry, arguable semantics - `retry:` exists for it), a timer boundary's `then: <self>` on a userTask (re-open the task - a legitimate pattern that must stay legal), and multi-step cycles through a wait state. The two new negative tests sit next to `aNextTargetingItselfIsRejected` so the pair stays legible, with a third pinning that a decision branching back through a wait state still parses. Verified: red-first - both new refusal tests fail against the unpatched parser ("Expected IntentValidationException to be thrown, but nothing was thrown") and pass with it; engine-intent parser + generator suites green (642 tests, 0 failures, incl. StepResilienceIntentTest 23/23). Fixes #7292 Co-Authored-By: Claude Opus 5 <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.
#7274 (#7226) refused
next: <self>on a process step at parse — a self-targeting sequence flow the engine spins on. The same spin one key over was still accepted:checkDecisionTargetonly checked that the target exists, so- { name: rated, kind: decision, args: { if: "...", then: rated, else: done } }emitted a sequence flow from the exclusive gateway to itself. A gateway has no wait state, so Flowable spins on it exactly as it did on the
nextself-loop — the spin that made theResilienceBpmnTestfixture bug worth a parse rule in the first place.Change
then/elsenaming the decision itself is refused with the same sentence asnext, located on the decision:checkDecisionTargetreturns early on a routing literal (end/join), then checks self before existence — so a self-target is never reported as an unknown step.Deliberately untouched, as the issue asks:
onError: <self>(an unbounded retry with arguable semantics —retry:exists for it), a timer boundary'sthen: <self>on auserTask(re-open the task — a legitimate pattern that must stay legal), and multi-step cycles through a wait state. All three live on other code paths (timeout:/expire:are validated in the boundary-timer block,onErrorin its own), so scoping the rule tocheckDecisionTargetkeeps them legal by construction.Tests
The two new refusal tests sit next to
aNextTargetingItselfIsRejectedso the pair stays legible, plus a third pinning that a decision branching back through a wait state still parses. The class javadoc now covers both self-loop shapes.Verification
Expected IntentValidationException to be thrown, but nothing was thrown) and pass with it.StepResilienceIntentTest23/23.Fixes #7292
🤖 Generated with Claude Code