CALM java model library with reflection-based parsing for custom types#2570
CALM java model library with reflection-based parsing for custom types#2570willosborne wants to merge 17 commits into
Conversation
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.
|
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. |
|
@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 |
c6b93cb to
55f6f5c
Compare
|
Is the purpose to also remove the need for calmhub to call the cli functions via a sidecar cli server? |
|
@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. |
|
Issue: #2606 |
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
Affected Components
cli/)calm/)calm-ai/)calm-hub/)calm-hub-ui/)calm-server/)calm-widgets/)docs/)shared/)calm-plugins/vscode/)Commit Message Format ✅
Testing
Checklist