Documentation
¶
Index ¶
- Constants
- func Capabilities() []string
- func DiagnosticToProto(diag diag.Diagnostic, sf *source.SourceFile) *pb.Diagnostic
- func NewSymbolContext(idx *symbols.Index) *symbolfacts.Context
- func ParserDiagnosticToProto(diag parser.Diagnostic, sf *source.SourceFile) *pb.Diagnostic
- func QueryPropertyNames() []string
- func RunNoteDiagnosticsToProto(notes []runtime.RunNote, model *CachedModel) []*pb.Diagnostic
- func SymbolToProtoIn(sym *symbols.Symbol, sc *symbolfacts.Context) *pb.SymbolInfo
- type Cache
- type CachedDocument
- type CachedModel
- func (m *CachedModel) DocumentRoots() []*symbols.Scope
- func (m *CachedModel) Primary() *CachedDocument
- func (m *CachedModel) PrimaryRoot() *symbols.Scope
- func (m *CachedModel) Semantics() (*runtime.Model, error)
- func (m *CachedModel) SoleDocument() (*CachedDocument, error)
- func (m *CachedModel) SymbolContext() *symbolfacts.Context
- type ConnectAdapter
- func (a *ConnectAdapter) ApplyEdits(ctx context.Context, req *connect.Request[pb.ApplyEditsRequest]) (*connect.Response[pb.ApplyEditsResponse], error)
- func (a *ConnectAdapter) Convert(ctx context.Context, req *connect.Request[pb.ConvertRequest]) (*connect.Response[pb.ConvertResponse], error)
- func (a *ConnectAdapter) Evaluate(ctx context.Context, req *connect.Request[pb.EvaluateRequest]) (*connect.Response[pb.EvaluateResponse], error)
- func (a *ConnectAdapter) EvaluateCalc(ctx context.Context, req *connect.Request[pb.EvaluateCalcRequest]) (*connect.Response[pb.EvaluateCalcResponse], error)
- func (a *ConnectAdapter) ExecuteAction(ctx context.Context, req *connect.Request[pb.ExecuteActionRequest]) (*connect.Response[pb.ExecuteActionResponse], error)
- func (a *ConnectAdapter) ExecuteState(ctx context.Context, req *connect.Request[pb.ExecuteStateRequest]) (*connect.Response[pb.ExecuteStateResponse], error)
- func (a *ConnectAdapter) ExportGraphs(ctx context.Context, req *connect.Request[pb.ExportGraphsRequest]) (*connect.Response[pb.ExportGraphsResponse], error)
- func (a *ConnectAdapter) GetDiagnostics(ctx context.Context, req *connect.Request[pb.DiagnosticsRequest]) (*connect.Response[pb.DiagnosticsResponse], error)
- func (a *ConnectAdapter) GetServerInfo(ctx context.Context, req *connect.Request[pb.ServerInfoRequest]) (*connect.Response[pb.ServerInfoResponse], error)
- func (a *ConnectAdapter) GetSymbol(ctx context.Context, req *connect.Request[pb.GetSymbolRequest]) (*connect.Response[pb.SymbolResponse], error)
- func (a *ConnectAdapter) Instantiate(ctx context.Context, req *connect.Request[pb.InstantiateRequest]) (*connect.Response[pb.InstantiateResponse], error)
- func (a *ConnectAdapter) ListEngines(ctx context.Context, req *connect.Request[pb.ListEnginesRequest]) (*connect.Response[pb.ListEnginesResponse], error)
- func (a *ConnectAdapter) Migrate(ctx context.Context, req *connect.Request[pb.MigrateRequest]) (*connect.Response[pb.MigrateResponse], error)
- func (a *ConnectAdapter) ParseFile(ctx context.Context, req *connect.Request[pb.ParseFileRequest]) (*connect.Response[pb.ParseFileResponse], error)
- func (a *ConnectAdapter) ParseSources(ctx context.Context, req *connect.Request[pb.ParseSourcesRequest]) (*connect.Response[pb.ParseSourcesResponse], error)
- func (a *ConnectAdapter) Query(ctx context.Context, req *connect.Request[pb.QueryRequest]) (*connect.Response[pb.QueryResponse], error)
- func (a *ConnectAdapter) RenderDocument(ctx context.Context, req *connect.Request[pb.RenderDocumentRequest]) (*connect.Response[pb.RenderDocumentResponse], error)
- func (a *ConnectAdapter) RenderView(ctx context.Context, req *connect.Request[pb.RenderViewRequest]) (*connect.Response[pb.RenderViewResponse], error)
- func (a *ConnectAdapter) RunAnalysis(ctx context.Context, req *connect.Request[pb.RunAnalysisRequest]) (*connect.Response[pb.RunAnalysisResponse], error)
- func (a *ConnectAdapter) RunDocumentQuery(ctx context.Context, req *connect.Request[pb.RunDocumentQueryRequest]) (*connect.Response[pb.RunDocumentQueryResponse], error)
- func (a *ConnectAdapter) RunSweep(ctx context.Context, req *connect.Request[pb.RunSweepRequest]) (*connect.Response[pb.RunSweepResponse], error)
- func (a *ConnectAdapter) ValidateInstance(ctx context.Context, req *connect.Request[pb.ValidateInstanceRequest]) (*connect.Response[pb.ValidateInstanceResponse], error)
- func (a *ConnectAdapter) VerifyConstraint(ctx context.Context, req *connect.Request[pb.VerifyConstraintRequest]) (*connect.Response[pb.VerifyConstraintResponse], error)
- func (a *ConnectAdapter) VerifyRequirement(ctx context.Context, req *connect.Request[pb.VerifyRequirementRequest]) (*connect.Response[pb.VerifyRequirementResponse], error)
- func (a *ConnectAdapter) VerifySatisfaction(ctx context.Context, req *connect.Request[pb.VerifySatisfactionRequest]) (*connect.Response[pb.VerifySatisfactionResponse], error)
- type Option
- type QueryError
- type QueryErrorKind
- type Service
- func (s *Service) ApplyEdits(ctx context.Context, req *pb.ApplyEditsRequest) (*pb.ApplyEditsResponse, error)
- func (s *Service) Close()
- func (s *Service) Convert(ctx context.Context, req *pb.ConvertRequest) (*pb.ConvertResponse, error)
- func (s *Service) Evaluate(ctx context.Context, req *pb.EvaluateRequest) (*pb.EvaluateResponse, error)
- func (s *Service) EvaluateCalc(ctx context.Context, req *pb.EvaluateCalcRequest) (*pb.EvaluateCalcResponse, error)
- func (s *Service) ExecuteAction(ctx context.Context, req *pb.ExecuteActionRequest) (*pb.ExecuteActionResponse, error)
- func (s *Service) ExecuteState(ctx context.Context, req *pb.ExecuteStateRequest) (*pb.ExecuteStateResponse, error)
- func (s *Service) ExportGraphs(ctx context.Context, req *pb.ExportGraphsRequest) (*pb.ExportGraphsResponse, error)
- func (s *Service) GetDiagnostics(ctx context.Context, req *pb.DiagnosticsRequest) (*pb.DiagnosticsResponse, error)
- func (s *Service) GetServerInfo(ctx context.Context, req *pb.ServerInfoRequest) (*pb.ServerInfoResponse, error)
- func (s *Service) GetSymbol(ctx context.Context, req *pb.GetSymbolRequest) (*pb.SymbolResponse, error)
- func (s *Service) Instantiate(ctx context.Context, req *pb.InstantiateRequest) (*pb.InstantiateResponse, error)
- func (s *Service) ListEngines(_ context.Context, _ *pb.ListEnginesRequest) (*pb.ListEnginesResponse, error)
- func (s *Service) Migrate(ctx context.Context, req *pb.MigrateRequest) (*pb.MigrateResponse, error)
- func (s *Service) OpenSession(modelHash string) (*Session, error)
- func (s *Service) ParseFile(ctx context.Context, req *pb.ParseFileRequest) (*pb.ParseFileResponse, error)
- func (s *Service) ParseSources(ctx context.Context, req *pb.ParseSourcesRequest) (*pb.ParseSourcesResponse, error)
- func (s *Service) Prewarm()
- func (s *Service) Query(ctx context.Context, req *pb.QueryRequest) (*pb.QueryResponse, error)
- func (s *Service) RenderDocument(ctx context.Context, req *pb.RenderDocumentRequest) (*pb.RenderDocumentResponse, error)
- func (s *Service) RenderView(ctx context.Context, req *pb.RenderViewRequest) (*pb.RenderViewResponse, error)
- func (s *Service) RunAnalysis(ctx context.Context, req *pb.RunAnalysisRequest) (*pb.RunAnalysisResponse, error)
- func (s *Service) RunDocumentQuery(ctx context.Context, req *pb.RunDocumentQueryRequest) (*pb.RunDocumentQueryResponse, error)
- func (s *Service) RunSweep(ctx context.Context, req *pb.RunSweepRequest) (*pb.RunSweepResponse, error)
- func (s *Service) ValidateInstance(ctx context.Context, req *pb.ValidateInstanceRequest) (*pb.ValidateInstanceResponse, error)
- func (s *Service) VerifyConstraint(ctx context.Context, req *pb.VerifyConstraintRequest) (*pb.VerifyConstraintResponse, error)
- func (s *Service) VerifyRequirement(ctx context.Context, req *pb.VerifyRequirementRequest) (*pb.VerifyRequirementResponse, error)
- func (s *Service) VerifySatisfaction(ctx context.Context, req *pb.VerifySatisfactionRequest) (*pb.VerifySatisfactionResponse, error)
- type Session
- func (ss *Session) Accepts(object int64, signalID string, args map[string]*pb.Value) (*SessionAcceptance, error)
- func (ss *Session) ActiveStates(object int64) ([]string, error)
- func (ss *Session) Advance(seconds float64) (*SessionAdvance, error)
- func (ss *Session) Close()
- func (ss *Session) Evaluate(expression, contextSymbolID string) (*pb.Value, error)
- func (ss *Session) FeatureValue(object int64, feature string) (*pb.FeatureValue, error)
- func (ss *Session) Instantiate(symbolID string) (int64, error)
- func (ss *Session) Members(symbolID string) ([]SessionMember, error)
- func (ss *Session) Now() (float64, error)
- func (ss *Session) Perform(object int64, actionID string, inputs map[string]*pb.Value) (*SessionPerformance, error)
- func (ss *Session) Send(object int64, signalID string, args map[string]*pb.Value) (*SessionAcceptance, error)
- func (ss *Session) SetFeatureValue(object int64, feature string, value *pb.Value) error
- func (ss *Session) SetSchedule(spelling string) error
- func (ss *Session) Transitions(object int64) ([]SessionTransition, error)
- type SessionAcceptance
- type SessionAdvance
- type SessionBranch
- type SessionChoice
- type SessionFailure
- type SessionMember
- type SessionPerformance
- type SessionTransition
Constants ¶
const ( QueryPropID = corequery.PropertyID QueryPropType = corequery.PropertyType QueryPropName = corequery.PropertyName QueryPropDeclaredName = corequery.PropertyDeclaredName QueryPropShortName = corequery.PropertyShortName QueryPropDeclaredShortName = corequery.PropertyDeclaredShortName QueryPropDocumentation = corequery.PropertyDocumentation QueryPropQualifiedName = corequery.PropertyQualifiedName QueryPropOwner = corequery.PropertyOwner QueryPropIsAbstract = corequery.PropertyIsAbstract QueryPropElementType = corequery.PropertyElementType QueryPropMultiplicityLower = corequery.PropertyMultiplicityLower QueryPropMultiplicityUpper = corequery.PropertyMultiplicityUpper QueryPropSatisfiedRequirement = corequery.PropertySatisfiedRequirement QueryPropSatisfyingFeature = corequery.PropertySatisfyingFeature )
Query property names, as the SysML v2 API & Services standard's clients write them. docs/reference/api.md documents what each one reports.
const ( TriggerCompletion = "completion" TriggerSignal = "signal" TriggerTime = "time" TriggerChange = "change" TriggerCall = "call" )
Trigger kinds a SessionTransition reports.
const CapabilityActionBodyStatementAuthoring = "action_body_statement_authoring"
CapabilityActionBodyStatementAuthoring names the extended action-body items and source-end multiplicities carried by add_sequence.
const CapabilityApplyEdits = "apply_edits"
CapabilityApplyEdits names the capability of the ApplyEdits RPC, which edits a parsed model's own source, preserving everything the edit did not touch.
const CapabilityAuthoring = "authoring"
CapabilityAuthoring gates source-authoring ApplyEdits operations; dedicated capabilities further gate specialized authoring operations.
const CapabilityBigIntValues = "big_int_values"
CapabilityBigIntValues names the capability of carrying an Integer beyond int64 as Value.big_int_value, Quantity.big_int_magnitude and DocumentValue.big_int_value, rather than as an unsupported null. A service without it reads the arm sent to it as null, so a client must not send one.
const CapabilityCaseEvaluations = "case_evaluations"
CapabilityCaseEvaluations names the capability of reporting each application an analysis run made of one of the case's calcs as a function value — a trade study's evaluation of each alternative — and of keeping what a failed run computed beside its error.
const CapabilityCommentAuthoring = "comment_authoring"
CapabilityCommentAuthoring names the ApplyEdits add_comment and add_note operations.
const CapabilityComplexValues = "complex_values"
CapabilityComplexValues names the capability of carrying a complex number as Value.complex, rather than reporting it as an unsupported null.
const CapabilityConnectionAuthoring = "connection_authoring"
CapabilityConnectionAuthoring names the ApplyEdits add_connection operation.
const CapabilityConstraintBodyAuthoring = "constraint_body_authoring"
CapabilityConstraintBodyAuthoring names constraint body expressions and asserted constraints.
const CapabilityConvert = "convert"
CapabilityConvert names the capability of the Convert RPC, which writes a model back out as SysML notation or RDF Turtle. The RDF direction is experimental, which the response says per conversion.
const CapabilityConvertCompact = "convert_compact"
CapabilityConvertCompact names ConvertRequest.compact, omit_derived and keep_derived: api-json written as the compact document, with an id table and handles, and optionally without the metamodel's derived properties.
const CapabilityConvertDocuments = "convert_documents"
CapabilityConvertDocuments names ConvertRequest.documents, which writes only the named documents of a model and links the rest by id.
const CapabilityDiagnosticCodes = "diagnostic_codes"
CapabilityDiagnosticCodes names the capability of populating Diagnostic.code, so an empty code is a finding none was assigned rather than an older service.
const CapabilityDocumentQuery = "document_query"
CapabilityDocumentQuery names the capability of the RunDocumentQuery RPC, which runs a named document query and answers with typed rows.
const CapabilityDocumentationAuthoring = "documentation_authoring"
CapabilityDocumentationAuthoring names the ApplyEdits add_documentation operation and the AddMember doc field.
const CapabilityEditDocuments = "edit_documents"
CapabilityEditDocuments names the capability of editing a model of several documents as one batch, for a request accepting documents, and of answering each edited document by name in ApplyEditsResponse.documents.
const CapabilityEngines = "engines"
CapabilityEngines names the ListEngines RPC, the `engine` field of the verification and sweep requests, and the `engine`, `strength` and `bounds` fields of their responses and of every Verdict.
const CapabilityEnginesExternal = "engines_external"
CapabilityEnginesExternal says the service was started with -serve-external-engines and runs the manifest engines it names; ListEngines reports which with `served`.
const CapabilityEnumValues = "enum_values"
CapabilityEnumValues names the capability of carrying an enumeration literal as Value.enum_literal, rather than reporting it as an unsupported null.
const CapabilityEvaluateSubject = "evaluate_subject"
CapabilityEvaluateSubject names the capability of evaluating an expression against an instantiated subject.
const CapabilityExportGraphs = "export_graphs"
CapabilityExportGraphs names the capability of the ExportGraphs RPC, which exports the lowered graph of an action or state machine as `graphs:1` JSON.
const CapabilityFeatureValues = "feature_values"
CapabilityFeatureValues names the capability of populating Instance.feature_values, which replaced the pre-0.1.0 Instance.slots.
const CapabilityFinalTime = "final_time"
CapabilityFinalTime names the capability of populating final_time on ExecuteActionResponse and ExecuteStateResponse, the run's simulation clock when it ended. Without it the field is 0 whatever the run waited on.
const CapabilityFunctionValues = "function_values"
CapabilityFunctionValues names the capability of carrying a calc held as a value as Value.function, named by its declaration, rather than reporting it as an unsupported null.
const CapabilityImplicitParameters = "implicit_parameters"
CapabilityImplicitParameters names the ApplyEdits add_member operation with no kind: an implicit directed usage (`in x : T;`).
const CapabilityImportAuthoring = "import_authoring"
CapabilityImportAuthoring names the ApplyEdits add_import operation.
const CapabilityInfinityValue = "infinity_value"
CapabilityInfinityValue names the capability of carrying the unbounded value `*` as Value.infinity, rather than reporting it as an unsupported null.
const CapabilityInlineLanguage = "inline_language"
CapabilityInlineLanguage names explicit language selection for inline content.
const CapabilityMeasurementRefs = "measurement_refs"
CapabilityMeasurementRefs names the capability of carrying a bare measurement reference as Value.measurement_ref, rather than reporting it as an unsupported null. Distinct from structured_values, which predates the arm.
const CapabilityMemberModifiers = "member_modifiers"
CapabilityMemberModifiers names the additional AddMember modifiers and kinds.
const CapabilityMetadataAuthoring = "metadata_authoring"
CapabilityMetadataAuthoring names metadata usages and metadata prefixes.
const CapabilityMetadataPrefixAuthoring = "metadata_prefix_authoring"
CapabilityMetadataPrefixAuthoring names edits that add metadata to an existing declaration.
const CapabilityMetaobjectValues = "metaobject_values"
CapabilityMetaobjectValues names the capability of carrying an element reflected on as an instance of its metaclass (`x meta T`, the last element of `x.metadata`) as Value.metaobject, rather than as an unsupported null.
const CapabilityMigrate = "migrate"
CapabilityMigrate names the capability of the Migrate RPC, which migrates a SysML v1 model to v2 and accounts for every element — mapped, approximated, unmapped or skipped — in its report. Migration is experimental, which the response says.
const CapabilityOSLCQuery = "oslc_query"
CapabilityOSLCQuery names the capability of evaluating OSLC Query text.
const CapabilityParseSources = "parse_sources"
CapabilityParseSources names the ParseSources RPC, which parses several documents as one model so a name one declares resolves in another.
const CapabilityParseSourcesAffected = "parse_sources_affected"
CapabilityParseSourcesAffected names ParseSourcesRequest.base_model_hash and ParseSourcesResponse.affected: the documents whose results may differ from the base model's, so a client re-reads only those after an edit.
const CapabilityPerformer = "performer"
CapabilityPerformer names the `performer_symbol_id` field of ExecuteActionRequest and ExecuteStateRequest; a service without it runs outside any object, so clients must not send it.
const CapabilityQuery = "query"
CapabilityQuery names the capability of the Query RPC, which evaluates a SysML v2 API & Services Query over a parsed model.
const CapabilityRationalValues = "rational_values"
CapabilityRationalValues names the capability of carrying an exact Rational that is no Integer as Value.rational_value, Quantity.rational_magnitude and DocumentValue.rational_value, rather than as an unsupported null. A service without it reads the arm sent to it as null, so a client must not send one.
const CapabilityRenderDocument = "render_document"
CapabilityRenderDocument names the capability of the RenderDocument RPC, which renders a named document to Markdown.
const CapabilityRenderDocumentHTML = "render_document_html"
CapabilityRenderDocumentHTML names the capability of RenderDocumentRequest's form field, which asks RenderDocument for HTML instead of Markdown.
const CapabilityRenderView = "render_view"
CapabilityRenderView names the capability of the RenderView RPC, which renders a declared or targeted pseudo-view as machine-readable diagram data.
const CapabilityRequirementConstraintAuthoring = "requirement_constraint_authoring"
CapabilityRequirementConstraintAuthoring names the ApplyEdits add_requirement_constraint operation.
const CapabilitySatisfyAuthoring = "satisfy_authoring"
CapabilitySatisfyAuthoring names the ApplyEdits add_satisfy operation.
const CapabilitySchedule = "schedule"
CapabilitySchedule names the `schedule` field of ExecuteActionRequest, ExecuteStateRequest and RunAnalysisRequest, which selects the scheduling policy a run resolves its choice points under. A service without it runs every request under the default, so a client must not send the field to one.
const CapabilityScheduleExplore = "schedule_explore"
CapabilityScheduleExplore names the capability of answering a request under `explore[:runs=<n>,depth=<d>]` with `outcomes` and an `exploration` status.
const CapabilitySequenceAuthoring = "sequence_authoring"
CapabilitySequenceAuthoring names the ApplyEdits add_sequence operation.
const CapabilitySetValues = "set_values"
CapabilitySetValues names the capability of carrying a unique, unordered collection as Value.set, rather than reporting it as an unsupported null.
const CapabilityStateActionAuthoring = "state_action_authoring"
CapabilityStateActionAuthoring names state behavior member kinds.
const CapabilityStateTrace = "state_trace"
CapabilityStateTrace names the ExecuteState trace request field.
const CapabilityStrictConformance = "strict_conformance"
CapabilityStrictConformance names ParseFileRequest.strict_conformance, which asks whether the source is conforming SysML v2.
const CapabilityStructuredValues = "structured_values"
CapabilityStructuredValues names the capability of carrying an array, a vector and a vector quantity as Value.array, Value.vector and Value.vector_quantity, rather than reporting them as unsupported nulls.
const CapabilitySymbolAttributes = "symbol_attributes"
CapabilitySymbolAttributes names the capability of populating SymbolInfo.attributes, rather than always reporting none.
const CapabilityTensorValues = "tensor_values"
CapabilityTensorValues names the capability of carrying a tensor quantity of any rank as Value.tensor_quantity, rather than as an unsupported null.
const CapabilityTransitionAuthoring = "transition_authoring"
CapabilityTransitionAuthoring names the ApplyEdits add_transition operation.
const CapabilityTypeFacts = "type_facts"
CapabilityTypeFacts names the capability of populating SymbolInfo.type_info, .multiplicity and .specializations, which typed code generation requires.
const CapabilityUndeterminedValue = "undetermined_value"
CapabilityUndeterminedValue names the capability of carrying a result the model leaves open as Value.undetermined rather than as an unsupported null.
const CapabilityUnsetValue = "unset_value"
CapabilityUnsetValue names the capability of reporting a valueless feature of a value type as Value.unset, rather than as the empty object it materializes.
const CapabilityVerification = "verification"
CapabilityVerification names the capability of the verification RPCs, which answer the questions the REPL's %constraint, %requirement, %satisfy and %calc answer.
const CapabilityVerificationArguments = "verification_arguments"
CapabilityVerificationArguments names the `arguments` and `named_arguments` fields of VerifyConstraintRequest and VerifyRequirementRequest, which bind the checked element's `in` parameters as RunAnalysisRequest binds a case's.
const CapabilityVerificationObjectiveAuthoring = "verification_objective_authoring"
CapabilityVerificationObjectiveAuthoring names verification-case objective authoring.
const CapabilityVerificationQuestions = "verification_questions"
CapabilityVerificationQuestions names the `question` field of the verification requests — the solver questions "holds" and "satisfiable" — and the `question`, `status` and `witness` fields of every Verdict.
const CapabilityVerificationVerdicts = "verification_verdicts"
CapabilityVerificationVerdicts names the capability of reporting what the body of a verification case answered as VerificationVerdict, and of running a verification case through RunAnalysis.
const DefaultIndexPrewarm = 4
DefaultIndexPrewarm is the value IndexPrewarmEnvVar takes when unset: any positive value prewarms, since one library index now serves every model.
const DefaultMaxHeldEvents = 100000
DefaultMaxHeldEvents is the bound HeldEventsEnvVar takes when unset.
const DefaultMaxHeldObjects = 10000
DefaultMaxHeldObjects is the bound HeldObjectsEnvVar takes when unset.
const HeldEventsEnvVar = "OPENSYSML_GRPC_MAX_HELD_EVENTS"
HeldEventsEnvVar names the variable bounding the event records a cached population keeps for Events; the oldest are dropped and a query reaching them fails.
const HeldObjectsEnvVar = "OPENSYSML_GRPC_MAX_HELD_OBJECTS"
HeldObjectsEnvVar names the variable bounding the objects one cached model holds, nested objects counted: a materialization that would pass it fails whole, and the model leaving the cache releases them all.
const IndexPrewarmEnvVar = "OPENSYSML_GRPC_INDEX_POOL"
IndexPrewarmEnvVar names the variable saying whether the service builds the standard library index before the requests that need it. Zero disables prewarming, so the first request builds it. The legacy SYSML_GRPC_INDEX_POOL name remains accepted; the OPENSYSML_ name wins when both are set.
const SyntaxDiagnosticCode = parser.CodeSyntax
SyntaxDiagnosticCode is the code a parser error is reported under when the parser gave it none of its own.
Variables ¶
This section is empty.
Functions ¶
func Capabilities ¶
func Capabilities() []string
Capabilities returns the capability names this build of the service reports.
func DiagnosticToProto ¶
func DiagnosticToProto(diag diag.Diagnostic, sf *source.SourceFile) *pb.Diagnostic
DiagnosticToProto converts a diag.Diagnostic to protobuf.
func NewSymbolContext ¶
func NewSymbolContext(idx *symbols.Index) *symbolfacts.Context
NewSymbolContext builds the symbolfacts conversion context for cached-model symbols.
func ParserDiagnosticToProto ¶
func ParserDiagnosticToProto(diag parser.Diagnostic, sf *source.SourceFile) *pb.Diagnostic
ParserDiagnosticToProto converts a parser error to protobuf.
func QueryPropertyNames ¶
func QueryPropertyNames() []string
QueryPropertyNames returns every queryable property name, sorted. It is what an unknown-property error lists, and what docs/reference/api.md's table documents.
func RunNoteDiagnosticsToProto ¶
func RunNoteDiagnosticsToProto(notes []runtime.RunNote, model *CachedModel) []*pb.Diagnostic
RunNoteDiagnosticsToProto converts what a run noted about itself — its choice points and the guards it could not evaluate — to informational diagnostics, located in their model document; one outside the model carries no span.
func SymbolToProtoIn ¶
func SymbolToProtoIn(sym *symbols.Symbol, sc *symbolfacts.Context) *pb.SymbolInfo
SymbolToProtoIn converts a Symbol to protobuf SymbolInfo in an existing conversion context.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is an LRU cache for parsed models keyed by content hash
func NewCache ¶
NewCache creates a cache with the specified max size. It returns an error if maxSize is not positive.
func (*Cache) Add ¶
func (c *Cache) Add(hash string, model *CachedModel) *CachedModel
Add caches model under hash unless the hash is already cached, and returns the model cached under it: two parses of one model racing to the cache end up sharing the one entry, and the objects held on it, rather than replacing it.
func (*Cache) Get ¶
func (c *Cache) Get(hash string) (*CachedModel, bool)
Get retrieves a model from cache, returns (model, true) on hit
func (*Cache) Put ¶
func (c *Cache) Put(hash string, model *CachedModel)
Put adds a model to cache, evicting LRU if at capacity
type CachedDocument ¶
type CachedDocument struct {
Root *ast.RootNamespace
Source *source.SourceFile // For diagnostic line/col mapping
// ParseDiags are the parse's errors, for the consumers that refuse a
// document that did not parse.
ParseDiags []parser.Diagnostic
// Diagnostics are what the document reports, as the workspace reports a
// document's: the parse's errors and warnings as the passes present them,
// and the passes' own findings when the model parsed clean and was analyzed.
Diagnostics []diag.Diagnostic
Warnings []string
// contains filtered or unexported fields
}
CachedDocument is one parsed document of a model.
type CachedModel ¶
type CachedModel struct {
// Documents are the model's documents, at least one, in the order the parse
// request named them. They share Index, so a name one declares resolves in
// another and an import between them is satisfied.
Documents []*CachedDocument
Index *symbols.Index // For symbol lookups by FQN
Library libs.Source // the files the library in Index was built from, for their spans' text
// Mode is the conformance strictness the parse request asked for; an edit's
// notation is judged at the same strictness.
Mode diag.ConformanceMode
// contains filtered or unexported fields
}
CachedModel holds parsed model data with semantic analysis results
func (*CachedModel) DocumentRoots ¶
func (m *CachedModel) DocumentRoots() []*symbols.Scope
DocumentRoots are the root scopes of the model's documents, in order, skipping any the index does not hold.
func (*CachedModel) Primary ¶
func (m *CachedModel) Primary() *CachedDocument
Primary is the document a model is named by: the only one of a single-document model, and the first named of a multi-document one, whose root namespace is where a name with nothing else to resolve against is looked up.
func (*CachedModel) PrimaryRoot ¶
func (m *CachedModel) PrimaryRoot() *symbols.Scope
PrimaryRoot is the root scope of the document the model is named by.
func (*CachedModel) Semantics ¶
func (m *CachedModel) Semantics() (*runtime.Model, error)
Semantics is the model-derived runtime part as an analysis.Model builds one.
func (*CachedModel) SoleDocument ¶
func (m *CachedModel) SoleDocument() (*CachedDocument, error)
SoleDocument is the model's one document, for an operation defined on a single document's own source, such as writing it back out. A model of several documents is refused rather than answered about one of them.
func (*CachedModel) SymbolContext ¶
func (m *CachedModel) SymbolContext() *symbolfacts.Context
SymbolContext returns the conversion context for this model, building it on first use. Name resolution and the semantic relations derived from it are memoized in it, so every symbol converted from one cached model shares one.
type ConnectAdapter ¶
type ConnectAdapter struct {
// contains filtered or unexported fields
}
ConnectAdapter serves the same Service through the Connect handler signatures, so one implementation answers every protocol Connect speaks.
func NewConnectAdapter ¶
func NewConnectAdapter(svc *Service) *ConnectAdapter
NewConnectAdapter wraps a Service as a Connect handler.
func (*ConnectAdapter) ApplyEdits ¶
func (a *ConnectAdapter) ApplyEdits(ctx context.Context, req *connect.Request[pb.ApplyEditsRequest]) (*connect.Response[pb.ApplyEditsResponse], error)
ApplyEdits edits a parsed model's own source.
func (*ConnectAdapter) Convert ¶
func (a *ConnectAdapter) Convert(ctx context.Context, req *connect.Request[pb.ConvertRequest]) (*connect.Response[pb.ConvertResponse], error)
Convert writes a model out as SysML notation or RDF Turtle.
func (*ConnectAdapter) Evaluate ¶
func (a *ConnectAdapter) Evaluate(ctx context.Context, req *connect.Request[pb.EvaluateRequest]) (*connect.Response[pb.EvaluateResponse], error)
Evaluate evaluates an expression against a parsed model.
func (*ConnectAdapter) EvaluateCalc ¶
func (a *ConnectAdapter) EvaluateCalc(ctx context.Context, req *connect.Request[pb.EvaluateCalcRequest]) (*connect.Response[pb.EvaluateCalcResponse], error)
EvaluateCalc evaluates a calculation with the arguments given.
func (*ConnectAdapter) ExecuteAction ¶
func (a *ConnectAdapter) ExecuteAction(ctx context.Context, req *connect.Request[pb.ExecuteActionRequest]) (*connect.Response[pb.ExecuteActionResponse], error)
ExecuteAction runs an action to completion.
func (*ConnectAdapter) ExecuteState ¶
func (a *ConnectAdapter) ExecuteState(ctx context.Context, req *connect.Request[pb.ExecuteStateRequest]) (*connect.Response[pb.ExecuteStateResponse], error)
ExecuteState runs a state machine over the events given.
func (*ConnectAdapter) ExportGraphs ¶ added in v0.10.0
func (a *ConnectAdapter) ExportGraphs(ctx context.Context, req *connect.Request[pb.ExportGraphsRequest]) (*connect.Response[pb.ExportGraphsResponse], error)
ExportGraphs exports the lowered graph of an action or state machine as graphs:1 JSON.
func (*ConnectAdapter) GetDiagnostics ¶
func (a *ConnectAdapter) GetDiagnostics(ctx context.Context, req *connect.Request[pb.DiagnosticsRequest]) (*connect.Response[pb.DiagnosticsResponse], error)
GetDiagnostics returns the diagnostics of a parsed model.
func (*ConnectAdapter) GetServerInfo ¶
func (a *ConnectAdapter) GetServerInfo(ctx context.Context, req *connect.Request[pb.ServerInfoRequest]) (*connect.Response[pb.ServerInfoResponse], error)
GetServerInfo reports what this build of the service can do.
func (*ConnectAdapter) GetSymbol ¶
func (a *ConnectAdapter) GetSymbol(ctx context.Context, req *connect.Request[pb.GetSymbolRequest]) (*connect.Response[pb.SymbolResponse], error)
GetSymbol returns symbol information by qualified name.
func (*ConnectAdapter) Instantiate ¶
func (a *ConnectAdapter) Instantiate(ctx context.Context, req *connect.Request[pb.InstantiateRequest]) (*connect.Response[pb.InstantiateResponse], error)
Instantiate materializes an instance of a definition.
func (*ConnectAdapter) ListEngines ¶
func (a *ConnectAdapter) ListEngines(ctx context.Context, req *connect.Request[pb.ListEnginesRequest]) (*connect.Response[pb.ListEnginesResponse], error)
ListEngines lists the analysis engines this build registers.
func (*ConnectAdapter) Migrate ¶ added in v0.10.0
func (a *ConnectAdapter) Migrate(ctx context.Context, req *connect.Request[pb.MigrateRequest]) (*connect.Response[pb.MigrateResponse], error)
Migrate writes a SysML v1 model out as a v2 one, with the report of what became of every v1 element.
func (*ConnectAdapter) ParseFile ¶
func (a *ConnectAdapter) ParseFile(ctx context.Context, req *connect.Request[pb.ParseFileRequest]) (*connect.Response[pb.ParseFileResponse], error)
ParseFile parses a model and returns its hash.
func (*ConnectAdapter) ParseSources ¶
func (a *ConnectAdapter) ParseSources(ctx context.Context, req *connect.Request[pb.ParseSourcesRequest]) (*connect.Response[pb.ParseSourcesResponse], error)
ParseSources parses several documents as one model.
func (*ConnectAdapter) Query ¶
func (a *ConnectAdapter) Query(ctx context.Context, req *connect.Request[pb.QueryRequest]) (*connect.Response[pb.QueryResponse], error)
Query evaluates a SysML v2 API & Services Query over a parsed model.
func (*ConnectAdapter) RenderDocument ¶
func (a *ConnectAdapter) RenderDocument(ctx context.Context, req *connect.Request[pb.RenderDocumentRequest]) (*connect.Response[pb.RenderDocumentResponse], error)
RenderDocument renders a named document to Markdown.
func (*ConnectAdapter) RenderView ¶ added in v0.10.0
func (a *ConnectAdapter) RenderView(ctx context.Context, req *connect.Request[pb.RenderViewRequest]) (*connect.Response[pb.RenderViewResponse], error)
RenderView renders a named view or targeted pseudo-view as diagram data.
func (*ConnectAdapter) RunAnalysis ¶
func (a *ConnectAdapter) RunAnalysis(ctx context.Context, req *connect.Request[pb.RunAnalysisRequest]) (*connect.Response[pb.RunAnalysisResponse], error)
RunAnalysis runs an analysis case with the subject and arguments given.
func (*ConnectAdapter) RunDocumentQuery ¶
func (a *ConnectAdapter) RunDocumentQuery(ctx context.Context, req *connect.Request[pb.RunDocumentQueryRequest]) (*connect.Response[pb.RunDocumentQueryResponse], error)
RunDocumentQuery runs a named document query and answers with typed rows.
func (*ConnectAdapter) RunSweep ¶
func (a *ConnectAdapter) RunSweep(ctx context.Context, req *connect.Request[pb.RunSweepRequest]) (*connect.Response[pb.RunSweepResponse], error)
RunSweep runs one analysis case or calc once per row of a parameter sweep.
func (*ConnectAdapter) ValidateInstance ¶
func (a *ConnectAdapter) ValidateInstance(ctx context.Context, req *connect.Request[pb.ValidateInstanceRequest]) (*connect.Response[pb.ValidateInstanceResponse], error)
ValidateInstance checks every assertion about an object and the objects it holds.
func (*ConnectAdapter) VerifyConstraint ¶
func (a *ConnectAdapter) VerifyConstraint(ctx context.Context, req *connect.Request[pb.VerifyConstraintRequest]) (*connect.Response[pb.VerifyConstraintResponse], error)
VerifyConstraint evaluates a constraint and returns its verdict.
func (*ConnectAdapter) VerifyRequirement ¶
func (a *ConnectAdapter) VerifyRequirement(ctx context.Context, req *connect.Request[pb.VerifyRequirementRequest]) (*connect.Response[pb.VerifyRequirementResponse], error)
VerifyRequirement evaluates a requirement and returns its verdict.
func (*ConnectAdapter) VerifySatisfaction ¶
func (a *ConnectAdapter) VerifySatisfaction(ctx context.Context, req *connect.Request[pb.VerifySatisfactionRequest]) (*connect.Response[pb.VerifySatisfactionResponse], error)
VerifySatisfaction evaluates satisfaction relationships in a model.
type Option ¶
type Option func(*serviceOptions)
Option adjusts how NewService builds a service.
func ServeExternalEngines ¶
ServeExternalEngines names the manifest engines the service runs, as -serve-external-engines does; `all` names every one. Without it every manifest engine is listed but not served.
type QueryError ¶
type QueryError struct {
Kind QueryErrorKind
Message string
}
QueryError is a query the service refuses to evaluate. It reports itself as INVALID_ARGUMENT, since every kind is a fault in the query, not in the model.
func (*QueryError) Error ¶
func (e *QueryError) Error() string
type QueryErrorKind ¶
type QueryErrorKind int
QueryErrorKind classifies why a query could not be evaluated. Every kind fails the call: answering with no elements would read as "nothing matched".
const ( // QueryErrUnknownProperty is a property no queryable property names. QueryErrUnknownProperty QueryErrorKind = iota + 1 // QueryErrMalformedConstraint is a constraint with no form, no operator or // no operand. QueryErrMalformedConstraint // QueryErrUnorderedProperty is > or < on a property that is not ordered. QueryErrUnorderedProperty // QueryErrUnparsableValue is an operand the operator cannot compare. QueryErrUnparsableValue // QueryErrUnknownScope is a scope naming an element the model does not have. QueryErrUnknownScope )
type Service ¶
type Service struct {
pb.UnimplementedSysMLServiceServer
// contains filtered or unexported fields
}
Service implements SysMLServiceServer
func NewService ¶
NewService creates a gRPC service with specified cache size, reporting version as its build version. It returns an error if cacheSize is not positive, if a budget variable, OPENSYSML_JOBS, OPENSYSML_GRPC_MAX_HELD_OBJECTS or OPENSYSML_GRPC_MAX_HELD_EVENTS holds anything but a positive integer, if the prewarm setting is not a non-negative integer, or if a manifest or a name given to ServeExternalEngines is wrong. It does not load the standard library: call Prewarm to have that happen in the background, ahead of the requests that need it.
func NewServiceWithUnavailableCapabilitiesForTesting ¶
func NewServiceWithUnavailableCapabilitiesForTesting(cacheSize int, version string, unavailable []string, opts ...Option) (*Service, error)
NewServiceWithUnavailableCapabilitiesForTesting creates a service that deliberately lacks named capabilities for conformance testing.
func (*Service) ApplyEdits ¶
func (s *Service) ApplyEdits(ctx context.Context, req *pb.ApplyEditsRequest) (*pb.ApplyEditsResponse, error)
ApplyEdits edits the source a model was parsed from and returns the edited notation, so a client can change a model and write it back with its comments and layout intact. A model of several documents is edited as one, for a request that accepts documents: the operations target the document the request names, a rename or cascade delete follows references into every other, and the response carries each document the edits rewrote, or none when they were refused. A request not accepting documents is refused on such a model, since it reads only content. Argument faults fail the call; an edit the engine refuses is reported in the response's error, failure kind and diagnostics. Without the edit_documents capability the service answers as one predating documents: a model of several is refused, a named document is refused with UNIMPLEMENTED, and the response carries content alone.
func (*Service) Close ¶
func (s *Service) Close()
Close waits for a background library build in flight and releases the service's reference to the shared index. The service still answers afterwards, building the library on the request that needs it.
func (*Service) Convert ¶
func (s *Service) Convert(ctx context.Context, req *pb.ConvertRequest) (*pb.ConvertResponse, error)
Convert writes a model in another representation, so a client can save a model it read rather than only inspect it. Argument faults fail the call; a model the converter refuses is reported in the response's error and diagnostics.
func (*Service) Evaluate ¶
func (s *Service) Evaluate(ctx context.Context, req *pb.EvaluateRequest) (*pb.EvaluateResponse, error)
Evaluate evaluates a SysML expression in the context of a parsed model
func (*Service) EvaluateCalc ¶
func (s *Service) EvaluateCalc(ctx context.Context, req *pb.EvaluateCalcRequest) (*pb.EvaluateCalcResponse, error)
EvaluateCalc invokes a calculation, as the REPL's %calc does: a calc usage named with no arguments is evaluated from its own members and reports every output feature it computes (SysML 7.17); anything else is invoked with the arguments given, bound positionally.
func (*Service) ExecuteAction ¶
func (s *Service) ExecuteAction(ctx context.Context, req *pb.ExecuteActionRequest) (*pb.ExecuteActionResponse, error)
ExecuteAction executes an action definition
func (*Service) ExecuteState ¶
func (s *Service) ExecuteState(ctx context.Context, req *pb.ExecuteStateRequest) (*pb.ExecuteStateResponse, error)
ExecuteState executes a state machine
func (*Service) ExportGraphs ¶ added in v0.10.0
func (s *Service) ExportGraphs(ctx context.Context, req *pb.ExportGraphsRequest) (*pb.ExportGraphsResponse, error)
ExportGraphs exports the lowered graph of an action or state machine, and of every behavior it performs, as the canonical `graphs:1` JSON an external engine is sent. An unknown subject is NOT_FOUND; one that is no behavior, or a name several elements share, is INVALID_ARGUMENT.
func (*Service) GetDiagnostics ¶
func (s *Service) GetDiagnostics(ctx context.Context, req *pb.DiagnosticsRequest) (*pb.DiagnosticsResponse, error)
GetDiagnostics retrieves all diagnostics for a parsed model (parser + semantic passes)
func (*Service) GetServerInfo ¶
func (s *Service) GetServerInfo(ctx context.Context, req *pb.ServerInfoRequest) (*pb.ServerInfoResponse, error)
GetServerInfo reports the service's build version and capabilities. A service too old to have this RPC fails the call with UNIMPLEMENTED, which is itself the answer that it predates every capability.
func (*Service) GetSymbol ¶
func (s *Service) GetSymbol(ctx context.Context, req *pb.GetSymbolRequest) (*pb.SymbolResponse, error)
GetSymbol retrieves symbol information by FQN
func (*Service) Instantiate ¶
func (s *Service) Instantiate(ctx context.Context, req *pb.InstantiateRequest) (*pb.InstantiateResponse, error)
Instantiate creates a runtime instance of a part/usage
func (*Service) ListEngines ¶
func (s *Service) ListEngines(_ context.Context, _ *pb.ListEnginesRequest) (*pb.ListEnginesResponse, error)
ListEngines lists the engines this build registers, in name order.
func (*Service) Migrate ¶ added in v0.10.0
func (s *Service) Migrate(ctx context.Context, req *pb.MigrateRequest) (*pb.MigrateResponse, error)
Migrate writes a SysML v1 model as a v2 one, with the account of what became of every v1 element that makes the migration a migration rather than a conversion. Argument faults fail the call; a model the migrator refuses is reported in the response's error, as Convert reports one.
func (*Service) OpenSession ¶
OpenSession opens a session over a cached model, holding one of the model's workers until the session is closed.
func (*Service) ParseFile ¶
func (s *Service) ParseFile(ctx context.Context, req *pb.ParseFileRequest) (*pb.ParseFileResponse, error)
ParseFile parses a SysML file and caches the result
func (*Service) ParseSources ¶
func (s *Service) ParseSources(ctx context.Context, req *pb.ParseSourcesRequest) (*pb.ParseSourcesResponse, error)
ParseSources parses several documents as one model, so a name one document declares resolves in another.
func (*Service) Prewarm ¶
func (s *Service) Prewarm()
Prewarm starts building the service's standard library index in the background, so the first model to arrive is not the one that pays for the library. It returns immediately and is safe to call more than once.
func (*Service) Query ¶
func (s *Service) Query(ctx context.Context, req *pb.QueryRequest) (*pb.QueryResponse, error)
Query evaluates a SysML v2 API & Services Query against a parsed model.
func (*Service) RenderDocument ¶
func (s *Service) RenderDocument(ctx context.Context, req *pb.RenderDocumentRequest) (*pb.RenderDocumentResponse, error)
RenderDocument renders a named document to Markdown or HTML, as -render-document does.
func (*Service) RenderView ¶ added in v0.10.0
func (s *Service) RenderView(ctx context.Context, req *pb.RenderViewRequest) (*pb.RenderViewResponse, error)
RenderView renders a declared view or targeted pseudo-view as diagram data.
func (*Service) RunAnalysis ¶
func (s *Service) RunAnalysis(ctx context.Context, req *pb.RunAnalysisRequest) (*pb.RunAnalysisResponse, error)
RunAnalysis runs an analysis case, as the REPL's %analysis does: the subject named is instantiated and bound, the arguments bind the case's inputs, and the response carries every output with the verdict of each objective and assertion (SysML 7.22).
func (*Service) RunDocumentQuery ¶
func (s *Service) RunDocumentQuery(ctx context.Context, req *pb.RunDocumentQueryRequest) (*pb.RunDocumentQueryResponse, error)
RunDocumentQuery runs a named document query with parameter bindings, the answer %run-query gives, as typed rows rather than formatted lines.
func (*Service) RunSweep ¶
func (s *Service) RunSweep(ctx context.Context, req *pb.RunSweepRequest) (*pb.RunSweepResponse, error)
RunSweep runs one analysis case or calc once per row of a parameter sweep, as the CLI's -sweep and the REPL's %sweep do: every row is an ordinary run, in a context of its own, with the swept parameters bound to that row's values. A run that failed is that row's error; only a plan that no run follows from fails the table. The request's subject and arguments are read once on the request's runtime, which answers one that cannot be read, and again in every row's, which is what the row's run binds.
func (*Service) ValidateInstance ¶
func (s *Service) ValidateInstance(ctx context.Context, req *pb.ValidateInstanceRequest) (*pb.ValidateInstanceResponse, error)
ValidateInstance checks every assertion about an object of the part named and the objects it holds, reporting one verdict per assertion beside a summary for the object.
func (*Service) VerifyConstraint ¶
func (s *Service) VerifyConstraint(ctx context.Context, req *pb.VerifyConstraintRequest) (*pb.VerifyConstraintResponse, error)
VerifyConstraint evaluates a constraint definition or usage, as the REPL's %constraint does.
func (*Service) VerifyRequirement ¶
func (s *Service) VerifyRequirement(ctx context.Context, req *pb.VerifyRequirementRequest) (*pb.VerifyRequirementResponse, error)
VerifyRequirement evaluates a requirement definition or usage, as the REPL's %requirement does.
func (*Service) VerifySatisfaction ¶
func (s *Service) VerifySatisfaction(ctx context.Context, req *pb.VerifySatisfactionRequest) (*pb.VerifySatisfactionResponse, error)
VerifySatisfaction evaluates the satisfaction assertions a model states, as the REPL's %satisfy does: every one, or, given a symbol, the ones that element states — or that element itself when it is a named satisfy assertion.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is one retained run of a cached model: a runtime context of its own, with its clock, its scheduling policy and the objects it instantiated, that successive calls read and move along. It is the engine behind the public client's in-process session and exists only there; it has no RPC.
func (*Session) Accepts ¶
func (ss *Session) Accepts(object int64, signalID string, args map[string]*pb.Value) (*SessionAcceptance, error)
Accepts decides what dispatching the signal to the object now would do, without dispatching it.
func (*Session) ActiveStates ¶
ActiveStates names the innermost active states of every machine the object exhibits, machine by machine in declaration order; the composite states enclosing them are active too.
func (*Session) Advance ¶
func (ss *Session) Advance(seconds float64) (*SessionAdvance, error)
Advance moves the session's clock by seconds, dispatching what is due.
func (*Session) Close ¶
func (ss *Session) Close()
Close releases the session's worker; a closed session refuses every call.
func (*Session) Evaluate ¶
Evaluate evaluates one expression in the scope of the named declaration, or of the model's primary document when none is named, against the session's state.
func (*Session) FeatureValue ¶
FeatureValue reads one feature of an object the session holds.
func (*Session) Instantiate ¶
Instantiate instantiates the named part or usage in the session, starting the behaviors it exhibits, and answers the object's id.
func (*Session) Members ¶
func (ss *Session) Members(symbolID string) ([]SessionMember, error)
Members lists the named members the named declaration's scope holds, in declaration order.
func (*Session) Perform ¶
func (ss *Session) Perform(object int64, actionID string, inputs map[string]*pb.Value) (*SessionPerformance, error)
Perform performs the named action on the object with the inputs, running it to completion, and reports what the run made and decided.
func (*Session) Send ¶
func (ss *Session) Send(object int64, signalID string, args map[string]*pb.Value) (*SessionAcceptance, error)
Send posts the signal to the object, refusing one no machine would take or one every taking machine would drop; Advance then dispatches it.
func (*Session) SetFeatureValue ¶
SetFeatureValue writes one feature of an object the session holds.
func (*Session) SetSchedule ¶
SetSchedule makes the session's later turns follow the scheduling policy: the actions it performs from now on, and the machines and clock it already drives from their next step on.
func (*Session) Transitions ¶
func (ss *Session) Transitions(object int64) ([]SessionTransition, error)
Transitions lists the transitions dispatch could select now in every machine the object exhibits: out of each active state and then of each state enclosing it, innermost first, in declaration order.
type SessionAcceptance ¶
type SessionAcceptance struct {
// Accepted reports whether a transition of a taking machine is triggered by
// the signal, whatever its guard.
Accepted bool
Fires []SessionTransition
Resumes []string
}
SessionAcceptance is what dispatching a signal to an object now would do, read from the machines delivery would let take it; where several would, the schedule's due order decides which consumes it.
func (SessionAcceptance) Enabled ¶
func (a SessionAcceptance) Enabled() bool
Enabled reports whether dispatching the signal would do something with it: fire or resume.
func (SessionAcceptance) Taken ¶
func (a SessionAcceptance) Taken() bool
Taken reports whether a machine of the object would take the signal at all, be it to fire, resume, or drop it because every guard is false.
type SessionAdvance ¶
type SessionAdvance struct {
From, To float64
Events int64
Steps int64
Choices []SessionChoice
Diagnostics []*pb.Diagnostic
}
SessionAdvance is what advancing a session's clock reported.
type SessionBranch ¶
SessionBranch is one way a performance left a decision of the action's own flow.
type SessionChoice ¶
SessionChoice is one choice a run made, copied from the runtime's note.
type SessionFailure ¶
type SessionFailure struct {
Message string
Diagnostics []*pb.Diagnostic
}
SessionFailure is a session call the model answered with a failure — a name it does not declare, a run that failed — as distinct from a status the session refuses the call with.
func (*SessionFailure) Error ¶
func (f *SessionFailure) Error() string
type SessionMember ¶
SessionMember is one named member a declaration's scope holds.
type SessionPerformance ¶
type SessionPerformance struct {
Outputs map[string]*pb.Value
Choices []SessionChoice
Branches []SessionBranch
Diagnostics []*pb.Diagnostic
}
SessionPerformance is what performing an action in a session reported.
type SessionTransition ¶
type SessionTransition struct {
Name string
Source string
Target string
Trigger string
Signal string
Event string
Guarded bool
}
SessionTransition is one transition of a state machine as a session reports it: its ends and trigger by name, no node of the graph it was lowered to.