feat(automation): BPMN ⇄ structured-construct model mapping (ADR-0031, task 5)#1500
Merged
Merged
Conversation
…31, task 5) Add the semantic bridge between the structured control-flow constructs (native model) and the BPMN gateway/boundary/multi-instance vocabulary (interop only), at the flow-model level — independent of any wire format. spec (@objectstack/spec) — automation/bpmn-mapping.ts: - exportConstructsToBpmn(flow): parallel -> parallel_gateway + branches + join_gateway; try_catch -> protected activity + error boundary_event + handler; loop -> body marked with multi-instance loopCharacteristics. Each expansion's anchor carries an `osConstruct` extension marker. - importBpmnToConstructs(flow): exact reconstruction from the marker (so construct -> BPMN -> construct is identity), plus best-effort folding of foreign parallel_gateway/join_gateway pairs, with diagnostics for shapes it can't safely fold. - 9 tests incl. exact round-trips (parallel/try_catch/loop) and foreign folding. BPMN 2.0 XML (de)serialization layers on top and stays a plugin concern (bpmn-interop.zod.ts) — out of scope here. ADR-0031 updated. https://claude.ai/code/session_012ti8cx3TkdiQdjCnZXZg2Q
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Jun 2, 2026
Open
os-zhuang
added a commit
that referenced
this pull request
Jun 2, 2026
The structured control-flow constructs (loop/parallel/try-catch) and the BPMN interop mapping are implemented and merged (#1482, #1489, #1499, #1500; docs #1497). Flip ADR-0031 from Proposed to Accepted and record the implementing PRs and the deferred follow-ups (#1504 BPMN XML plugin, #1505 region step logs). https://claude.ai/code/session_012ti8cx3TkdiQdjCnZXZg2Q Co-authored-by: Claude <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.
Implements ADR-0031 task 5 (issue #1479) — the BPMN ⇄ structured-construct mapping, completing the ADR-0031 roadmap.
Scope decision (long-term lens)
ADR-0031 makes the structured constructs the native model and BPMN interop-only ("Priority: Low"). The durable, reusable asset is the semantic mapping at the flow-model level — that logic is needed regardless of the wire format. So this PR delivers the model-level mapping (pure, no XML dependency); BPMN 2.0 XML (de)serialization layers on top and stays a plugin concern (per
bpmn-interop.zod.ts), as a follow-up.What's in this PR —
@objectstack/specautomation/bpmn-mapping.ts(new)Export —
exportConstructsToBpmn(flow)expands each construct into its BPMN interchange shape so external BPM tools see a well-formed graph:parallel→parallel_gateway(AND-split) + branch regions +join_gateway(AND-join)try_catch→ the protected activity + an errorboundary_event+ the handler regionloop(withbody) → its body marked with multi-instanceloopCharacteristicsEach expansion's anchor node carries an
osConstructextension marker (the analogue of BPMNextensionElements).Import —
importBpmnToConstructs(flow)folds BPMN back into constructs:osConstructmarker → exact reconstruction (soconstruct → BPMN → constructis identity)parallel_gateway/join_gatewaypairs into aparallelblock; shapes it can't safely fold (foreign boundary events, multi-instance markers) are left in place with diagnostics.Both return a
{ flow, diagnostics, mappedCount, unmappedCount }result (mirrorsBpmnInteropResultSchema).Tests
automation/bpmn-mapping.test.ts— 9 tests: expansion shape + exact round-trips for parallel / try_catch (retry preserved) / loop, foreign gateway folding, and the two warning paths (foreign boundary event; gateway with no matching join). Spectsc --noEmitclean; full automation suite 293.Roadmap (#1479) — complete
https://claude.ai/code/session_012ti8cx3TkdiQdjCnZXZg2Q
Generated by Claude Code