Conversation
emaarco
marked this pull request as ready for review
August 11, 2026 16:04
emaarco
force-pushed
the
issue-58
branch
3 times, most recently
from
August 13, 2026 10:16
02d7d3b to
1169a2c
Compare
Redesigns the generated JSON against the OMG BPMN 2.0 metamodel and the bpmn-moddle vocabulary, and reshapes the domain model to match. Two open feature requests forced the timing: neither multi-instance loop characteristics nor zeebe:ioMapping could be expressed by the old single-slot properties field, so #58 had to land first and they ship inside it. Domain FlowNodeDefinition is a sealed hierarchy mirroring the BPMN class tree, so a multi-instance gateway or a calledElement on an event is unrepresentable rather than merely unused. ProcessModel replaces BpmnModel and MergedBpmnModel; a process is a bpmn:FlowElementsContainer like any sub-process, and everything derivable — timers, compensations, implementations, variables — is derived from the node tree instead of stored beside it. JSON Relations are sequence-flow ids, sub-processes own their children and their own flows, events carry every event definition rather than the first, and the root element registries are keyed by the element's own id so a message used three times appears once. The document carries $schema and formatVersion, validated against a published JSON Schema. The raw layer carries only what the typed layer does not: an extension element or attribute a dialect reads in full is no longer repeated beside its normalised form. Boundaries Adding an engine means adding an EngineDialect; the per-engine extractors are gone. bpmn-to-code-testing goes through an inbound port instead of reaching into the engine adapter, which lets all 42 types under adapter/outbound become internal. Closes #58 Closes #73 Closes #74 BREAKING CHANGE: The process JSON is a new contract — see docs/changelog/v6.md for the field-by-field migration. The domain model's public types changed: BpmnModel and MergedBpmnModel are replaced by ProcessModel, FlowNodeProperties and BpmnNodeType are absorbed into the sealed FlowNodeDefinition hierarchy, and everything under adapter.outbound is now internal. The generated Kotlin and Java Process API is unchanged apart from unreferenced bpmn:Definitions root elements, which are now reported by a validation rule instead of silently dropped.
Contributor
|
Test Coverage
|
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.
What
Redesigns the process JSON and the domain model against BPMN 2.0 /
bpmn-moddle, and unblocks #73 and #74.The old
propertiesslot held exactly one facet per node, so a multi-instance service task with an I/O mapping was literally unrepresentable — which is why both features land here rather than before.FlowNodeDefinition. Sub-processes own their children and their own sequence flows; typed facets (TaskImplementation,EventDefinitionInstance[],MultiInstanceDefinition,IoMapping,EngineExtension) replace the untyped maps.Impact
docs/changelog/v6.md.context.modeltoBpmnModel/MergedBpmnModel— those types are gone (see below).Also in here
Five defects found while validating the redesign, each with a failing test first:
bpmn:Messageelements collapsed into one and left amessageRefpointing at nothing.serviceTasksdeduplicated by implementation reference (empty when unconfigured), so N unimplemented tasks produced one violation.isExecutableon merged models was hardcodedtrue, and the JSON paths don't filter.zeebe:subscriptionbelongs to thebpmn:Message, not to each referencing event.activityRefrepeated the event's own id.Structure
adapter/outbound/enginewas split by class kind (reader/,extractor/,utils/) with two of them importing each other; it is now split by problem —bpmn/,dialect/,xml/— andEngineModelExtractortakes a dialect instead of being subclassed per engine.BpmnModelandMergedBpmnModeldiffered only in whether variants were present, and every consumer asked exactly that. They collapse into oneProcessModelwithisMerged. The four root-element registries move behind aRootElementsvalue object, andBpmnModelApi.enginebecomestargetEngine— distinct fromProcessModel.detectedEngine, which is whatEngineMismatchRulecompares it against.Deliberately not done
VariableMappingis a code-generation ABI expressed as a domain interface, but moving it forces a decision on whether "will the generated API collide?" is a domain or an adapter rule. Likewise, root-element names are still copied onto the node tree because the correlation rules match on names rather than…Ref. Both are recorded in ADR 017 — they deserve their own ADR, not a release.Verification
./gradlew clean buildgreen · 387 tests, 0 failures · coverage gate green · architecture tests green under--rerun-tasks.Generated JSON is validated against the published schema on every run, for every fixture and engine, plus a reference-integrity check. Coverage for #73/#74 spans all three engines at both the extraction and JSON layers; both guards were verified to fail under mutation.
Closes #58
Closes #73
Closes #74