feat(clients/java): wrap execution, verification, analysis, convert and edit RPCs - #457
Open
devin-ai-integration[bot] wants to merge 5 commits into
Open
devin-ai-integration[bot] wants to merge 5 commits into
devin-ai-integration[bot] wants to merge 5 commits into
Conversation
…is and query in the public API Model gains executeAction/executeState with exploreAction/exploreState, verifyConstraint/verifyRequirement/verifySatisfaction/validateInstance, evaluateCalc, runAnalysis/exploreAnalysis, query/queryOslc and withEngine; Connection gains listEngines. Each answers an immutable record with no generated protobuf type in the public API. A false verdict is a decided answer, not an exception; ModelException carries a FailureReason and AnalysisException.partial() keeps what a failed analysis computed. The Java conformance runner covers the new RPCs through the public API, rendering results back to protobuf, so 94 of 134 scenarios run per protocol. Unit tests cover the result types and both conversion directions; ApiIntegrationTest runs each operation against the real service binary. Co-Authored-By: jason.han <hanhuijun@gmail.com>
… RunDocumentQuery and RenderDocument Add SourceDocument and Connection.parseSources for multi-document models, whose Model now carries a root per document alongside the single root() of a one-document model; Conversion and the Connection/Model convert calls; the sealed Edit operations with EditOptions, EditResult, EditFailure and EditException for refused batches; SweepRange, SweepOptions, SweepRow and Sweep for swept case and calc runs; the sealed DocumentValue kinds, DocumentRow and DocumentQueryResult for document queries; and RenderedDocument for Markdown renders. Advertise the parse_sources, document_query and render_document capabilities. Co-Authored-By: jason.han <hanhuijun@gmail.com>
… and the document RPCs in the conformance runner Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ent calls Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
… and keep an EditException's referrers across serialization Co-Authored-By: jason.han <hanhuijun@gmail.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.
What and why
org.openmbee:opensysml-clientwrapped only parsing, evaluation, symbols and instantiation; every other RPC the service offers had to be reached through the generated stubs. This PR completes the public Java API so that a JVM host embedding OpenSysML never needs a protobuf type:Model:executeAction/executeStateandexploreAction/exploreState,verifyConstraint/verifyRequirement/verifySatisfaction/validateInstance,evaluateCalc,runAnalysis/exploreAnalysis,runSweep,applyEdits,query/queryOslc,runDocumentQuery,renderDocument,convert,withEngine,roots.Connection:parseSources(a model of several documents),convert/convertFile,listEngines.ActionRun,StateRun,Exploration/Outcome,Verification,Satisfaction,Validation,Verdict,Calculation,Analysis,CaseEvaluation,Standing,QueryElement,EngineInfo,Conversion,EditResult/AppliedEdit/EditedDocument,Sweep/SweepRow,DocumentQueryResult/DocumentRow,RenderedDocument); closed alternatives are sealed interfaces (Edit,DocumentValue,Condition); optional request fields are options records withdefaults()/withX(ExecutionOptions,AnalysisOptions,SweepOptions,EditOptions,ConversionOptions). Every response field is mirrored.ServiceException; an answer whoseerrorfield is set isModelException(withfailureReason()),AnalysisExceptionwhen a failed analysis still computed something,EditExceptioncarrying theEditFailurekind and the referrers a refused edit named. A false verdict is a decided answer, not an exception.RunDocumentQuery/RenderDocumentfail only by status, as the service does.CapabilitiesgainsPARSE_SOURCES,DOCUMENT_QUERY,RENDER_DOCUMENTand the runtime/analysis names);Model.root()keeps its meaning as the first root.No service change was needed; the Go code is untouched. This supersedes #388, whose commit is included here.
How it was verified
make build;mvn -f client/java/pom.xml verify: BUILD SUCCESS — 236 client tests (mapping of every newProtosconversion both ways, options defaults/withX, error split, and integration tests against a privatebin/sysml-grpcover theconformance/fixtures), 36 conformance tests.connect,connect-json); the five skips are the requests the public API cannot express (aParseFilewith no source, twoQueryshapes, two malformedEvaluateCalcarguments), listed inclient/java/README.md. Multi-document scenario models parse throughparseSourcesinstead of being skipped.python3 scripts/check-doc-links.py,python3 scripts/check-doc-ids.py,python3 scripts/changelog.py checkclean.Checklist
make testandmake lintpass locallychanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelog