SysML v2 Projects
Textual Representations
A textual representation writes an element in another language: rep language "Python" /* … */ in the element's body. Holarch keeps the body as text and never runs it.
- Bodies in
"sysml"or"kerml"are checked: they must parse and declare the element they represent. A constraint or calculation may be written as an expression, such asrep language "sysml" /* speed <= limit */, which is evaluated like one written directly. - The Text page highlights SysML and KerML bodies as code. Other known languages (OCL, Alf, Python, JavaScript, MATLAB, Modelica, C, natural language) show as comment text; an unknown language gets a note.
- In the inspector, the Representation section shows each representation's Language and body. Click Add Representation to add one, Remove to delete one. A body cannot contain
*/. - The Action Flow view shows the language in braces on an action whose definition has a representation, such as {Python}.
- In the Hybrid Car demo,
DriveWheelshas a Python representation andSpeedLimita SysML one.
Full documentation: SysML v2 Textual Notation › Textual representations