Skip to content

intent: a decision whose then:/else: targets itself is refused like next: <self> (#7292) - #7311

Merged
delchev merged 1 commit into
masterfrom
worktree-issue-7292-decision-self-target
Sep 11, 2026
Merged

intent: a decision whose then:/else: targets itself is refused like next: <self> (#7292)#7311
delchev merged 1 commit into
masterfrom
worktree-issue-7292-decision-self-target

Conversation

@ThuF

@ThuF ThuF commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

#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, 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 next self-loop — the spin that made the ResilienceBpmnTest fixture bug worth a parse rule in the first place.

Change

then/else naming the decision itself is refused with the same sentence as next, located on the decision:

process [Review] decision [rated] `then` targets itself - a self-loop that never advances

checkDecisionTarget returns 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'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. All three live on other code paths (timeout:/expire: are validated in the boundary-timer block, onError in its own), so scoping the rule to checkDecisionTarget keeps them legal by construction.

Tests

The two new refusal tests sit next to aNextTargetingItselfIsRejected so 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

  • 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 / 0 errors, incl. StepResilienceIntentTest 23/23.

Fixes #7292

🤖 Generated with Claude Code

…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>
@delchev
delchev merged commit 8ea68ee into master Sep 11, 2026
10 checks passed
@delchev
delchev deleted the worktree-issue-7292-decision-self-target branch September 11, 2026 06:44
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.

intent: a decision whose then:/else: targets itself is not refused like next: <self> is (#7226 follow-up)

2 participants