Skip to content

CALM java model library with reflection-based parsing for custom types#2570

Draft
willosborne wants to merge 17 commits into
finos:mainfrom
willosborne:calm-model-parsing
Draft

CALM java model library with reflection-based parsing for custom types#2570
willosborne wants to merge 17 commits into
finos:mainfrom
willosborne:calm-model-parsing

Conversation

@willosborne

@willosborne willosborne commented Jun 4, 2026

Copy link
Copy Markdown
Member

Description

CALM java model library with reflection-based parsing for custom types.
Based on existing calm-models TS implementation.

Intended use case is to simplify processing of CALM documents in java systems. i.e. eliminating jsonpath queries. Rather than generating calm from java.

Implemented with SDD based on Claude Code's brainstorming 'superpowers' feature.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🎨 Code style/formatting changes
  • ♻️ Refactoring (no functional changes)
  • ⚡ Performance improvements
  • ✅ Test additions or updates
  • 🔧 Chore (maintenance, dependencies, CI, etc.)

Affected Components

  • CLI (cli/)
  • Schema (calm/)
  • CALM AI (calm-ai/)
  • CALM Hub (calm-hub/)
  • CALM Hub UI (calm-hub-ui/)
  • CALM Server (calm-server/)
  • CALM Widgets (calm-widgets/)
  • Documentation (docs/)
  • Shared (shared/)
  • VS Code Extension (calm-plugins/vscode/)
  • Dependencies
  • CI/CD

Commit Message Format ✅

Testing

  • I have tested my changes locally
  • I have added/updated unit tests
  • All existing tests pass

Checklist

  • My commits follow the conventional commit format
  • I have updated documentation if necessary
  • I have added tests for my changes (if applicable)
  • My changes follow the project's coding standards

Add CalmNodeDetails, CalmNodeInterface, CalmFlowTransition, CalmFlow,
CalmControlDetail, CalmControl, CalmControls records/classes. Also fix
canonical schema classes to have public visibility so they can be
referenced from the model package.
…Interface

Implements Task 6 (sealed CalmRelationshipType with CalmConnectsType,
CalmInteractsType, CalmDeployedInType, CalmComposedOfType, CalmOptionsType,
CalmDecision variants) and Task 7 (CalmInterface with generic parseAs).

Also makes relationship-related canonical schema classes public so they
can be referenced from org.finos.calm.model.
Implements Task 8 (CalmNode) and Task 9 (CalmRelationship) with full
parsing from canonical schema classes, extension/metadata helpers,
and corresponding test stubs for the upcoming CalmArchitecture task.
Also makes CalmNodeSchema and CalmRelationshipSchema public for
cross-package access.
…tadata access

Introduces CalmArchitecture as the top-level parsing entry point for CALM
architecture JSON. Makes CalmArchitectureSchema public, adds findNodeById query
helper, and fixes CalmInterface.parseAs to strip the unique-id field before
deserialization so user-supplied target types do not need @JsonIgnoreProperties.
All 24 accumulated model tests now compile and pass for the first time.
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 4, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

@github-actions github-actions Bot added config docs Improvements of additions to documentation labels Jun 4, 2026
@jpgough-ms

Copy link
Copy Markdown
Member

@willosborne

Prefer letting callers pass Quarkus's injected ObjectMapper into CalmArchitecture.parse(json, mapper) so the library honours app-wide Jackson configuration instead of its private mapper.

@willosborne

Copy link
Copy Markdown
Member Author

@jpgough-ms that's one of the overloads of parse - should be able to pass a pre-configured one in already. good shout though, hadn't thought about Quarkus/framework config - I was mostly thinking about potential extensions to jackson

@LeighFinegold

Copy link
Copy Markdown
Member

Is the purpose to also remove the need for calmhub to call the cli functions via a sidecar cli server?

@willosborne

Copy link
Copy Markdown
Member Author

@LeighFinegold as discussed on office hours - no. this is not intended as a full java replacement of the CLI commands/tools. This is intended purely to assist Java projects in parsing CALM architectures for the purpose of driving automation.
No IO functionality either.

@willosborne

willosborne commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

Issue: #2606

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

Labels

config docs Improvements of additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants