Skip to content

A process decision can branch on a to-one relation of its trigger entity - #7679

Merged
delchev merged 2 commits into
eclipse-dirigible:masterfrom
nedelcho-delchev-tues:issue-7648-decision-on-relation
Oct 5, 2026
Merged

delchev merged 2 commits into
eclipse-dirigible:masterfrom
nedelcho-delchev-tues:issue-7648-decision-on-relation

Conversation

@nedelcho-delchev-tues

Copy link
Copy Markdown
Contributor

Fixes #7648

The field loader inserted before a gateway published the trigger entity's own fields only. So if: "SendMethod == 1" — branching on a nomenclature the row carries as a foreign key, which is how "e-mail it or print it" is modelled — got no loader at all. The identifier resolved only when a task form happened to post it as a variable; a completion through the Inbox API carries none, Flowable failed the expression on the unknown property, and the instance stopped at the gateway.

The foreign key is a number on the row like any other column, so the field path needed nothing new — only to look. All three halves:

  • The loader carries it. ProcessFieldLoadSupport.ownNames collects the entity's to-one relation names alongside its field names, so the delegate publishes the FK under the same PascalCase name a field gets.
  • The gateway reads it under that name. BpmnIntentGenerator.ownFieldPascalCase now rewrites relation names in the condition too.
  • A seeded name on the right-hand side resolves. StatusSymbolResolver rewrites <Relation> ==|!= <NAME> in a decision's if: against the nomenclature that relation points at, not the record's own status — a decision may branch on any to-one, and the record's status is a different nomenclature carrying a different id for the same word. An ordering comparison against a name is refused, as it is at every other status site.

Covered by the new ProcessDecisionRelationTest: the name resolves against the relation's own nomenclature, the loader carries the foreign key before the gateway, and the emitted BPMN reads it under the name the loader publishes. There was no field-loader test before this one. The engine-intent suite is green: 1482 tests.

The field loader inserted before a gateway published the trigger entity's own
FIELDS only, so `if: "SendMethod == 1"` - branching on a nomenclature the row
carries as a foreign key, which is how "e-mail it or print it" is modelled -
got no loader at all. The identifier resolved only when a task form happened
to post it as a variable; a completion through the Inbox API carries none, and
Flowable then failed the expression on the unknown property and the instance
stopped at the gateway.

The foreign key is a number on the row like any other column, so all three
halves are the ones the field path already walks:

- `ProcessFieldLoadSupport.ownNames` looks for to-one relation names too, so
  the loader publishes the FK;
- `BpmnIntentGenerator.ownFieldPascalCase` rewrites those names in the
  gateway's condition, to exactly what the loader publishes;
- `StatusSymbolResolver` resolves a seeded NAME on the right-hand side against
  the nomenclature THAT relation points at - never the record's own status,
  which is a different nomenclature carrying a different id for the same word.

Fixes eclipse-dirigible#7648

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CodeQL flags the shared comparison regex as a polynomial ReDoS now that an
authored decision condition reaches it: on a long run of identifier
characters the engine restarts at every position and rescans the identifier,
which is quadratic.

Both identifier runs become possessive. A shorter run would end inside an
identifier, where the trailing word boundary cannot hold, so backtracking into
them could never produce a match - it only ever cost the scan. The language
each pattern accepts is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@delchev
delchev merged commit fdf41ce into eclipse-dirigible:master Oct 5, 2026
10 checks passed
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 process decision cannot branch on a to-one relation of the trigger entity (SentMethod == 1) - the own-field loader covers fields only

3 participants