2022-09 - SysML v2 Pilot Implementation
This is an incremental update to the 2022-08 release. It corresponds to Eclipse plugin version 0.28.1.
Language Features
KerML and SysML
-
Library packages. The keyword
librarycan be used to identify a package as a library package, e.g.,library packageDynamicsModelLibrary { ... }. Further prefixing a library package declaration with the keywordstandardidentifies it as a standard library package. However,standardshould only be used to identify library packages that are part of the standard KerML and SysML model libraries (i.e., those in thesysml.libraryproject in the pilot implementation), or other accepted standard model libraries in the future.
[PR #416] -
Metadata access. A metadata access expression has the form
elementName.metadata, whereelementNameis a qualified name for any kind of element. Such an expression evaluates to a sequence of instances of the reflective metaclassKerML::Metaclassrepresenting the owned metadata feature annotations of the named element, in order. In addition, the last element of the sequence is always an instance of the reflective abstract syntax metaclass for the named element representing the instantiation of the element in the model.For example, given the model
import RiskMetadata::*; part def SystemDesign { metadata Risk { totalRisk = RiskLevelEnum::medium; } }The expression
SystemDesign.metadataevaluates to a sequence of two values, the first of which is an instance of the metadata definitionRiskMetadata::Risk, and the second of which is an instance ofSysML::PartDefinition. The following operators are convenient for operating on such sequences of metadata:elementName@@Metaclassis a shorthand forelementName.metadata@Metaclass. It tests whether any of the metadata of the named element is a direct or indirect instance ofMetaclass. For example, given the above sample model, the expressionsSystemModel @@ RiskandSystemModel @@ SysML::Definitionboth evaluate to true.elementNamemetaMetaclassis a shorthand forelementName.metadata asMetaclass. It filters the metadata of the named element for only those that are instances ofMetaclass. This is useful for accessing the values of features of the metadata. For example, given the above sample model,(SystemDesignmetaRisk).totalRisk.probabilityevaluates toLevelEnum::mediumand(SystemDesignmetaKerML::Element).nameevaluates to"SystemDesign"(note that the parentheses are required, due tometahaving the operator precedence of a binary operator).
[PR #416]
-
"Same" operator. The
===operator checks if two occurrences are portions of the same life (i.e., have the same "identity"). The operator!==is the inverse of===. For example, given the modelpart car { timeslice drivenByAlice; then timeslice drivenByBob; }the expression
car.drivenByAlice == car.drivenByBobevaluates to false, because the two timeslices are different occurrences, butcar.drivenByAlice === car.drivenByBobevaluates to true, because the two timeslices are both portions of the life of the samecar. For data values (i.e., non-occurrences), the===operator is the same as==.Implementation Note: Expression evaluation in the pilot implementation currently does not implement the functionality of
===and!==and simply treats them the same as==and!=.
[PR #417]
SysML Only
-
Conjugated port typing. While the notation for conjugated port typing has not changed, the way the conjugated port definition is resolved has changed. Previously, in a declaration such as
portp : ~P;, the conjugated port typing was a relationship between the port usagepand the port definitionP, with the actual conjugated port definition being derived as the one owned byP. Now, the conjugated port typing relationship is instead between the port usage and the actual conjugated port definition, which is found by resolving the constructed qualified nameP::'~P'. The corresponding port definitionPis now a derived property of the conjugated port typing, determined as the owning port definition of the conjugated port definition.
[PR #416] -
Send action. Send action syntax has been extended to include a new
viaclause:sendpayloadviasendertoreceiver;. This allows for arguments for both thesender(via) andreceiver(to) parameters ofSendAction(see also the model library update description below). While having bothviaandtois allowed, it is expected that generally only one or the other will be used, withviabeing used to send "out" through a port (parallel to the use ofviaon an accept action for accept "in" through a port).
[PRs #410, #416] -
Messages. The parsing of message declarations has changed. A declaration of the form
message fromsourceEventtotargetEvent;still parses to a connection usage, but without connection ends. Instead, it redefinesTransfer::sourceEventandTransfer::targetEventto reference the givensourceEventandtargetEvent, respectively (see also model library update description below). This allows such a message to be realized by either a message connection in which thesourceEventis a send action and thetargetEventis an accept action, or a flow connection, such as between two ports, in which case thesourceandtargetports are also thesourceEventandtargetEvent.
[PR #410]
Model Libraries
General
-
Library packages. All standard model library packages are now declared as
standard library package.
[PR #416] -
Reflection. The reflective abstract syntax models
KerMLandSysMLnow include all navigable properties from the normative MOF abstract syntax model as features of the corresponding metaclasses/metadata definitions.
[PR #408]
Kernel Semantic Library
- Event handling. Updated the models
Occurrences,Performances,Transfers,TransitionPerformancesandStatePerformancesto capture semantics related to event handling, including prioritized dispatch, accept matching and run-to-completion.
[PR #410]
Kernel Functions Library
-
Base and data functions.
- Added the abstract function
'==='toBaseFunctions, for use as the function invoked by the===operator. Added the function'!=='as the opposite of'==='and the function invoked by the!==operator. - Added a specialization of
BaseFunctions::'==='for data values toDataFunctions, for which it is the same as'=='.
[PR #417]
- Added the abstract function
-
Sequence functions. Added the following new functions to
SequenceFunctions.samecompares whether two sequences are the same using===(as opposed toequals, which uses==).includingAtreturns a sequence of values constructed from two input sequences by adding the second sequence at a given index in the first sequence.excludingAtreturns a sequence of values containing all the values from an input sequence except those within a given range of indices (inclusive).
Added the following behaviors for convenient "standalone" modification of a sequence given with an
inoutparameter:addadds a sequence of values to the end of the input sequence (usingincluding).addAtadds a sequence of values at a given index of the input sequence (usingincludingAt).removeremoves a set of values from the input sequence (usingexcluding).removeAtremoves the values within a given range of indexes (inclusive) of the input sequence (usingexcludingAt).
[PR #417]
-
Occurrence functions. Added a new
OccurrenceFunctionspackage that defines functions that operate on occurrences, primarily related to the time during which those occurrences exist.'==='specializesBaseFunctions::'==='for occurrences. It tests whether two occurrences are portions of the same life. That is, whether they represent different portions of the same entity (colloquially, whether they have the same "identity").isDuringtests whether a performance of the function happens during the input occurrence.createensures that the start of a given occurrence happens during a performance of this function. The occurrence is also returned from the function.destroyensures that the end of a given occurrence happens during a performance of this function. The occurrence is also returned from the function.addNewadds a newly created occurrence to the given group of occurrences and returns the new occurrence.addNewAtadds a newly created occurrence to the given ordered group of occurrences at the given index and returns the new occurrence.removeOldremoves a given occurrence from a group of occurrences and destroys it.removeOldAtremoves the occurrence at a given index in an ordered group of occurrences and destroys it.
[PR #417]
Systems Library
-
Connections.
- Added
MessageConnectionas the most general base type for connection definitions and usages, withFlowConnectionas specialization ofMessageConnection. - Added the features
sourceEventandtargetEventtoMessageConnectionto identify the events occurrences within thesourceandtargetof the connection that create and accept the connection as a transfer, e.g., a source send action and a target accept action. For non-message flow connection usages,sourceEventandtargetEventdefault tosourceandtarget.
[PR #410]
- Added
-
Actions.
- Made
SendActiona specialization of the newTransfers::SendPerformancebehavior, which means it inherits a newsenderparameter. The argument for this parameter is set using the newviaclause in thesendnotation (see above). - Added
AcceptMessageActionas a specialization of the newTransfers::AcceptPerformancebehavior, withAcceptActionnow a specialization ofAcceptMessageAction.AcceptActionis still the base type for all accept action usages other than theaccepteractions ofTransitionActions. - Changed the type of
TransitionAction::acceptertoAcceptMessageAction.
[PR #410]
- Made
Backward Incompatibilities
-
Reserved words. Added:
library meta standard -
Classification operators. The
istype,hastypeand@operators have been extended to allow arguments with more than one value. Theistypeandhastypetest whether all the argument values have the given type (either directly or indirectly foristype, or just directly forhastype). The@operator, on the other hand, tests if any of the argument values have the given type (directly or indirectly). Note that this means thatistypeandhastypeare always true fornull(the empty sequence), while@is always false.
[PR #416] -
Meta-casting. Previously, a cast expression of the form
featureRefasMetaclasscould be used to "meta-cast" the referenced feature to the given metaclass. This will now generate a warning and always evaluate to null (unless, of course, the type of the referenced feature really conforms to the given the metaclass). The same functionality can now be realized by replacing theasoperator with the newmetaoperator (see above).
[PR #416] -
Send via ports. Previously, a send action of the form
sendpayloadtoport;was used to send a payload out through a port. This will now generate a warning that port usages should generally not be "receiver" targets of send actions. Instead, use the new formsendpayloadviaport;.
[PR #410]
Jupyter
- Expression evaluation. A new
%evalmagic command has been added that evaluates an expression, optionally in the context of a given model target. This is a preliminary capability that does not yet fully implement all the standard library functions beyond those required for operator evaluation. It also operates only on the static model definition and does not implement dynamic execution over time. However, it does implement metadata access and evaluation of user-defined functions (calculations).
[PRs #403, #405]
Visualization
-
PlantUML
- Expression evaluation. The PlantUML visualization now has an
EVALstyle that visualizes the results of evaluating feature values, when possible (in Eclipse, select "Evaluate expressions" from the style menu). TheEVALstyle can also be used with theSHOWINHERITEDstyle to visualize the evaluation of inherited features, properly accounting for any redefinition of features referenced in the evaluated expression.
[PR #403] - Bug fixes. See below.
- Expression evaluation. The PlantUML visualization now has an
-
Tom Sawyer
- Fixed the visualization of proxy connection points.
Technical Updates
- isLibraryModel. The
SysMLLibraryUtil::isLibraryModelmethod is now deprecated. Instead, use theElement::isLibraryElementmethod to check if an element is a library element. To check if an element is a standard library element, use theElementUtil::isStandardLibraryElementmethod. (This utility method checks that the element has a library namespace that is a library package and that this library package is a standard library package.) - org.omg.sysml.execution. A new
org.omg.sysml.executionproject has been added. This project is intended to eventually contain the implementation of a general model execution capability. Currently, it has only theorg.omg.sysml.execution.expressionpackage, which extends the model-level expression evaluation capability to handle the (non-model-level) evaluation of user-defined functions.
Bug Fixes
-
Name resolution. Fixed a bug that could prevent proper name resolution of the last library model loaded in Jupyter.
[PR #402] -
ItemFlow itemType. Prevented a possible null pointer exception when calling
ItemFlow.getItemType.
[PR #400] -
ItemFlow itemFlowFeature. Fixed the implementation of
ItemFlow.getItemFlowFeature, which had broken in 2022-08.
[PR #407] -
Flow connection visualization. Fixed the visualization of flow connection usages in PlantUML.
[PR #401] -
Specialization visualization. Fixed the visualization of specialization with SHOWINHERITED style in PlantUML.
[PR #404] -
Sequence diagram visualization. Fixed the rendering of sequence diagrams in PlantUML, which had broken recently.
[PR #413] -
Feature value visualization. Added rendering of the feature value expressions in usages represented as symbols in PlantUML.
[PR #411] -
JSON serialization. Fixed a bug in the model traversal algorithm that was preventing serialization of "owner" properties in some cases.
[PR #415]