Skip to content

feat(core)!: typed process navigation via reshaped Relations - #55

Open
emaarco wants to merge 1 commit into
mainfrom
emaarco/analyze-scenario-test-builder
Open

feat(core)!: typed process navigation via reshaped Relations#55
emaarco wants to merge 1 commit into
mainfrom
emaarco/analyze-scenario-test-builder

Conversation

@emaarco

@emaarco emaarco commented Jul 22, 2026

Copy link
Copy Markdown
Member

Implements typed process navigation (issue #54) by reshaping the generated Relations section into a navigation graph.

What

  • Relations → navigation graph. Each element is a node exposing id + elementType + name; reachable elements live behind then(). A node's then() = its successors; a scope's then() = its start event(s) (so Relations.then() enters the process, Inner.then() enters a subprocess). Terminal elements have no then().
  • Elements unchanged — flat ElementId constants (non-breaking). Raw adjacency stays in the JSON export.
  • Subprocesses recurse via the nested Inner scope (the only wrapper); boundary events + continuations are plain target-named successors; call activities stay opaque.
  • Variants — per-variant navigation under Variants.<name>.Relations.
  • Kotlin + Java parity; deterministic, idempotent naming.

How

New language-agnostic IR NavGraph + NavigationGraphFactory (recursive parentId scoping, unified sequence-flow/boundary successors), rendered by both builders. Unit-tested; golden fixtures regenerated; Kotlin (PSI) + Java (javac) validation pass.

Scope of the compile-time guarantee

Single-step structural adjacency — not token-accurate reachability (XOR = one branch at runtime; AND = concurrent + join). See #54 for details.

Status

Draft — the optional per-step hook model (P2) is still to come. This PR is the read-only navigation graph.

Refs #54

@emaarco
emaarco force-pushed the emaarco/analyze-scenario-test-builder branch from 79aa0fb to c62b85c Compare July 22, 2026 21:45
@emaarco emaarco changed the title feat(core): typed process navigation via reshaped Relations feat(core)!: typed process navigation via reshaped Relations Jul 24, 2026
@emaarco
emaarco force-pushed the emaarco/analyze-scenario-test-builder branch 2 times, most recently from 58e4157 to c072c4e Compare July 24, 2026 06:55
@emaarco emaarco self-assigned this Jul 24, 2026
@emaarco emaarco added the enhancement New feature or request label Jul 24, 2026
@emaarco
emaarco marked this pull request as ready for review July 24, 2026 08:33
@emaarco
emaarco force-pushed the emaarco/analyze-scenario-test-builder branch 10 times, most recently from 2e9f251 to 42ad594 Compare July 25, 2026 11:30
…cade for Java

Generate a navigable process graph (FlowNode / HasSuccessors / HasInnerScope / NavigationScope
supertypes) and a compile-checked ProcessPath step DSL that walks it, so tests assert token flow
over the model instead of hand-maintained id string lists — model drift breaks the build at the
exact edge that moved.

- runtime: FlowNode/HasSuccessors/HasInnerScope/NavigationScope + AbstractFlowNode (equals/hashCode by id)
- runtime: ProcessPath extension-function step DSL (then / thenMultipleTimes / onto / enter /
  inside / interruptedBy / nodesOf / jumpTo)
- runtime: PathWalk fluent facade over the same engine, first-class from Java and Kotlin
- core: emit the navigation graph from both Kotlin and Java builders; interior nodes are written
  directly on the subprocess object with a leaf Inner scope, so a subprocess nested in a subprocess
  no longer emits an Inner enclosed by another Inner (a Java compile error, JLS 8.1.3)
- core: capture the non-null-id invariant once via FlowNodeWithId at the graph boundary (no !!)
- core: real javac compile gate for nested subprocesses (golden tests only parse)
- model the decrement-counter compensation as a service task across the shared BPMN + fixtures
- docs + identical Java/Kotlin API test suites

BREAKING CHANGE: the generated Relations object is reshaped from BpmnRelations metadata
constants into a typed, navigable node graph; BpmnRelations and the old SCREAMING_SNAKE
members are no longer generated.
@emaarco
emaarco force-pushed the emaarco/analyze-scenario-test-builder branch from 42ad594 to 2eafe87 Compare July 28, 2026 13:05
@github-actions

Copy link
Copy Markdown
Contributor

Test Coverage

Module Line Coverage
bpmn-to-code-core 98.3% (2421/2462 lines)
bpmn-to-code-gradle 25.7% (29/113 lines)
bpmn-to-code-maven 62.2% (28/45 lines)
bpmn-to-code-web 95.6% (196/205 lines)
bpmn-to-code-testing 93.7% (164/175 lines)
bpmn-to-code-runtime 99.0% (97/98 lines)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant