Repository navigation
[Add] Property query extension methods and their Handlebars helpers; refs #511 - #516
Merged
Merged
Conversation
|
4 of 20 tasks
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.



Refs #511 (group 2 of 3: Property and Operation)
Changes
New extension methods in
uml4net.Extensions:IProperty.QueryIsEnumPropertyWithDefaultValue(): the property is typed by an enumeration and its default value is an instance value that refers to an enumeration literal.IProperty.QueryIsPartOfNonDerivedCompositeAggregation(): the property is composite and not derived, or its opposite is.IProperty.QueryConstraints(): the rules of the namespace that owns the property which have the property as constrained element, in the order of the owned rules.New Handlebars helpers in
uml4net.HandleBars, each with the property as its one argument:Property.QueryIsEnumPropertyWithDefaultValueProperty.QueryIsPartOfNonDerivedCompositeAggregationProperty.QueryConstraintsWhere the methods come from
QueryIsEnumPropertyWithDefaultValueQueryIsPartOfNonDerivedCompositeAggregationQueryPropertyIsPartOfNonDerivedCompositeAggregation)QueryConstraintsQueryOwnedConstraints)derive{Class}{Property}when no constraint has the property as constrained element; that is a naming convention of the SysML v2 model and stays in SysML2.NET.Rejected, as recorded in #511:
IProperty.QueryIsManyToManyof EORSADB (identical toQueryIsMemberOfManyToMany) andIOperation.QueryOwnedConstraintsof SysML2.NET (returnsoperation.OwnedRule).A deviation from the plan in #511
The comment in #511 says
QueryIsPartOfNonDerivedCompositeAggregationwould be built onQueryIsContainmentandQueryIsContained. It is not.QueryIsContainmentalso returns true when the association of the property has a composite owned end, which would change the result for SysML2.NET. The method follows the source: it looks atProperty::isCompositeof the property and of its opposite.Tests
PropertyExtensionsTestFixture: three tests, againstUML.xmiand against elements built in the test, including the null argument.PropertyHelperTestFixture: one test for each new helper, including a wrong argument and a wrong number of arguments.Not in this pull request
🤖 Generated with Claude Code