Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Appendix F: Reading OpenSysML Diagnostics

A diagnostic has a severity, a location, a message and an implementation-specific code. A language rule may have a different name in the OMG specification. Never change a valid model simply to match a code copied from another tool.

Start at the source location

Consider a deliberately faulty model:

package Broken {
    private import ScalarValues::*;
    part def Machine { part brewer : Brewwer; }
}

Save it as broken.sysml. sysml -strict -validate broken.sysml reports import-visibility on the import and unresolved on the type reference. First use private import ScalarValues::*; (or omit this unused import); then declare Brewer and correct the spelling. A visibility prefix does not make a nonexistent type exist. This is a negative example; it is not an exercise that should pass unmodified.

Look up the installed vocabulary

sysml -explain import-visibility
sysml -explain unresolved
sysml -explain incommensurable-binding

With no code, sysml -explain lists the catalog. nonstandard-notation identifies syntax the tool accepts beyond the specification in its normal mode; strict mode promotes this finding to an error. filter-not-evaluated signals a limitation of evaluation, not a successful decision that all members meet a predicate.

Use diagnostics in review

Use sysml -strict -validate -json src/examples/coffee-machine for machine-readable diagnostics. Inspect the exit status and severity; the absence of text on stdout is not proof of success. When a check did not run because the model failed to load, do not report a verification failure against the system itself. Reduce an unexpected result to a small model, retain the tool version and relevant clause, and distinguish a questionable implementation result from a modeling error.