From ba7af61d75313be48007dcaf81d609cd9b9da0ae Mon Sep 17 00:00:00 2001 From: atheate Date: Fri, 11 Sep 2026 15:46:28 +0200 Subject: [PATCH] Fix #211 : Extend method attributes add --- .../AnnotatingElementExtensions.cs | 31 ++ .../AssociationExtensions.cs | 34 ++ .../AutoGenPocoExtend/DependencyExtensions.cs | 2 + .../AutoGenPocoExtend/ElementExtensions.cs | 129 +++++- .../EnumerationDefinitionExtensions.cs | 5 + .../AutoGenPocoExtend/FeatureExtensions.cs | 378 +++++++++++++++++- .../FeatureTypingExtensions.cs | 3 + .../Core/AutoGenPocoExtend/FlowExtensions.cs | 57 +++ .../FramedConcernMembershipExtensions.cs | 4 + .../LiteralIntegerExtensions.cs | 3 + .../LiteralRationalExtensions.cs | 3 + .../AutoGenPocoExtend/MembershipExtensions.cs | 24 ++ .../MultiplicityRangeExtensions.cs | 72 ++++ .../OwningMembershipExtensions.cs | 28 ++ .../ReferenceSubsettingExtensions.cs | 3 + .../RelationshipExtensions.cs | 32 ++ .../RequirementUsageExtensions.cs | 70 ++++ .../SelectExpressionExtensions.cs | 3 + .../SubclassificationExtensions.cs | 3 + .../TextualRepresentationExtensions.cs | 3 + .../Core/AutoGenPocoExtend/UsageExtensions.cs | 265 ++++++++++++ .../Uml/core-poco-extend-uml-template.hbs | 4 + .../Decorators/DerivedPropertyAttribute.cs | 47 +++ SysML2.NET/Decorators/OperationAttribute.cs | 47 +++ .../Extend/AcceptActionUsageExtensions.cs | 6 + .../Extend/ActionDefinitionExtensions.cs | 3 + SysML2.NET/Extend/ActionUsageExtensions.cs | 7 + .../Extend/ActorMembershipExtensions.cs | 3 + .../Extend/AllocationDefinitionExtensions.cs | 3 + .../Extend/AllocationUsageExtensions.cs | 3 + .../AnalysisCaseDefinitionExtensions.cs | 3 + .../Extend/AnalysisCaseUsageExtensions.cs | 4 + .../Extend/AnnotatingElementExtensions.cs | 6 + SysML2.NET/Extend/AnnotationExtensions.cs | 6 + .../Extend/AssertConstraintUsageExtensions.cs | 3 + .../Extend/AssignmentActionUsageExtensions.cs | 5 + SysML2.NET/Extend/AssociationExtensions.cs | 6 + SysML2.NET/Extend/AttributeUsageExtensions.cs | 4 + SysML2.NET/Extend/BehaviorExtensions.cs | 4 + .../Extend/BooleanExpressionExtensions.cs | 3 + .../Extend/CalculationDefinitionExtensions.cs | 3 + .../Extend/CalculationUsageExtensions.cs | 4 + SysML2.NET/Extend/CaseDefinitionExtensions.cs | 5 + SysML2.NET/Extend/CaseUsageExtensions.cs | 6 + SysML2.NET/Extend/ClassifierExtensions.cs | 3 + SysML2.NET/Extend/ConcernUsageExtensions.cs | 3 + .../ConjugatedPortDefinitionExtensions.cs | 5 + .../Extend/ConjugatedPortTypingExtensions.cs | 3 + SysML2.NET/Extend/ConjugationExtensions.cs | 3 + .../Extend/ConnectionDefinitionExtensions.cs | 3 + .../Extend/ConnectionUsageExtensions.cs | 3 + SysML2.NET/Extend/ConnectorExtensions.cs | 8 + .../Extend/ConstraintUsageExtensions.cs | 5 + .../Extend/ConstructorExpressionExtensions.cs | 3 + SysML2.NET/Extend/ControlNodeExtensions.cs | 3 + .../Extend/CrossSubsettingExtensions.cs | 3 + SysML2.NET/Extend/DefinitionExtensions.cs | 33 ++ SysML2.NET/Extend/DifferencingExtensions.cs | 3 + SysML2.NET/Extend/DisjoiningExtensions.cs | 3 + SysML2.NET/Extend/DocumentationExtensions.cs | 3 + SysML2.NET/Extend/ElementExtensions.cs | 18 + .../ElementFilterMembershipExtensions.cs | 3 + .../Extend/EndFeatureMembershipExtensions.cs | 3 + .../Extend/EnumerationDefinitionExtensions.cs | 3 + .../Extend/EnumerationUsageExtensions.cs | 3 + .../Extend/EventOccurrenceUsageExtensions.cs | 4 + .../Extend/ExhibitStateUsageExtensions.cs | 3 + SysML2.NET/Extend/ExpressionExtensions.cs | 8 + .../FeatureChainExpressionExtensions.cs | 4 + .../Extend/FeatureChainingExtensions.cs | 3 + SysML2.NET/Extend/FeatureExtensions.cs | 36 ++ .../Extend/FeatureInvertingExtensions.cs | 3 + .../Extend/FeatureMembershipExtensions.cs | 4 + .../FeatureReferenceExpressionExtensions.cs | 5 + SysML2.NET/Extend/FeatureTypingExtensions.cs | 3 + SysML2.NET/Extend/FeatureValueExtensions.cs | 4 + SysML2.NET/Extend/FlowDefinitionExtensions.cs | 3 + SysML2.NET/Extend/FlowExtensions.cs | 8 + SysML2.NET/Extend/FlowUsageExtensions.cs | 3 + .../Extend/ForLoopActionUsageExtensions.cs | 4 + .../FramedConcernMembershipExtensions.cs | 4 + SysML2.NET/Extend/FunctionExtensions.cs | 5 + SysML2.NET/Extend/IfActionUsageExtensions.cs | 5 + SysML2.NET/Extend/ImportExtensions.cs | 5 + .../Extend/IncludeUseCaseUsageExtensions.cs | 3 + .../InstantiationExpressionExtensions.cs | 5 + .../Extend/InterfaceDefinitionExtensions.cs | 3 + SysML2.NET/Extend/InterfaceUsageExtensions.cs | 3 + SysML2.NET/Extend/IntersectingExtensions.cs | 3 + .../Extend/InvocationExpressionExtensions.cs | 4 + SysML2.NET/Extend/ItemUsageExtensions.cs | 3 + SysML2.NET/Extend/LibraryPackageExtensions.cs | 3 + .../Extend/LiteralExpressionExtensions.cs | 4 + .../Extend/LoopActionUsageExtensions.cs | 3 + SysML2.NET/Extend/MembershipExtensions.cs | 5 + .../Extend/MembershipImportExtensions.cs | 3 + .../MetadataAccessExpressionExtensions.cs | 6 + .../Extend/MetadataFeatureExtensions.cs | 7 + SysML2.NET/Extend/MetadataUsageExtensions.cs | 3 + .../Extend/MultiplicityRangeExtensions.cs | 7 + SysML2.NET/Extend/NamespaceExtensions.cs | 19 + .../Extend/NamespaceImportExtensions.cs | 3 + SysML2.NET/Extend/NullExpressionExtensions.cs | 4 + .../Extend/ObjectiveMembershipExtensions.cs | 3 + .../Extend/OccurrenceUsageExtensions.cs | 4 + .../Extend/OperatorExpressionExtensions.cs | 3 + .../Extend/OwningMembershipExtensions.cs | 7 + SysML2.NET/Extend/PackageExtensions.cs | 5 + .../Extend/ParameterMembershipExtensions.cs | 4 + SysML2.NET/Extend/PartUsageExtensions.cs | 3 + .../Extend/PerformActionUsageExtensions.cs | 4 + .../Extend/PortConjugationExtensions.cs | 3 + SysML2.NET/Extend/PortDefinitionExtensions.cs | 3 + SysML2.NET/Extend/PortUsageExtensions.cs | 3 + .../Extend/ReferenceSubsettingExtensions.cs | 3 + SysML2.NET/Extend/ReferenceUsageExtensions.cs | 4 + SysML2.NET/Extend/RelationshipExtensions.cs | 5 + .../Extend/RenderingDefinitionExtensions.cs | 3 + SysML2.NET/Extend/RenderingUsageExtensions.cs | 3 + ...quirementConstraintMembershipExtensions.cs | 4 + .../Extend/RequirementDefinitionExtensions.cs | 9 + .../Extend/RequirementUsageExtensions.cs | 10 + ...irementVerificationMembershipExtensions.cs | 4 + .../ResultExpressionMembershipExtensions.cs | 3 + .../ReturnParameterMembershipExtensions.cs | 3 + .../SatisfyRequirementUsageExtensions.cs | 4 + .../Extend/SendActionUsageExtensions.cs | 5 + SysML2.NET/Extend/SpecializationExtensions.cs | 3 + .../Extend/StakeholderMembershipExtensions.cs | 3 + .../Extend/StateDefinitionExtensions.cs | 6 + .../StateSubactionMembershipExtensions.cs | 3 + SysML2.NET/Extend/StateUsageExtensions.cs | 7 + SysML2.NET/Extend/StepExtensions.cs | 4 + .../Extend/SubclassificationExtensions.cs | 3 + .../Extend/SubjectMembershipExtensions.cs | 3 + SysML2.NET/Extend/SubsettingExtensions.cs | 3 + .../Extend/TerminateActionUsageExtensions.cs | 3 + .../Extend/TextualRepresentationExtensions.cs | 3 + .../TransitionFeatureMembershipExtensions.cs | 3 + .../Extend/TransitionUsageExtensions.cs | 10 + .../TriggerInvocationExpressionExtensions.cs | 3 + SysML2.NET/Extend/TypeExtensions.cs | 38 ++ SysML2.NET/Extend/TypeFeaturingExtensions.cs | 3 + SysML2.NET/Extend/UnioningExtensions.cs | 3 + SysML2.NET/Extend/UsageExtensions.cs | 40 ++ .../Extend/UseCaseDefinitionExtensions.cs | 3 + SysML2.NET/Extend/UseCaseUsageExtensions.cs | 4 + .../Extend/VariantMembershipExtensions.cs | 3 + .../VerificationCaseDefinitionExtensions.cs | 3 + .../Extend/VerificationCaseUsageExtensions.cs | 4 + SysML2.NET/Extend/ViewDefinitionExtensions.cs | 6 + .../ViewRenderingMembershipExtensions.cs | 4 + SysML2.NET/Extend/ViewUsageExtensions.cs | 8 + .../Extend/ViewpointDefinitionExtensions.cs | 3 + SysML2.NET/Extend/ViewpointUsageExtensions.cs | 4 + .../Extend/WhileLoopActionUsageExtensions.cs | 4 + 156 files changed, 1931 insertions(+), 17 deletions(-) create mode 100644 SysML2.NET/Decorators/DerivedPropertyAttribute.cs create mode 100644 SysML2.NET/Decorators/OperationAttribute.cs diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/AnnotatingElementExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/AnnotatingElementExtensions.cs index 35c20cec4..b0fc501c6 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/AnnotatingElementExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/AnnotatingElementExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Root.Annotations using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Root.Elements; using SysML2.NET.Core.POCO.Root.Namespaces; @@ -35,6 +37,14 @@ internal static class AnnotatingElementExtensions /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// annotatedElement = + /// if annotation->notEmpty() then annotation.annotatedElement + /// else Sequence{owningNamespace} endif + /// + /// /// /// The subject /// @@ -42,6 +52,7 @@ internal static class AnnotatingElementExtensions /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IAnnotatingElement.annotatedElement))] internal static List ComputeAnnotatedElement(this IAnnotatingElement annotatingElementSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -50,6 +61,15 @@ internal static List ComputeAnnotatedElement(this IAnnotatingElement a /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// annotation = + /// if owningAnnotatingRelationship = null then ownedAnnotatingRelationship + /// else owningAnnotatingRelationship->prepend(owningAnnotatingRelationship) + /// endif + /// + /// /// /// The subject /// @@ -57,6 +77,7 @@ internal static List ComputeAnnotatedElement(this IAnnotatingElement a /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IAnnotatingElement.annotation))] internal static List ComputeAnnotation(this IAnnotatingElement annotatingElementSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -65,6 +86,14 @@ internal static List ComputeAnnotation(this IAnnotatingElement anno /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// ownedAnnotatingRelationship = ownedRelationship-> + /// selectByKind(Annotation)-> + /// select(a | a.annotatedElement <> self) + /// + /// /// /// The subject /// @@ -72,6 +101,7 @@ internal static List ComputeAnnotation(this IAnnotatingElement anno /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IAnnotatingElement.ownedAnnotatingRelationship))] internal static List ComputeOwnedAnnotatingRelationship(this IAnnotatingElement annotatingElementSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -87,6 +117,7 @@ internal static List ComputeOwnedAnnotatingRelationship(this IAnnot /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IAnnotatingElement.owningAnnotatingRelationship))] internal static IAnnotation ComputeOwningAnnotatingRelationship(this IAnnotatingElement annotatingElementSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/AssociationExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/AssociationExtensions.cs index b3eb6d794..5f2a23bdb 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/AssociationExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/AssociationExtensions.cs @@ -23,6 +23,10 @@ namespace SysML2.NET.Core.POCO.Kernel.Associations using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Classifiers; using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Core.Types; @@ -46,6 +50,7 @@ internal static class AssociationExtensions /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IAssociation.associationEnd))] internal static List ComputeAssociationEnd(this IAssociation associationSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -54,6 +59,12 @@ internal static List ComputeAssociationEnd(this IAssociation associati /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// relatedType = associationEnd.type + /// + /// /// /// The subject /// @@ -61,6 +72,7 @@ internal static List ComputeAssociationEnd(this IAssociation associati /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IAssociation.relatedType))] internal static List ComputeRelatedType(this IAssociation associationSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -69,6 +81,14 @@ internal static List ComputeRelatedType(this IAssociation associationSubj /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// sourceType = + /// if relatedType->isEmpty() then null + /// else relatedType->first() endif + /// + /// /// /// The subject /// @@ -76,6 +96,7 @@ internal static List ComputeRelatedType(this IAssociation associationSubj /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IAssociation.sourceType))] internal static IType ComputeSourceType(this IAssociation associationSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -84,6 +105,18 @@ internal static IType ComputeSourceType(this IAssociation associationSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// targetType = + /// if relatedType->size() < 2 then OrderedSet{} + /// else + /// relatedType-> + /// subSequence(2, relatedType->size())-> + /// asOrderedSet() + /// endif + /// + /// /// /// The subject /// @@ -91,6 +124,7 @@ internal static IType ComputeSourceType(this IAssociation associationSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IAssociation.targetType))] internal static List ComputeTargetType(this IAssociation associationSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/DependencyExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/DependencyExtensions.cs index 3eea36a6c..d76b88996 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/DependencyExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/DependencyExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Root.Dependencies using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Elements; using SysML2.NET.Core.POCO.Root.Namespaces; diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/ElementExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/ElementExtensions.cs index eeb28540e..ec4618289 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/ElementExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/ElementExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Root.Elements using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Namespaces; @@ -35,6 +37,12 @@ internal static class ElementExtensions /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// documentation = ownedElement->selectByKind(Documentation) + /// + /// /// /// The subject /// @@ -42,6 +50,7 @@ internal static class ElementExtensions /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IElement.documentation))] internal static List ComputeDocumentation(this IElement elementSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -50,6 +59,12 @@ internal static List ComputeDocumentation(this IElement elementS /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// isLibraryElement = libraryNamespace() <> null + /// + /// /// /// The subject /// @@ -57,6 +72,7 @@ internal static List ComputeDocumentation(this IElement elementS /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IElement.isLibraryElement))] internal static bool ComputeIsLibraryElement(this IElement elementSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -65,6 +81,12 @@ internal static bool ComputeIsLibraryElement(this IElement elementSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// name = effectiveName() + /// + /// /// /// The subject /// @@ -72,6 +94,7 @@ internal static bool ComputeIsLibraryElement(this IElement elementSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IElement.name))] internal static string ComputeName(this IElement elementSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -80,6 +103,14 @@ internal static string ComputeName(this IElement elementSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// ownedAnnotation = ownedRelationship-> + /// selectByKind(Annotation)-> + /// select(a | a.annotatedElement = self) + /// + /// /// /// The subject /// @@ -87,6 +118,7 @@ internal static string ComputeName(this IElement elementSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IElement.ownedAnnotation))] internal static List ComputeOwnedAnnotation(this IElement elementSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -95,6 +127,12 @@ internal static List ComputeOwnedAnnotation(this IElement elementSu /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// ownedElement = ownedRelationship.ownedRelatedElement + /// + /// /// /// The subject /// @@ -102,6 +140,7 @@ internal static List ComputeOwnedAnnotation(this IElement elementSu /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IElement.ownedElement))] internal static List ComputeOwnedElement(this IElement elementSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -110,6 +149,12 @@ internal static List ComputeOwnedElement(this IElement elementSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// owner = owningRelationship.owningRelatedElement + /// + /// /// /// The subject /// @@ -117,6 +162,7 @@ internal static List ComputeOwnedElement(this IElement elementSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IElement.owner))] internal static IElement ComputeOwner(this IElement elementSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -132,6 +178,7 @@ internal static IElement ComputeOwner(this IElement elementSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IElement.owningMembership))] internal static IOwningMembership ComputeOwningMembership(this IElement elementSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -140,6 +187,15 @@ internal static IOwningMembership ComputeOwningMembership(this IElement elementS /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// owningNamespace = + /// if owningMembership = null then null + /// else owningMembership.membershipOwningNamespace + /// endif + /// + /// /// /// The subject /// @@ -147,6 +203,7 @@ internal static IOwningMembership ComputeOwningMembership(this IElement elementS /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IElement.owningNamespace))] internal static INamespace ComputeOwningNamespace(this IElement elementSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -155,6 +212,21 @@ internal static INamespace ComputeOwningNamespace(this IElement elementSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// qualifiedName = + /// if owningNamespace = null then null + /// else if name <> null and + /// owningNamespace.ownedMember-> + /// select(m | m.name = name).indexOf(self) <> 1 then null + /// else if owningNamespace.owner = null then escapedName() + /// else if owningNamespace.qualifiedName = null or + /// escapedName() = null then null + /// else owningNamespace.qualifiedName + '::' + escapedName() + /// endif endif endif endif + /// + /// /// /// The subject /// @@ -162,6 +234,7 @@ internal static INamespace ComputeOwningNamespace(this IElement elementSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IElement.qualifiedName))] internal static string ComputeQualifiedName(this IElement elementSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -170,6 +243,12 @@ internal static string ComputeQualifiedName(this IElement elementSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// shortName = effectiveShortName() + /// + /// /// /// The subject /// @@ -177,6 +256,7 @@ internal static string ComputeQualifiedName(this IElement elementSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IElement.shortName))] internal static string ComputeShortName(this IElement elementSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -185,6 +265,12 @@ internal static string ComputeShortName(this IElement elementSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// textualRepresentation = ownedElement->selectByKind(TextualRepresentation) + /// + /// /// /// The subject /// @@ -192,6 +278,7 @@ internal static string ComputeShortName(this IElement elementSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IElement.textualRepresentation))] internal static List ComputeTextualRepresentation(this IElement elementSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -210,6 +297,7 @@ internal static List ComputeTextualRepresentation(this I /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IElement.EscapedName))] internal static string ComputeEscapedNameOperation(this IElement elementSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -219,6 +307,12 @@ internal static string ComputeEscapedNameOperation(this IElement elementSubject) /// Return an effective shortName for this Element. By default this is the same as its /// declaredShortName. /// + /// + /// OCL2.0: + /// + /// declaredShortName + /// + /// /// /// The subject /// @@ -226,6 +320,7 @@ internal static string ComputeEscapedNameOperation(this IElement elementSubject) /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IElement.EffectiveShortName))] internal static string ComputeEffectiveShortNameOperation(this IElement elementSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -234,6 +329,12 @@ internal static string ComputeEffectiveShortNameOperation(this IElement elementS /// /// Return an effective name for this Element. By default this is the same as its declaredName. /// + /// + /// OCL2.0: + /// + /// declaredName + /// + /// /// /// The subject /// @@ -241,6 +342,7 @@ internal static string ComputeEffectiveShortNameOperation(this IElement elementS /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IElement.EffectiveName))] internal static string ComputeEffectiveNameOperation(this IElement elementSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -249,6 +351,13 @@ internal static string ComputeEffectiveNameOperation(this IElement elementSubjec /// /// By default, return the library Namespace of the owningRelationship of this Element, if it has one. /// + /// + /// OCL2.0: + /// + /// if owningRelationship <> null then owningRelationship.libraryNamespace() + /// else null endif + /// + /// /// /// The subject /// @@ -256,6 +365,7 @@ internal static string ComputeEffectiveNameOperation(this IElement elementSubjec /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IElement.LibraryNamespace))] internal static INamespace ComputeLibraryNamespaceOperation(this IElement elementSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -267,9 +377,23 @@ internal static INamespace ComputeLibraryNamespaceOperation(this IElement elemen /// an owningRelationship, then return the string constructed by appending to the path of it's /// owningRelationship the character / followed by the string representation of its position in the list /// of ownedRelatedElements of the owningRelationship (indexed starting at 1). Otherwise, return the - /// empty string. (Note that this operation is overridden for Relationships - /// to use owningRelatedElement when appropriate.) + /// empty string.(Note that this operation is overridden for Relationships to use owningRelatedElement + /// when appropriate.) /// + /// + /// OCL2.0: + /// + /// if qualifiedName <> null then qualifiedName + /// else if owningRelationship <> null then + /// owningRelationship.path() + '/' + + /// owningRelationship.ownedRelatedElement->indexOf(self).toString() + /// -- A position index shall be converted to a decimal string representation + /// -- consisting of only decimal digits, with no sign, leading zeros or leading + /// -- or trailing whitespace. + /// else '' + /// endif endif + /// + /// /// /// The subject /// @@ -277,6 +401,7 @@ internal static INamespace ComputeLibraryNamespaceOperation(this IElement elemen /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IElement.Path))] internal static string ComputePathOperation(this IElement elementSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/EnumerationDefinitionExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/EnumerationDefinitionExtensions.cs index f88dd6517..f60d04da9 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/EnumerationDefinitionExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/EnumerationDefinitionExtensions.cs @@ -23,6 +23,10 @@ namespace SysML2.NET.Core.POCO.Systems.Enumerations using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Classifiers; using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Core.Types; @@ -67,6 +71,7 @@ internal static class EnumerationDefinitionExtensions /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IEnumerationDefinition.enumeratedValue))] internal static List ComputeEnumeratedValue(this IEnumerationDefinition enumerationDefinitionSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/FeatureExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/FeatureExtensions.cs index 004d42de3..a2831ef2d 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/FeatureExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/FeatureExtensions.cs @@ -23,7 +23,10 @@ namespace SysML2.NET.Core.POCO.Core.Features using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Elements; @@ -38,6 +41,12 @@ internal static class FeatureExtensions /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// chainingFeature = ownedFeatureChaining.chainingFeature + /// + /// /// /// The subject /// @@ -45,6 +54,7 @@ internal static class FeatureExtensions /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFeature.chainingFeature))] internal static List ComputeChainingFeature(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -53,6 +63,19 @@ internal static List ComputeChainingFeature(this IFeature featureSubje /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// crossFeature = + /// if ownedCrossSubsetting = null then null + /// else + /// let chainingFeatures: Sequence(Feature) = + /// ownedCrossSubsetting.crossedFeature.chainingFeature in + /// if chainingFeatures->size() < 2 then null + /// else chainingFeatures->at(2) + /// endif + /// + /// /// /// The subject /// @@ -60,6 +83,7 @@ internal static List ComputeChainingFeature(this IFeature featureSubje /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFeature.crossFeature))] internal static IFeature ComputeCrossFeature(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -75,6 +99,7 @@ internal static IFeature ComputeCrossFeature(this IFeature featureSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFeature.endOwningType))] internal static IType ComputeEndOwningType(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -83,6 +108,12 @@ internal static IType ComputeEndOwningType(this IFeature featureSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// featureTarget = if chainingFeature->isEmpty() then self else chainingFeature->last() endif + /// + /// /// /// The subject /// @@ -90,6 +121,7 @@ internal static IType ComputeEndOwningType(this IFeature featureSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFeature.featureTarget))] internal static IFeature ComputeFeatureTarget(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -98,6 +130,20 @@ internal static IFeature ComputeFeatureTarget(this IFeature featureSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// featuringType = + /// let featuringTypes : OrderedSet(Type) = + /// typeFeaturing.type->asOrderedSet() in + /// if chainingFeature->isEmpty() then featuringTypes + /// else + /// featuringTypes-> + /// union(chainingFeature->first().featuringType)-> + /// asOrderedSet() + /// endif + /// + /// /// /// The subject /// @@ -105,6 +151,7 @@ internal static IFeature ComputeFeatureTarget(this IFeature featureSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFeature.featuringType))] internal static List ComputeFeaturingType(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -113,6 +160,17 @@ internal static List ComputeFeaturingType(this IFeature featureSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// ownedCrossSubsetting = + /// let crossSubsettings: Sequence(CrossSubsetting) = + /// ownedSubsetting->selectByKind(CrossSubsetting) in + /// if crossSubsettings->isEmpty() then null + /// else crossSubsettings->first() + /// endif + /// + /// /// /// The subject /// @@ -120,6 +178,7 @@ internal static List ComputeFeaturingType(this IFeature featureSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFeature.ownedCrossSubsetting))] internal static ICrossSubsetting ComputeOwnedCrossSubsetting(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -128,6 +187,12 @@ internal static ICrossSubsetting ComputeOwnedCrossSubsetting(this IFeature featu /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// ownedFeatureChaining = ownedRelationship->selectByKind(FeatureChaining) + /// + /// /// /// The subject /// @@ -135,6 +200,7 @@ internal static ICrossSubsetting ComputeOwnedCrossSubsetting(this IFeature featu /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFeature.ownedFeatureChaining))] internal static List ComputeOwnedFeatureChaining(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -143,6 +209,13 @@ internal static List ComputeOwnedFeatureChaining(this IFeature /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// ownedFeatureInverting = ownedRelationship->selectByKind(FeatureInverting)-> + /// select(fi | fi.featureInverted = self) + /// + /// /// /// The subject /// @@ -150,6 +223,7 @@ internal static List ComputeOwnedFeatureChaining(this IFeature /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFeature.ownedFeatureInverting))] internal static List ComputeOwnedFeatureInverting(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -158,6 +232,12 @@ internal static List ComputeOwnedFeatureInverting(this IFeatu /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// ownedRedefinition = ownedSubsetting->selectByKind(Redefinition) + /// + /// /// /// The subject /// @@ -165,6 +245,7 @@ internal static List ComputeOwnedFeatureInverting(this IFeatu /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFeature.ownedRedefinition))] internal static List ComputeOwnedRedefinition(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -173,6 +254,16 @@ internal static List ComputeOwnedRedefinition(this IFeature featu /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// ownedReferenceSubsetting = + /// let referenceSubsettings : OrderedSet(ReferenceSubsetting) = + /// ownedSubsetting->selectByKind(ReferenceSubsetting) in + /// if referenceSubsettings->isEmpty() then null + /// else referenceSubsettings->first() endif + /// + /// /// /// The subject /// @@ -180,6 +271,7 @@ internal static List ComputeOwnedRedefinition(this IFeature featu /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFeature.ownedReferenceSubsetting))] internal static IReferenceSubsetting ComputeOwnedReferenceSubsetting(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -188,6 +280,12 @@ internal static IReferenceSubsetting ComputeOwnedReferenceSubsetting(this IFeatu /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// ownedSubsetting = ownedSpecialization->selectByKind(Subsetting) + /// + /// /// /// The subject /// @@ -195,6 +293,7 @@ internal static IReferenceSubsetting ComputeOwnedReferenceSubsetting(this IFeatu /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFeature.ownedSubsetting))] internal static List ComputeOwnedSubsetting(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -203,6 +302,13 @@ internal static List ComputeOwnedSubsetting(this IFeature featureSu /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// ownedTypeFeaturing = ownedRelationship->selectByKind(TypeFeaturing)-> + /// select(tf | tf.featureOfType = self) + /// + /// /// /// The subject /// @@ -210,6 +316,7 @@ internal static List ComputeOwnedSubsetting(this IFeature featureSu /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFeature.ownedTypeFeaturing))] internal static List ComputeOwnedTypeFeaturing(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -218,6 +325,12 @@ internal static List ComputeOwnedTypeFeaturing(this IFeature fea /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// ownedTyping = ownedGeneralization->selectByKind(FeatureTyping) + /// + /// /// /// The subject /// @@ -225,6 +338,7 @@ internal static List ComputeOwnedTypeFeaturing(this IFeature fea /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFeature.ownedTyping))] internal static List ComputeOwnedTyping(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -240,6 +354,7 @@ internal static List ComputeOwnedTyping(this IFeature featureSub /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFeature.owningFeatureMembership))] internal static IFeatureMembership ComputeOwningFeatureMembership(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -255,6 +370,7 @@ internal static IFeatureMembership ComputeOwningFeatureMembership(this IFeature /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFeature.owningType))] internal static IType ComputeOwningType(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -263,6 +379,16 @@ internal static IType ComputeOwningType(this IFeature featureSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// type = + /// let types : OrderedSet(Types) = OrderedSet{self}-> + /// -- Note: The closure operation automatically handles circular relationships. + /// closure(typingFeatures()).typing.type->asOrderedSet() in + /// types->reject(t1 | types->exist(t2 | t2 <> t1 and t2.specializes(t1))) + /// + /// /// /// The subject /// @@ -270,6 +396,7 @@ internal static IType ComputeOwningType(this IFeature featureSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFeature.type))] internal static List ComputeType(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -278,6 +405,12 @@ internal static List ComputeType(this IFeature featureSubject) /// /// Return the directionOf this Feature relative to the given type. /// + /// + /// OCL2.0: + /// + /// type.directionOf(self) + /// + /// /// /// The subject /// @@ -288,6 +421,7 @@ internal static List ComputeType(this IFeature featureSubject) /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IFeature.DirectionFor))] internal static FeatureDirectionKind? ComputeDirectionForOperation(this IFeature featureSubject, IType type) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -297,6 +431,21 @@ internal static List ComputeType(this IFeature featureSubject) /// If a Feature has no declaredShortName or declaredName, then its effective shortName is given by the /// effective shortName of the Feature returned by the namingFeature() operation, if any. /// + /// + /// OCL2.0: + /// + /// if declaredShortName <> null or declaredName <> null then + /// declaredShortName + /// else + /// let namingFeature : Feature = namingFeature() in + /// if namingFeature = null then + /// null + /// else + /// namingFeature.effectiveShortName() + /// endif + /// endif + /// + /// /// /// The subject /// @@ -304,16 +453,31 @@ internal static List ComputeType(this IFeature featureSubject) /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IFeature.EffectiveShortName))] internal static string ComputeRedefinedEffectiveShortNameOperation(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); } /// - /// If a Feature has no declaredName or declaredShortName , then its - /// effective name is given by the effective name of the Feature returned by the namingFeature() - /// operation, if any. + /// If a Feature has no declaredName or declaredShortName, then its effective name is given by the + /// effective name of the Feature returned by the namingFeature() operation, if any. /// + /// + /// OCL2.0: + /// + /// if declaredShortName <> null or declaredName <> null then + /// declaredName + /// else + /// let namingFeature : Feature = namingFeature() in + /// if namingFeature = null then + /// null + /// else + /// namingFeature.effectiveName() + /// endif + /// endif + /// + /// /// /// The subject /// @@ -321,6 +485,7 @@ internal static string ComputeRedefinedEffectiveShortNameOperation(this IFeature /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IFeature.EffectiveName))] internal static string ComputeRedefinedEffectiveNameOperation(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -330,6 +495,16 @@ internal static string ComputeRedefinedEffectiveNameOperation(this IFeature feat /// By default, the naming Feature of a Feature is given by its first redefinedFeature of its first /// ownedRedefinition, if any. /// + /// + /// OCL2.0: + /// + /// if ownedRedefinition->isEmpty() then + /// null + /// else + /// ownedRedefinition->at(1).redefinedFeature + /// endif + /// + /// /// /// The subject /// @@ -337,6 +512,7 @@ internal static string ComputeRedefinedEffectiveNameOperation(this IFeature feat /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IFeature.NamingFeature))] internal static IFeature ComputeNamingFeatureOperation(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -344,6 +520,16 @@ internal static IFeature ComputeNamingFeatureOperation(this IFeature featureSubj /// /// + /// + /// OCL2.0: + /// + /// let supertypes : OrderedSet(Type) = + /// self.oclAsType(Type).supertypes(excludeImplied) in + /// if featureTarget = self then supertypes + /// else supertypes->append(featureTarget) + /// endif + /// + /// /// /// The subject /// @@ -354,6 +540,7 @@ internal static IFeature ComputeNamingFeatureOperation(this IFeature featureSubj /// The expected collection of /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IFeature.Supertypes))] internal static List ComputeRedefinedSupertypesOperation(this IFeature featureSubject, bool excludeImplied) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -362,6 +549,12 @@ internal static List ComputeRedefinedSupertypesOperation(this IFeature fe /// /// Check whether this Feature directly redefines the given redefinedFeature. /// + /// + /// OCL2.0: + /// + /// ownedRedefinition.redefinedFeature->includes(redefinedFeature) + /// + /// /// /// The subject /// @@ -372,6 +565,7 @@ internal static List ComputeRedefinedSupertypesOperation(this IFeature fe /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IFeature.Redefines))] internal static bool ComputeRedefinesOperation(this IFeature featureSubject, IFeature redefinedFeature) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -381,6 +575,14 @@ internal static bool ComputeRedefinesOperation(this IFeature featureSubject, IFe /// Check whether this Feature directly redefines the named library Feature. libraryFeatureName must /// conform to the syntax of a KerML qualified name and must resolve to a Feature in global scope. /// + /// + /// OCL2.0: + /// + /// let mem: Membership = resolveGlobal(libraryFeatureName) in + /// mem <> null and mem.memberElement.oclIsKindOf(Feature) and + /// redefines(mem.memberElement.oclAsType(Feature)) + /// + /// /// /// The subject /// @@ -391,6 +593,7 @@ internal static bool ComputeRedefinesOperation(this IFeature featureSubject, IFe /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IFeature.RedefinesFromLibrary))] internal static bool ComputeRedefinesFromLibraryOperation(this IFeature featureSubject, string libraryFeatureName) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -400,6 +603,16 @@ internal static bool ComputeRedefinesFromLibraryOperation(this IFeature featureS /// Check whether this Feature directly or indirectly specializes a Feature whose last two /// chainingFeatures are the given Features first and second. /// + /// + /// OCL2.0: + /// + /// allSuperTypes()->selectAsKind(Feature)-> + /// exists(f | let n: Integer = f.chainingFeature->size() in + /// n >= 2 and + /// f.chainingFeature->at(n-1) = first and + /// f.chainingFeature->at(n) = second) + /// + /// /// /// The subject /// @@ -413,6 +626,7 @@ internal static bool ComputeRedefinesFromLibraryOperation(this IFeature featureS /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IFeature.SubsetsChain))] internal static bool ComputeSubsetsChainOperation(this IFeature featureSubject, IFeature first, IFeature second) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -420,12 +634,23 @@ internal static bool ComputeSubsetsChainOperation(this IFeature featureSubject, /// /// A Feature is compatible with an otherType if it either directly or indirectly specializes the - /// otherType or if the otherType is also a Feature and all of the following are true. - ///
  1. Neither this Feature or the otherType have any - /// ownedFeatures.
  2. This Feature directly or indirectly redefines a - /// Feature that is also directly or indirectly redefined by the otherType.
  3. - ///
  4. This Feature can access the otherType.
- ///
+ /// otherType or if the otherType is also a Feature and all of the following are true.
  1. Neither + /// this Feature or the otherType have any ownedFeatures.
  2. This Feature directly or indirectly + /// redefines a Feature that is also directly or indirectly redefined by the otherType.
  3. This + /// Feature can access the otherType.
+ /// + /// + /// OCL2.0: + /// + /// specializes(otherType) or + /// supertype.oclIsKindOf(Feature) and + /// ownedFeature->isEmpty() and + /// otherType.ownedFeature->isEmpty() and + /// ownedRedefinitions.allRedefinedFeatures()->exists(f | + /// otherType.oclAsType(Feature).allRedefinedFeatures()->includes(f)) and + /// canAccess(otherType.oclAsType(Feature)) + /// + /// /// /// The subject /// @@ -436,6 +661,7 @@ internal static bool ComputeSubsetsChainOperation(this IFeature featureSubject, /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IFeature.IsCompatibleWith))] internal static bool ComputeRedefinedIsCompatibleWithOperation(this IFeature featureSubject, IType otherType) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -445,12 +671,29 @@ internal static bool ComputeRedefinedIsCompatibleWithOperation(this IFeature fea /// Return the Features used to determine the types of this Feature (other than this Feature itself). If /// this Feature is not conjugated, then the typingFeatures consist of all subsetted Features, except /// from CrossSubsetting, and the last chainingFeature (if any). If this Feature is conjugated, then the - /// typingFeatures are only its originalType (if the originalType is a Feature). - /// Note. CrossSubsetting is excluded from the determination of the type of a - /// Feature in order to avoid circularity in the construction of implied CrossSubsetting relationships. - /// The validateFeatureCrossFeatureType requires that the crossFeature of a Feature have the same type - /// as the Feature. - /// + /// typingFeatures are only its originalType (if the originalType is a Feature).Note. + /// CrossSubsetting is excluded from the determination of the type of a Feature in order to avoid + /// circularity in the construction of implied CrossSubsetting relationships. The + /// validateFeatureCrossFeatureType requires that the crossFeature of a Feature have the same type as + /// the Feature. + /// + /// + /// OCL2.0: + /// + /// if not isConjugated then + /// let subsettedFeatures : OrderedSet(Feature) = + /// subsetting->reject(s | s.oclIsKindOf(CrossSubsetting)).subsettedFeatures in + /// if chainingFeature->isEmpty() or + /// subsettedFeature->includes(chainingFeature->last()) + /// then subsettedFeatures + /// else subsettedFeatures->append(chainingFeature->last()) + /// endif + /// else if conjugator.originalType.oclIsKindOf(Feature) then + /// OrderedSet{conjugator.originalType.oclAsType(Feature)} + /// else OrderedSet{} + /// endif endif + /// + /// /// /// The subject /// @@ -458,6 +701,7 @@ internal static bool ComputeRedefinedIsCompatibleWithOperation(this IFeature fea /// The expected collection of /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IFeature.TypingFeatures))] internal static List ComputeTypingFeaturesOperation(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -468,6 +712,15 @@ internal static List ComputeTypingFeaturesOperation(this IFeature feat /// represented by this Feature. (If isCartesianProduct is not true, the operation will still return a /// valid value, it will just not represent anything useful.) /// + /// + /// OCL2.0: + /// + /// featuringType->select(t | t.owner <> self)-> + /// union(featuringType->select(t | t.owner = self)-> + /// selectByKind(Feature).asCartesianProduct())-> + /// union(type) + /// + /// /// /// The subject /// @@ -475,6 +728,7 @@ internal static List ComputeTypingFeaturesOperation(this IFeature feat /// The expected collection of /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IFeature.AsCartesianProduct))] internal static List ComputeAsCartesianProductOperation(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -483,6 +737,16 @@ internal static List ComputeAsCartesianProductOperation(this IFeature fea /// /// Check whether this Feature can be used to represent a Cartesian product of Types. /// + /// + /// OCL2.0: + /// + /// type->size() = 1 and + /// featuringType.size() = 1 and + /// (featuringType.first().owner = self implies + /// featuringType.first().oclIsKindOf(Feature) and + /// featuringType.first().oclAsType(Feature).isCartesianProduct()) + /// + /// /// /// The subject /// @@ -490,6 +754,7 @@ internal static List ComputeAsCartesianProductOperation(this IFeature fea /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IFeature.IsCartesianProduct))] internal static bool ComputeIsCartesianProductOperation(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -498,6 +763,14 @@ internal static bool ComputeIsCartesianProductOperation(this IFeature featureSub /// /// Return whether this Feature is an owned cross Feature of an end Feature. /// + /// + /// OCL2.0: + /// + /// owningNamespace <> null and + /// owningNamespace.oclIsKindOf(Feature) and + /// owningNamespace.oclAsType(Feature).ownedCrossFeature() = self + /// + /// /// /// The subject /// @@ -505,6 +778,7 @@ internal static bool ComputeIsCartesianProductOperation(this IFeature featureSub /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IFeature.IsOwnedCrossFeature))] internal static bool ComputeIsOwnedCrossFeatureOperation(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -515,6 +789,22 @@ internal static bool ComputeIsOwnedCrossFeatureOperation(this IFeature featureSu /// Feature that is a Feature, but not a Multiplicity or a MetadataFeature, and whose owningMembership /// is not a FeatureMembership. If this exists, it is the crossFeature of the end Feature. /// + /// + /// OCL2.0: + /// + /// if not isEnd or owningType = null then null + /// else + /// let ownedMemberFeatures: Sequence(Feature) = + /// ownedMember->selectByKind(Feature)-> + /// reject(oclIsKindOf(Multiplicity) or + /// oclIsKindOf(MetadataFeature) or + /// oclIsKindOf(FeatureValue))-> + /// reject(owningMembership.oclIsKindOf(FeatureMembership)) in + /// if ownedMemberFeatures.isEmpty() then null + /// else ownedMemberFeatures->first() + /// endif + /// + /// /// /// The subject /// @@ -522,6 +812,7 @@ internal static bool ComputeIsOwnedCrossFeatureOperation(this IFeature featureSu /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IFeature.OwnedCrossFeature))] internal static IFeature ComputeOwnedCrossFeatureOperation(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -530,6 +821,14 @@ internal static IFeature ComputeOwnedCrossFeatureOperation(this IFeature feature /// /// Return this Feature and all the Features that are directly or indirectly Redefined by this Feature. /// + /// + /// OCL2.0: + /// + /// ownedRedefinition.redefinedFeature-> + /// closure(ownedRedefinition.redefinedFeature)-> + /// asOrderedSet()->prepend(self) + /// + /// /// /// The subject /// @@ -537,6 +836,7 @@ internal static IFeature ComputeOwnedCrossFeatureOperation(this IFeature feature /// The expected collection of /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IFeature.AllRedefinedFeatures))] internal static List ComputeAllRedefinedFeaturesOperation(this IFeature featureSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -549,6 +849,19 @@ internal static List ComputeAllRedefinedFeaturesOperation(this IFeatur /// is a feature chain whose first chainingFeature has isVariable = true, then also consider it to be /// featured within the owningType of its first chainingFeature. /// + /// + /// OCL2.0: + /// + /// if type = null then + /// featuringType->forAll(f | f = resolveGlobal('Base::Anything').memberElement) + /// else + /// featuringType->forAll(f | type.isCompatibleWith(f)) or + /// isVariable and type.specializes(owningType) or + /// chainingFeature->notEmpty() and chainingFeature->first().isVariable and + /// type.specializes(chainingFeature->first().owningType) + /// endif + /// + /// /// /// The subject /// @@ -559,6 +872,7 @@ internal static List ComputeAllRedefinedFeaturesOperation(this IFeatur /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IFeature.IsFeaturedWithin))] internal static bool ComputeIsFeaturedWithinOperation(this IFeature featureSubject, IType type) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -568,6 +882,23 @@ internal static bool ComputeIsFeaturedWithinOperation(this IFeature featureSubje /// A Feature can access another feature if the other feature is featured within one of the direct or /// indirect featuringTypes of this Feature. /// + /// + /// OCL2.0: + /// + /// let anythingType: Element = + /// subsettingFeature.resolveGlobal('Base::Anything').memberElement in + /// let allFeaturingTypes : Sequence(Type) = + /// featuringTypes->closure(t | + /// if not t.oclIsKindOf(Feature) then Sequence{} + /// else + /// let featuringTypes : OrderedSet(Type) = t.oclAsType(Feature).featuringType in + /// if featuringTypes->isEmpty() then Sequence{anythingType} + /// else featuringTypes + /// endif + /// endif) in + /// allFeaturingTypes->exists(t | feature.isFeaturedWithin(t)) + /// + /// /// /// The subject /// @@ -578,6 +909,7 @@ internal static bool ComputeIsFeaturedWithinOperation(this IFeature featureSubje /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IFeature.CanAccess))] internal static bool ComputeCanAccessOperation(this IFeature featureSubject, IFeature feature) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -589,6 +921,21 @@ internal static bool ComputeCanAccessOperation(this IFeature featureSubject, IFe /// true, then return true if the type is a Feature representing the snapshots of the owningType of this /// Feature. /// + /// + /// OCL2.0: + /// + /// owningType <> null and + /// if not isVariable then type = owningType + /// else if owningType = resolveGlobal('Occurrences::Occurrence').memberElement then + /// type = resolveGlobal('Occurrences::Occurrence::snapshots').memberElement + /// else + /// type.oclIsKindOf(Feature) and + /// let feature : Feature = type.oclAsType(Feature) in + /// feature.featuringType->includes(owningType) and + /// feature.redefinesFromLibrary('Occurrences::Occurrence::snapshots') + /// endif + /// + /// /// /// The subject /// @@ -599,6 +946,7 @@ internal static bool ComputeCanAccessOperation(this IFeature featureSubject, IFe /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IFeature.IsFeaturingType))] internal static bool ComputeIsFeaturingTypeOperation(this IFeature featureSubject, IType type) { throw new NotSupportedException("Create a GitHub issue when this method is required"); diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/FeatureTypingExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/FeatureTypingExtensions.cs index 0b0762c11..b987fc117 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/FeatureTypingExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/FeatureTypingExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Core.Features using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Elements; @@ -44,6 +46,7 @@ internal static class FeatureTypingExtensions /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFeatureTyping.owningFeature))] internal static IFeature ComputeOwningFeature(this IFeatureTyping featureTypingSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/FlowExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/FlowExtensions.cs index 604dd9bbb..2be96f617 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/FlowExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/FlowExtensions.cs @@ -23,7 +23,10 @@ namespace SysML2.NET.Core.POCO.Kernel.Interactions using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Classifiers; using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Core.Types; @@ -43,6 +46,12 @@ internal static class FlowExtensions /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// flowEnd = connectorEnd->selectByKind(FlowEnd) + /// + /// /// /// The subject /// @@ -50,6 +59,7 @@ internal static class FlowExtensions /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFlow.flowEnd))] internal static List ComputeFlowEnd(this IFlow flowSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -65,6 +75,7 @@ internal static List ComputeFlowEnd(this IFlow flowSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFlow.interaction))] internal static List ComputeInteraction(this IFlow flowSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -73,6 +84,17 @@ internal static List ComputeInteraction(this IFlow flowSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// payloadFeature = + /// let payloadFeatures : Sequence(PayloadFeature) = + /// ownedFeature->selectByKind(PayloadFeature) in + /// if payloadFeatures->isEmpty() then null + /// else payloadFeatures->first() + /// endif + /// + /// /// /// The subject /// @@ -80,6 +102,7 @@ internal static List ComputeInteraction(this IFlow flowSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFlow.payloadFeature))] internal static IPayloadFeature ComputePayloadFeature(this IFlow flowSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -88,6 +111,15 @@ internal static IPayloadFeature ComputePayloadFeature(this IFlow flowSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// payloadType = + /// if payloadFeature = null then Sequence{} + /// else payloadFeature.type + /// endif + /// + /// /// /// The subject /// @@ -95,6 +127,7 @@ internal static IPayloadFeature ComputePayloadFeature(this IFlow flowSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFlow.payloadType))] internal static List ComputePayloadType(this IFlow flowSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -103,6 +136,17 @@ internal static List ComputePayloadType(this IFlow flowSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// sourceOutputFeature = + /// if connectorEnd->isEmpty() or + /// connectorEnd.ownedFeature->isEmpty() + /// then null + /// else connectorEnd.ownedFeature->first() + /// endif + /// + /// /// /// The subject /// @@ -110,6 +154,7 @@ internal static List ComputePayloadType(this IFlow flowSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFlow.sourceOutputFeature))] internal static IFeature ComputeSourceOutputFeature(this IFlow flowSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -118,6 +163,17 @@ internal static IFeature ComputeSourceOutputFeature(this IFlow flowSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// targetInputFeature = + /// if connectorEnd->size() < 2 or + /// connectorEnd->at(2).ownedFeature->isEmpty() + /// then null + /// else connectorEnd->at(2).ownedFeature->first() + /// endif + /// + /// /// /// The subject /// @@ -125,6 +181,7 @@ internal static IFeature ComputeSourceOutputFeature(this IFlow flowSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFlow.targetInputFeature))] internal static IFeature ComputeTargetInputFeature(this IFlow flowSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/FramedConcernMembershipExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/FramedConcernMembershipExtensions.cs index 28dd5fa59..a7fff8e60 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/FramedConcernMembershipExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/FramedConcernMembershipExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Systems.Requirements using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Requirements; using SysML2.NET.Core.POCO.Core.Features; @@ -48,6 +50,7 @@ internal static class FramedConcernMembershipExtensions /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFramedConcernMembership.ownedConcern))] internal static IConcernUsage ComputeOwnedConcern(this IFramedConcernMembership framedConcernMembershipSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -63,6 +66,7 @@ internal static IConcernUsage ComputeOwnedConcern(this IFramedConcernMembership /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IFramedConcernMembership.referencedConcern))] internal static IConcernUsage ComputeReferencedConcern(this IFramedConcernMembership framedConcernMembershipSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/LiteralIntegerExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/LiteralIntegerExtensions.cs index 453f5e2ba..5e95ae3be 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/LiteralIntegerExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/LiteralIntegerExtensions.cs @@ -23,7 +23,10 @@ namespace SysML2.NET.Core.POCO.Kernel.Expressions using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.POCO.Kernel.Behaviors; diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/LiteralRationalExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/LiteralRationalExtensions.cs index 92c7140bd..c429b7246 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/LiteralRationalExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/LiteralRationalExtensions.cs @@ -23,7 +23,10 @@ namespace SysML2.NET.Core.POCO.Kernel.Expressions using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.POCO.Kernel.Behaviors; diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/MembershipExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/MembershipExtensions.cs index a565e8a3e..8b7a3cec7 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/MembershipExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/MembershipExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Root.Namespaces using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Elements; @@ -36,6 +38,12 @@ internal static class MembershipExtensions /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// memberElementId = memberElement.elementId + /// + /// /// /// The subject /// @@ -43,6 +51,7 @@ internal static class MembershipExtensions /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IMembership.memberElementId))] internal static string ComputeMemberElementId(this IMembership membershipSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -58,6 +67,7 @@ internal static string ComputeMemberElementId(this IMembership membershipSubject /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IMembership.membershipOwningNamespace))] internal static INamespace ComputeMembershipOwningNamespace(this IMembership membershipSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -70,6 +80,19 @@ internal static INamespace ComputeMembershipOwningNamespace(this IMembership mem /// of the memberElement of this Membership and the memberElement of the other Membership conform to the /// other. But this may be overridden in specializations of Membership. /// + /// + /// OCL2.0: + /// + /// not (memberElement.oclKindOf(other.memberElement.oclType()) or + /// other.memberElement.oclKindOf(memberElement.oclType())) or + /// (shortMemberName = null or + /// (shortMemberName <> other.shortMemberName and + /// shortMemberName <> other.memberName)) and + /// (memberName = null or + /// (memberName <> other.shortMemberName and + /// memberName <> other.memberName))) + /// + /// /// /// The subject /// @@ -80,6 +103,7 @@ internal static INamespace ComputeMembershipOwningNamespace(this IMembership mem /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IMembership.IsDistinguishableFrom))] internal static bool ComputeIsDistinguishableFromOperation(this IMembership membershipSubject, IMembership other) { throw new NotSupportedException("Create a GitHub issue when this method is required"); diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/MultiplicityRangeExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/MultiplicityRangeExtensions.cs index 93c932108..999ca1757 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/MultiplicityRangeExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/MultiplicityRangeExtensions.cs @@ -23,7 +23,10 @@ namespace SysML2.NET.Core.POCO.Kernel.Multiplicities using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.POCO.Kernel.Functions; @@ -40,6 +43,16 @@ internal static class MultiplicityRangeExtensions /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// bound = + /// if upperBound = null then Sequence{} + /// else if lowerBound = null then Sequence{upperBound} + /// else Sequence{lowerBound, upperBound} + /// endif endif + /// + /// /// /// The subject /// @@ -47,6 +60,7 @@ internal static class MultiplicityRangeExtensions /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IMultiplicityRange.bound))] internal static List ComputeBound(this IMultiplicityRange multiplicityRangeSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -55,6 +69,17 @@ internal static List ComputeBound(this IMultiplicityRange multiplic /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// lowerBound = + /// let ownedExpressions : Sequence(Expression) = + /// ownedMember->selectByKind(Expression) in + /// if ownedExpressions->size() < 2 then null + /// else ownedExpressions->first() + /// endif + /// + /// /// /// The subject /// @@ -62,6 +87,7 @@ internal static List ComputeBound(this IMultiplicityRange multiplic /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IMultiplicityRange.lowerBound))] internal static IExpression ComputeLowerBound(this IMultiplicityRange multiplicityRangeSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -70,6 +96,18 @@ internal static IExpression ComputeLowerBound(this IMultiplicityRange multiplici /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// upperBound = + /// let ownedExpressions : Sequence(Expression) = + /// ownedMember->selectByKind(Expression) in + /// if ownedExpressions->isEmpty() then null + /// else if ownedExpressions->size() = 1 then ownedExpressions->at(1) + /// else ownedExpressions->at(2) + /// endif endif + /// + /// /// /// The subject /// @@ -77,6 +115,7 @@ internal static IExpression ComputeLowerBound(this IMultiplicityRange multiplici /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IMultiplicityRange.upperBound))] internal static IExpression ComputeUpperBound(this IMultiplicityRange multiplicityRangeSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -86,6 +125,17 @@ internal static IExpression ComputeUpperBound(this IMultiplicityRange multiplici /// Check whether this MultiplicityRange represents the range bounded by the given values lower and /// upper, presuming the lowerBound and upperBound Expressions are model-level evaluable. /// + /// + /// OCL2.0: + /// + /// valueOf(upperBound) = upper and + /// let lowerValue: UnlimitedNatural = valueOf(lowerBound) in + /// (lowerValue = lower or + /// lowerValue = null and + /// (lower = upper or + /// lower = 0 and upper = *)) + /// + /// /// /// The subject /// @@ -99,6 +149,7 @@ internal static IExpression ComputeUpperBound(this IMultiplicityRange multiplici /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IMultiplicityRange.HasBounds))] internal static bool ComputeHasBoundsOperation(this IMultiplicityRange multiplicityRangeSubject, int lower, string upper) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -108,6 +159,26 @@ internal static bool ComputeHasBoundsOperation(this IMultiplicityRange multiplic /// Evaluate the given bound Expression (at model level) and return the result represented as a MOF /// UnlimitedNatural value. /// + /// + /// OCL2.0: + /// + /// if bound = null or not bound.isModelLevelEvaluable then + /// null + /// else + /// let boundEval: Sequence(Element) = bound.evaluate(owningType) in + /// if boundEval->size() <> 1 then null else + /// let valueEval: Element = boundEval->at(1) in + /// if valueEval.oclIsKindOf(LiteralInfinity) then * + /// else if valueEval.oclIsKindOf(LiteralInteger) then + /// let value : Integer = + /// valueEval.oclAsKindOf(LiteralInteger).value in + /// if value >= 0 then value else null endif + /// else null + /// endif endif + /// endif + /// endif + /// + /// /// /// The subject /// @@ -118,6 +189,7 @@ internal static bool ComputeHasBoundsOperation(this IMultiplicityRange multiplic /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IMultiplicityRange.ValueOf))] internal static string ComputeValueOfOperation(this IMultiplicityRange multiplicityRangeSubject, IExpression bound) { throw new NotSupportedException("Create a GitHub issue when this method is required"); diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/OwningMembershipExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/OwningMembershipExtensions.cs index e9adbc721..88b7c16bb 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/OwningMembershipExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/OwningMembershipExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Root.Namespaces using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Elements; @@ -43,6 +45,7 @@ internal static class OwningMembershipExtensions /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IOwningMembership.ownedMemberElement))] internal static IElement ComputeOwnedMemberElement(this IOwningMembership owningMembershipSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -58,6 +61,7 @@ internal static IElement ComputeOwnedMemberElement(this IOwningMembership owning /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IOwningMembership.ownedMemberElementId))] internal static string ComputeOwnedMemberElementId(this IOwningMembership owningMembershipSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -66,6 +70,12 @@ internal static string ComputeOwnedMemberElementId(this IOwningMembership owning /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// ownedMemberName = ownedMemberElement.name + /// + /// /// /// The subject /// @@ -73,6 +83,7 @@ internal static string ComputeOwnedMemberElementId(this IOwningMembership owning /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IOwningMembership.ownedMemberName))] internal static string ComputeOwnedMemberName(this IOwningMembership owningMembershipSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -81,6 +92,12 @@ internal static string ComputeOwnedMemberName(this IOwningMembership owningMembe /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// ownedMemberShortName = ownedMemberElement.shortName + /// + /// /// /// The subject /// @@ -88,6 +105,7 @@ internal static string ComputeOwnedMemberName(this IOwningMembership owningMembe /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IOwningMembership.ownedMemberShortName))] internal static string ComputeOwnedMemberShortName(this IOwningMembership owningMembershipSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -98,6 +116,15 @@ internal static string ComputeOwnedMemberShortName(this IOwningMembership owning /// string constructed by appending to that qualifiedName the string "/owningMembership". Otherwise, /// return the path of the OwningMembership as specified for a Relationship in general. /// + /// + /// OCL2.0: + /// + /// if ownedElement.qualifiedName <> null then + /// ownedElement.qualifiedName + '/owningMembership' + /// else self.oclAsType(Relationship).path() + /// endif + /// + /// /// /// The subject /// @@ -105,6 +132,7 @@ internal static string ComputeOwnedMemberShortName(this IOwningMembership owning /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IOwningMembership.Path))] internal static string ComputeRedefinedPathOperation(this IOwningMembership owningMembershipSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/ReferenceSubsettingExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/ReferenceSubsettingExtensions.cs index 2d0ca2f2e..acad9b69e 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/ReferenceSubsettingExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/ReferenceSubsettingExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Core.Features using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Elements; @@ -44,6 +46,7 @@ internal static class ReferenceSubsettingExtensions /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IReferenceSubsetting.referencingFeature))] internal static IFeature ComputeReferencingFeature(this IReferenceSubsetting referenceSubsettingSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/RelationshipExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/RelationshipExtensions.cs index a331b8a2b..8855fb14c 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/RelationshipExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/RelationshipExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Root.Elements using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Namespaces; @@ -35,6 +37,12 @@ internal static class RelationshipExtensions /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// relatedElement = source->union(target) + /// + /// /// /// The subject /// @@ -42,6 +50,7 @@ internal static class RelationshipExtensions /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IRelationship.relatedElement))] internal static List ComputeRelatedElement(this IRelationship relationshipSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -51,6 +60,14 @@ internal static List ComputeRelatedElement(this IRelationship relation /// Return whether this Relationship has either an owningRelatedElement or owningRelationship that is a /// library element. /// + /// + /// OCL2.0: + /// + /// if owningRelatedElement <> null then owningRelatedElement.libraryNamespace() + /// else if owningRelationship <> null then owningRelationship.libraryNamespace() + /// else null endif endif + /// + /// /// /// The subject /// @@ -58,6 +75,7 @@ internal static List ComputeRelatedElement(this IRelationship relation /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IRelationship.LibraryNamespace))] internal static INamespace ComputeRedefinedLibraryNamespaceOperation(this IRelationship relationshipSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -69,6 +87,19 @@ internal static INamespace ComputeRedefinedLibraryNamespaceOperation(this IRelat /// owningRelatedElement. Otherwise, return the path of the Relationship as specified for an Element in /// general. /// + /// + /// OCL2.0: + /// + /// if owningRelationship = null and owningRelatedElement <> null then + /// owningRelatedElement.path() + '/' + + /// owningRelatedElement.ownedRelationship->indexOf(self).toString() + /// -- A position index shall be converted to a decimal string representation + /// -- consisting of only decimal digits, with no sign, leading zeros or leading + /// -- or trailing whitespace. + /// else self.oclAsType(Element).path() + /// endif + /// + /// /// /// The subject /// @@ -76,6 +107,7 @@ internal static INamespace ComputeRedefinedLibraryNamespaceOperation(this IRelat /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IRelationship.Path))] internal static string ComputeRedefinedPathOperation(this IRelationship relationshipSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/RequirementUsageExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/RequirementUsageExtensions.cs index 1ba1f57ad..5c91ec7ac 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/RequirementUsageExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/RequirementUsageExtensions.cs @@ -23,7 +23,10 @@ namespace SysML2.NET.Core.POCO.Systems.Requirements using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; using SysML2.NET.Core.POCO.Core.Classifiers; using SysML2.NET.Core.POCO.Core.Features; @@ -65,6 +68,14 @@ internal static class RequirementUsageExtensions /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// actorParameter = featureMembership-> + /// selectByKind(ActorMembership). + /// ownedActorParameter + /// + /// /// /// The subject /// @@ -72,6 +83,7 @@ internal static class RequirementUsageExtensions /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IRequirementUsage.actorParameter))] internal static List ComputeActorParameter(this IRequirementUsage requirementUsageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -80,6 +92,15 @@ internal static List ComputeActorParameter(this IRequirementUsage re /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// assumedConstraint = ownedFeatureMembership-> + /// selectByKind(RequirementConstraintMembership)-> + /// select(kind = RequirementConstraintKind::assumption). + /// ownedConstraint + /// + /// /// /// The subject /// @@ -87,6 +108,7 @@ internal static List ComputeActorParameter(this IRequirementUsage re /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IRequirementUsage.assumedConstraint))] internal static List ComputeAssumedConstraint(this IRequirementUsage requirementUsageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -95,6 +117,14 @@ internal static List ComputeAssumedConstraint(this IRequiremen /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// framedConcern = featureMembership-> + /// selectByKind(FramedConcernMembership). + /// ownedConcern + /// + /// /// /// The subject /// @@ -102,6 +132,7 @@ internal static List ComputeAssumedConstraint(this IRequiremen /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IRequirementUsage.framedConcern))] internal static List ComputeFramedConcern(this IRequirementUsage requirementUsageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -110,6 +141,15 @@ internal static List ComputeFramedConcern(this IRequirementUsage /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// requiredConstraint = ownedFeatureMembership-> + /// selectByKind(RequirementConstraintMembership)-> + /// select(kind = RequirementConstraintKind::requirement). + /// ownedConstraint + /// + /// /// /// The subject /// @@ -117,6 +157,7 @@ internal static List ComputeFramedConcern(this IRequirementUsage /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IRequirementUsage.requiredConstraint))] internal static List ComputeRequiredConstraint(this IRequirementUsage requirementUsageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -132,6 +173,7 @@ internal static List ComputeRequiredConstraint(this IRequireme /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IRequirementUsage.requirementDefinition))] internal static IRequirementDefinition ComputeRequirementDefinition(this IRequirementUsage requirementUsageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -140,6 +182,14 @@ internal static IRequirementDefinition ComputeRequirementDefinition(this IRequir /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// stakeholderParameter = featureMembership-> + /// selectByKind(AStakholderMembership). + /// ownedStakeholderParameter + /// + /// /// /// The subject /// @@ -147,6 +197,7 @@ internal static IRequirementDefinition ComputeRequirementDefinition(this IRequir /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IRequirementUsage.stakeholderParameter))] internal static List ComputeStakeholderParameter(this IRequirementUsage requirementUsageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -155,6 +206,17 @@ internal static List ComputeStakeholderParameter(this IRequirementUs /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// subjectParameter = + /// let subjects : OrderedSet(SubjectMembership) = + /// featureMembership->selectByKind(SubjectMembership) in + /// if subjects->isEmpty() then null + /// else subjects->first().ownedSubjectParameter + /// endif + /// + /// /// /// The subject /// @@ -162,6 +224,7 @@ internal static List ComputeStakeholderParameter(this IRequirementUs /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IRequirementUsage.subjectParameter))] internal static IUsage ComputeSubjectParameter(this IRequirementUsage requirementUsageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -170,6 +233,12 @@ internal static IUsage ComputeSubjectParameter(this IRequirementUsage requiremen /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// text = documentation.body + /// + /// /// /// The subject /// @@ -177,6 +246,7 @@ internal static IUsage ComputeSubjectParameter(this IRequirementUsage requiremen /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IRequirementUsage.text))] internal static List ComputeText(this IRequirementUsage requirementUsageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/SelectExpressionExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/SelectExpressionExtensions.cs index c86871811..ad9807746 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/SelectExpressionExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/SelectExpressionExtensions.cs @@ -23,7 +23,10 @@ namespace SysML2.NET.Core.POCO.Kernel.Expressions using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.POCO.Kernel.Behaviors; diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/SubclassificationExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/SubclassificationExtensions.cs index 858b90edd..87d511c04 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/SubclassificationExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/SubclassificationExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Core.Classifiers using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Elements; @@ -44,6 +46,7 @@ internal static class SubclassificationExtensions /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(ISubclassification.owningClassifier))] internal static IClassifier ComputeOwningClassifier(this ISubclassification subclassificationSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/TextualRepresentationExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/TextualRepresentationExtensions.cs index fce6d2c38..72e6c8ae9 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/TextualRepresentationExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/TextualRepresentationExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Root.Annotations using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Root.Elements; using SysML2.NET.Core.POCO.Root.Namespaces; @@ -42,6 +44,7 @@ internal static class TextualRepresentationExtensions /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(ITextualRepresentation.representedElement))] internal static IElement ComputeRepresentedElement(this ITextualRepresentation textualRepresentationSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/UsageExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/UsageExtensions.cs index f967d7231..7c6ced157 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/UsageExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtend/UsageExtensions.cs @@ -23,7 +23,10 @@ namespace SysML2.NET.Core.POCO.Systems.DefinitionAndUsage using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Classifiers; using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Core.Types; @@ -68,6 +71,7 @@ internal static class UsageExtensions /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.definition))] internal static List ComputeDefinition(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -76,6 +80,12 @@ internal static List ComputeDefinition(this IUsage usageSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// directedUsage = directedFeature->selectByKind(Usage) + /// + /// /// /// The subject /// @@ -83,6 +93,7 @@ internal static List ComputeDefinition(this IUsage usageSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.directedUsage))] internal static List ComputeDirectedUsage(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -91,6 +102,12 @@ internal static List ComputeDirectedUsage(this IUsage usageSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// isReference = not isComposite + /// + /// /// /// The subject /// @@ -98,6 +115,7 @@ internal static List ComputeDirectedUsage(this IUsage usageSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.isReference))] internal static bool ComputeIsReference(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -106,6 +124,20 @@ internal static bool ComputeIsReference(this IUsage usageSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// mayTimeVary = + /// owningType <> null and + /// owningType.specializesFromLibrary('Occurrences::Occurrence') and + /// not ( + /// isPortion or + /// specializesFromLibrary('Links::SelfLink') or + /// specializesFromLibrary('Occurrences::HappensLink') or + /// isComposite and specializesFromLibrary('Actions::Action') + /// ) + /// + /// /// /// The subject /// @@ -113,6 +145,7 @@ internal static bool ComputeIsReference(this IUsage usageSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.mayTimeVary))] internal static bool ComputeMayTimeVary(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -121,6 +154,12 @@ internal static bool ComputeMayTimeVary(this IUsage usageSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedAction = nestedUsage->selectByKind(ActionUsage) + /// + /// /// /// The subject /// @@ -128,6 +167,7 @@ internal static bool ComputeMayTimeVary(this IUsage usageSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedAction))] internal static List ComputeNestedAction(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -136,6 +176,12 @@ internal static List ComputeNestedAction(this IUsage usageSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedAllocation = nestedUsage->selectByKind(AllocationUsage) + /// + /// /// /// The subject /// @@ -143,6 +189,7 @@ internal static List ComputeNestedAction(this IUsage usageSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedAllocation))] internal static List ComputeNestedAllocation(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -151,6 +198,12 @@ internal static List ComputeNestedAllocation(this IUsage usage /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedAnalysisCase = nestedUsage->selectByKind(AnalysisCaseUsage) + /// + /// /// /// The subject /// @@ -158,6 +211,7 @@ internal static List ComputeNestedAllocation(this IUsage usage /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedAnalysisCase))] internal static List ComputeNestedAnalysisCase(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -166,6 +220,12 @@ internal static List ComputeNestedAnalysisCase(this IUsage u /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedAttribute = nestedUsage->selectByKind(AttributeUsage) + /// + /// /// /// The subject /// @@ -173,6 +233,7 @@ internal static List ComputeNestedAnalysisCase(this IUsage u /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedAttribute))] internal static List ComputeNestedAttribute(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -181,6 +242,12 @@ internal static List ComputeNestedAttribute(this IUsage usageSu /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedCalculation = nestedUsage->selectByKind(CalculationUsage) + /// + /// /// /// The subject /// @@ -188,6 +255,7 @@ internal static List ComputeNestedAttribute(this IUsage usageSu /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedCalculation))] internal static List ComputeNestedCalculation(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -196,6 +264,12 @@ internal static List ComputeNestedCalculation(this IUsage usa /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedCase = nestedUsage->selectByKind(CaseUsage) + /// + /// /// /// The subject /// @@ -203,6 +277,7 @@ internal static List ComputeNestedCalculation(this IUsage usa /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedCase))] internal static List ComputeNestedCase(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -211,6 +286,12 @@ internal static List ComputeNestedCase(this IUsage usageSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedConcern = nestedUsage->selectByKind(ConcernUsage) + /// + /// /// /// The subject /// @@ -218,6 +299,7 @@ internal static List ComputeNestedCase(this IUsage usageSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedConcern))] internal static List ComputeNestedConcern(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -226,6 +308,12 @@ internal static List ComputeNestedConcern(this IUsage usageSubjec /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedConnection = nestedUsage->selectByKind(ConnectorAsUsage) + /// + /// /// /// The subject /// @@ -233,6 +321,7 @@ internal static List ComputeNestedConcern(this IUsage usageSubjec /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedConnection))] internal static List ComputeNestedConnection(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -241,6 +330,12 @@ internal static List ComputeNestedConnection(this IUsage usag /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedConstraint = nestedUsage->selectByKind(ConstraintUsage) + /// + /// /// /// The subject /// @@ -248,6 +343,7 @@ internal static List ComputeNestedConnection(this IUsage usag /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedConstraint))] internal static List ComputeNestedConstraint(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -256,6 +352,12 @@ internal static List ComputeNestedConstraint(this IUsage usage /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// ownedNested = nestedUsage->selectByKind(EnumerationUsage) + /// + /// /// /// The subject /// @@ -263,6 +365,7 @@ internal static List ComputeNestedConstraint(this IUsage usage /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedEnumeration))] internal static List ComputeNestedEnumeration(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -271,6 +374,12 @@ internal static List ComputeNestedEnumeration(this IUsage usa /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedFlow = nestedUsage->selectByKind(FlowUsage) + /// + /// /// /// The subject /// @@ -278,6 +387,7 @@ internal static List ComputeNestedEnumeration(this IUsage usa /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedFlow))] internal static List ComputeNestedFlow(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -286,6 +396,12 @@ internal static List ComputeNestedFlow(this IUsage usageSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedInterface = nestedUsage->selectByKind(ReferenceUsage) + /// + /// /// /// The subject /// @@ -293,6 +409,7 @@ internal static List ComputeNestedFlow(this IUsage usageSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedInterface))] internal static List ComputeNestedInterface(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -301,6 +418,12 @@ internal static List ComputeNestedInterface(this IUsage usageSu /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedItem = nestedUsage->selectByKind(ItemUsage) + /// + /// /// /// The subject /// @@ -308,6 +431,7 @@ internal static List ComputeNestedInterface(this IUsage usageSu /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedItem))] internal static List ComputeNestedItem(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -316,6 +440,12 @@ internal static List ComputeNestedItem(this IUsage usageSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedMetadata = nestedUsage->selectByKind(MetadataUsage) + /// + /// /// /// The subject /// @@ -323,6 +453,7 @@ internal static List ComputeNestedItem(this IUsage usageSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedMetadata))] internal static List ComputeNestedMetadata(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -331,6 +462,12 @@ internal static List ComputeNestedMetadata(this IUsage usageSubj /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedOccurrence = nestedUsage->selectByKind(OccurrenceUsage) + /// + /// /// /// The subject /// @@ -338,6 +475,7 @@ internal static List ComputeNestedMetadata(this IUsage usageSubj /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedOccurrence))] internal static List ComputeNestedOccurrence(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -346,6 +484,12 @@ internal static List ComputeNestedOccurrence(this IUsage usage /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedPart = nestedUsage->selectByKind(PartUsage) + /// + /// /// /// The subject /// @@ -353,6 +497,7 @@ internal static List ComputeNestedOccurrence(this IUsage usage /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedPart))] internal static List ComputeNestedPart(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -361,6 +506,12 @@ internal static List ComputeNestedPart(this IUsage usageSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedPort = nestedUsage->selectByKind(PortUsage) + /// + /// /// /// The subject /// @@ -368,6 +519,7 @@ internal static List ComputeNestedPart(this IUsage usageSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedPort))] internal static List ComputeNestedPort(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -376,6 +528,12 @@ internal static List ComputeNestedPort(this IUsage usageSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedReference = nestedUsage->selectByKind(ReferenceUsage) + /// + /// /// /// The subject /// @@ -383,6 +541,7 @@ internal static List ComputeNestedPort(this IUsage usageSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedReference))] internal static List ComputeNestedReference(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -391,6 +550,12 @@ internal static List ComputeNestedReference(this IUsage usageSu /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedRendering = nestedUsage->selectByKind(RenderingUsage) + /// + /// /// /// The subject /// @@ -398,6 +563,7 @@ internal static List ComputeNestedReference(this IUsage usageSu /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedRendering))] internal static List ComputeNestedRendering(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -406,6 +572,12 @@ internal static List ComputeNestedRendering(this IUsage usageSu /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedRequirement = nestedUsage->selectByKind(RequirementUsage) + /// + /// /// /// The subject /// @@ -413,6 +585,7 @@ internal static List ComputeNestedRendering(this IUsage usageSu /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedRequirement))] internal static List ComputeNestedRequirement(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -421,6 +594,12 @@ internal static List ComputeNestedRequirement(this IUsage usa /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedState = nestedUsage->selectByKind(StateUsage) + /// + /// /// /// The subject /// @@ -428,6 +607,7 @@ internal static List ComputeNestedRequirement(this IUsage usa /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedState))] internal static List ComputeNestedState(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -436,6 +616,12 @@ internal static List ComputeNestedState(this IUsage usageSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedTransition = nestedUsage->selectByKind(TransitionUsage) + /// + /// /// /// The subject /// @@ -443,6 +629,7 @@ internal static List ComputeNestedState(this IUsage usageSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedTransition))] internal static List ComputeNestedTransition(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -451,6 +638,12 @@ internal static List ComputeNestedTransition(this IUsage usage /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedUsage = ownedFeature->selectByKind(Usage) + /// + /// /// /// The subject /// @@ -458,6 +651,7 @@ internal static List ComputeNestedTransition(this IUsage usage /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedUsage))] internal static List ComputeNestedUsage(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -466,6 +660,12 @@ internal static List ComputeNestedUsage(this IUsage usageSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedUseCase = nestedUsage->selectByKind(UseCaseUsage) + /// + /// /// /// The subject /// @@ -473,6 +673,7 @@ internal static List ComputeNestedUsage(this IUsage usageSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedUseCase))] internal static List ComputeNestedUseCase(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -481,6 +682,12 @@ internal static List ComputeNestedUseCase(this IUsage usageSubjec /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedVerificationCase = nestedUsage->selectByKind(VerificationCaseUsage) + /// + /// /// /// The subject /// @@ -488,6 +695,7 @@ internal static List ComputeNestedUseCase(this IUsage usageSubjec /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedVerificationCase))] internal static List ComputeNestedVerificationCase(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -496,6 +704,12 @@ internal static List ComputeNestedVerificationCase(this /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedView = nestedUsage->selectByKind(ViewUsage) + /// + /// /// /// The subject /// @@ -503,6 +717,7 @@ internal static List ComputeNestedVerificationCase(this /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedView))] internal static List ComputeNestedView(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -511,6 +726,12 @@ internal static List ComputeNestedView(this IUsage usageSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// nestedViewpoint = nestedUsage->selectByKind(ViewpointUsage) + /// + /// /// /// The subject /// @@ -518,6 +739,7 @@ internal static List ComputeNestedView(this IUsage usageSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.nestedViewpoint))] internal static List ComputeNestedViewpoint(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -533,6 +755,7 @@ internal static List ComputeNestedViewpoint(this IUsage usageSu /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.owningDefinition))] internal static IDefinition ComputeOwningDefinition(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -548,6 +771,7 @@ internal static IDefinition ComputeOwningDefinition(this IUsage usageSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.owningUsage))] internal static IUsage ComputeOwningUsage(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -556,6 +780,12 @@ internal static IUsage ComputeOwningUsage(this IUsage usageSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// usage = feature->selectByKind(Usage) + /// + /// /// /// The subject /// @@ -563,6 +793,7 @@ internal static IUsage ComputeOwningUsage(this IUsage usageSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.usage))] internal static List ComputeUsage(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -571,6 +802,12 @@ internal static List ComputeUsage(this IUsage usageSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// variant = variantMembership.ownedVariantUsage + /// + /// /// /// The subject /// @@ -578,6 +815,7 @@ internal static List ComputeUsage(this IUsage usageSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.variant))] internal static List ComputeVariant(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -586,6 +824,12 @@ internal static List ComputeVariant(this IUsage usageSubject) /// /// Computes the derived property. /// + /// + /// OCL2.0: + /// + /// variantMembership = ownedMembership->selectByKind(VariantMembership) + /// + /// /// /// The subject /// @@ -593,6 +837,7 @@ internal static List ComputeVariant(this IUsage usageSubject) /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(IUsage.variantMembership))] internal static List ComputeVariantMembership(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -602,6 +847,16 @@ internal static List ComputeVariantMembership(this IUsage us /// If this Usage is a variant, then its naming Feature is the referencedFeature of its /// ownedReferenceSubsetting. /// + /// + /// OCL2.0: + /// + /// if not owningMembership.oclIsKindOf(VariantMembership) then + /// self.oclAsType(Feature).namingFeature() + /// else if ownedReferenceSubsetting = null then null + /// else ownedReferenceSubsetting.referencedFeature + /// endif endif + /// + /// /// /// The subject /// @@ -609,6 +864,7 @@ internal static List ComputeVariantMembership(this IUsage us /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IUsage.NamingFeature))] internal static IFeature ComputeRedefinedNamingFeatureOperation(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -618,6 +874,14 @@ internal static IFeature ComputeRedefinedNamingFeatureOperation(this IUsage usag /// If ownedReferenceSubsetting is not null, return the featureTarget of the referencedFeature of the /// ownedReferenceSubsetting. /// + /// + /// OCL2.0: + /// + /// if ownedReferenceSubsetting = null then null + /// else ownedReferenceSubsetting.referencedFeature.featureTarget + /// endif + /// + /// /// /// The subject /// @@ -625,6 +889,7 @@ internal static IFeature ComputeRedefinedNamingFeatureOperation(this IUsage usag /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IUsage.ReferencedFeatureTarget))] internal static IFeature ComputeReferencedFeatureTargetOperation(this IUsage usageSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); diff --git a/SysML2.NET.CodeGenerator/Templates/Uml/core-poco-extend-uml-template.hbs b/SysML2.NET.CodeGenerator/Templates/Uml/core-poco-extend-uml-template.hbs index 77a8b4495..83f116b38 100644 --- a/SysML2.NET.CodeGenerator/Templates/Uml/core-poco-extend-uml-template.hbs +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-poco-extend-uml-template.hbs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.{{ #NamedElement.WriteFullyQualifiedNameSpace thi using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + {{ #Class.WriteEnumerationNameSpacesWithOperation this}} {{ #Class.WriteNameSpaces this POCO}} @@ -47,6 +49,7 @@ namespace SysML2.NET.Core.POCO.{{ #NamedElement.WriteFullyQualifiedNameSpace thi /// the computed result /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [DerivedProperty(name: nameof(I{{../this.Name}}.{{property.Name}}))] internal static {{ Property.WriteTypeForExtendClass property }} Compute{{String.CapitalizeFirstLetter property.Name}}(this I{{../this.Name}} {{String.LowerCaseFirstLetter ../this.Name}}Subject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); @@ -64,6 +67,7 @@ namespace SysML2.NET.Core.POCO.{{ #NamedElement.WriteFullyQualifiedNameSpace thi /// {{ #ParameterDocumentation operation }} [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(I{{../this.Name}}.{{String.CapitalizeFirstLetter operation.Name}}))] {{ #Operation.WriteForPOCOExtend operation }} { throw new NotSupportedException("Create a GitHub issue when this method is required"); diff --git a/SysML2.NET/Decorators/DerivedPropertyAttribute.cs b/SysML2.NET/Decorators/DerivedPropertyAttribute.cs new file mode 100644 index 000000000..0a81286e2 --- /dev/null +++ b/SysML2.NET/Decorators/DerivedPropertyAttribute.cs @@ -0,0 +1,47 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Decorators +{ + using System; + + /// + /// Attribute used to decorate a method that computes a derived property of the metamodel. + /// + [AttributeUsage(AttributeTargets.Method)] + public sealed class DerivedPropertyAttribute : Attribute + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The name of the derived property on the metaclass interface. + /// + public DerivedPropertyAttribute(string name) + { + this.Name = name; + } + + /// + /// Gets or sets the name of the derived property on the metaclass interface. + /// + public string Name { get; set; } + } +} diff --git a/SysML2.NET/Decorators/OperationAttribute.cs b/SysML2.NET/Decorators/OperationAttribute.cs new file mode 100644 index 000000000..0a276b545 --- /dev/null +++ b/SysML2.NET/Decorators/OperationAttribute.cs @@ -0,0 +1,47 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Decorators +{ + using System; + + /// + /// Attribute used to decorate a method that implements an operation of the metamodel. + /// + [AttributeUsage(AttributeTargets.Method)] + public sealed class OperationAttribute : Attribute + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The name of the operation on the metaclass interface. + /// + public OperationAttribute(string name) + { + this.Name = name; + } + + /// + /// Gets or sets the name of the operation on the metaclass interface. + /// + public string Name { get; set; } + } +} diff --git a/SysML2.NET/Extend/AcceptActionUsageExtensions.cs b/SysML2.NET/Extend/AcceptActionUsageExtensions.cs index b970aaa80..3d893685a 100644 --- a/SysML2.NET/Extend/AcceptActionUsageExtensions.cs +++ b/SysML2.NET/Extend/AcceptActionUsageExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Systems.Actions using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -78,6 +80,7 @@ internal static class AcceptActionUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IAcceptActionUsage.payloadArgument))] internal static IExpression ComputePayloadArgument(this IAcceptActionUsage acceptActionUsageSubject) { return acceptActionUsageSubject == null @@ -102,6 +105,7 @@ internal static IExpression ComputePayloadArgument(this IAcceptActionUsage accep /// /// the computed result /// + [DerivedProperty(name: nameof(IAcceptActionUsage.payloadParameter))] internal static IReferenceUsage ComputePayloadParameter(this IAcceptActionUsage acceptActionUsageSubject) { if (acceptActionUsageSubject == null) @@ -131,6 +135,7 @@ internal static IReferenceUsage ComputePayloadParameter(this IAcceptActionUsage /// /// the computed result /// + [DerivedProperty(name: nameof(IAcceptActionUsage.receiverArgument))] internal static IExpression ComputeReceiverArgument(this IAcceptActionUsage acceptActionUsageSubject) { return acceptActionUsageSubject == null @@ -155,6 +160,7 @@ internal static IExpression ComputeReceiverArgument(this IAcceptActionUsage acce /// /// The expected /// + [Operation(name: nameof(IAcceptActionUsage.IsTriggerAction))] internal static bool ComputeIsTriggerActionOperation(this IAcceptActionUsage acceptActionUsageSubject) { return acceptActionUsageSubject == null diff --git a/SysML2.NET/Extend/ActionDefinitionExtensions.cs b/SysML2.NET/Extend/ActionDefinitionExtensions.cs index 096e46a58..fa19f3369 100644 --- a/SysML2.NET/Extend/ActionDefinitionExtensions.cs +++ b/SysML2.NET/Extend/ActionDefinitionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Actions using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Classifiers; @@ -76,6 +78,7 @@ internal static class ActionDefinitionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IActionDefinition.action))] internal static List ComputeAction(this IActionDefinition actionDefinitionSubject) { return actionDefinitionSubject == null diff --git a/SysML2.NET/Extend/ActionUsageExtensions.cs b/SysML2.NET/Extend/ActionUsageExtensions.cs index 2b2f3dc76..9d6455b0f 100644 --- a/SysML2.NET/Extend/ActionUsageExtensions.cs +++ b/SysML2.NET/Extend/ActionUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Actions using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Kernel.Behaviors; using SysML2.NET.Core.POCO.Kernel.FeatureValues; @@ -46,6 +48,7 @@ internal static class ActionUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IActionUsage.actionDefinition))] internal static List ComputeActionDefinition(this IActionUsage actionUsageSubject) { return actionUsageSubject == null @@ -68,6 +71,7 @@ internal static List ComputeActionDefinition(this IActionUsage action /// /// The expected collection of /// + [Operation(name: nameof(IActionUsage.InputParameters))] internal static List ComputeInputParametersOperation(this IActionUsage actionUsageSubject) { return actionUsageSubject == null @@ -96,6 +100,7 @@ internal static List ComputeInputParametersOperation(this IActionUsage /// /// The expected /// + [Operation(name: nameof(IActionUsage.InputParameter))] internal static IFeature ComputeInputParameterOperation(this IActionUsage actionUsageSubject, int i) { if (actionUsageSubject == null) @@ -137,6 +142,7 @@ internal static IFeature ComputeInputParameterOperation(this IActionUsage action /// /// The expected /// + [Operation(name: nameof(IActionUsage.Argument))] internal static IExpression ComputeArgumentOperation(this IActionUsage actionUsageSubject, int i) { return actionUsageSubject == null @@ -166,6 +172,7 @@ internal static IExpression ComputeArgumentOperation(this IActionUsage actionUsa /// /// The expected /// + [Operation(name: nameof(IActionUsage.IsSubactionUsage))] internal static bool ComputeIsSubactionUsageOperation(this IActionUsage actionUsageSubject) { if (actionUsageSubject == null) diff --git a/SysML2.NET/Extend/ActorMembershipExtensions.cs b/SysML2.NET/Extend/ActorMembershipExtensions.cs index 8ab7bbac2..d569430d2 100644 --- a/SysML2.NET/Extend/ActorMembershipExtensions.cs +++ b/SysML2.NET/Extend/ActorMembershipExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Systems.Requirements using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Features; @@ -49,6 +51,7 @@ internal static class ActorMembershipExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IActorMembership.ownedActorParameter))] internal static IPartUsage ComputeOwnedActorParameter(this IActorMembership actorMembershipSubject) { if (actorMembershipSubject == null) diff --git a/SysML2.NET/Extend/AllocationDefinitionExtensions.cs b/SysML2.NET/Extend/AllocationDefinitionExtensions.cs index 84a40cbf1..eafd24263 100644 --- a/SysML2.NET/Extend/AllocationDefinitionExtensions.cs +++ b/SysML2.NET/Extend/AllocationDefinitionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Allocations using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Classifiers; @@ -76,6 +78,7 @@ internal static class AllocationDefinitionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IAllocationDefinition.allocation))] internal static List ComputeAllocation(this IAllocationDefinition allocationDefinitionSubject) { return allocationDefinitionSubject == null diff --git a/SysML2.NET/Extend/AllocationUsageExtensions.cs b/SysML2.NET/Extend/AllocationUsageExtensions.cs index adb266bd7..d9e888314 100644 --- a/SysML2.NET/Extend/AllocationUsageExtensions.cs +++ b/SysML2.NET/Extend/AllocationUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Allocations using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -74,6 +76,7 @@ internal static class AllocationUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IAllocationUsage.allocationDefinition))] internal static List ComputeAllocationDefinition(this IAllocationUsage allocationUsageSubject) { return allocationUsageSubject == null diff --git a/SysML2.NET/Extend/AnalysisCaseDefinitionExtensions.cs b/SysML2.NET/Extend/AnalysisCaseDefinitionExtensions.cs index 95d6ec42e..d4d4e3c31 100644 --- a/SysML2.NET/Extend/AnalysisCaseDefinitionExtensions.cs +++ b/SysML2.NET/Extend/AnalysisCaseDefinitionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.AnalysisCases using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Classifiers; @@ -83,6 +85,7 @@ internal static class AnalysisCaseDefinitionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IAnalysisCaseDefinition.resultExpression))] internal static IExpression ComputeResultExpression(this IAnalysisCaseDefinition analysisCaseDefinitionSubject) { if (analysisCaseDefinitionSubject == null) diff --git a/SysML2.NET/Extend/AnalysisCaseUsageExtensions.cs b/SysML2.NET/Extend/AnalysisCaseUsageExtensions.cs index fd80fab58..7980a9a79 100644 --- a/SysML2.NET/Extend/AnalysisCaseUsageExtensions.cs +++ b/SysML2.NET/Extend/AnalysisCaseUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.AnalysisCases using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -85,6 +87,7 @@ internal static class AnalysisCaseUsageExtensions /// (upper-bound violation against the derived /// [0..1] property). /// + [DerivedProperty(name: nameof(IAnalysisCaseUsage.analysisCaseDefinition))] internal static IAnalysisCaseDefinition ComputeAnalysisCaseDefinition(this IAnalysisCaseUsage analysisCaseUsageSubject) { return analysisCaseUsageSubject == null @@ -113,6 +116,7 @@ internal static IAnalysisCaseDefinition ComputeAnalysisCaseDefinition(this IAnal /// /// the computed result /// + [DerivedProperty(name: nameof(IAnalysisCaseUsage.resultExpression))] internal static IExpression ComputeResultExpression(this IAnalysisCaseUsage analysisCaseUsageSubject) { if (analysisCaseUsageSubject == null) diff --git a/SysML2.NET/Extend/AnnotatingElementExtensions.cs b/SysML2.NET/Extend/AnnotatingElementExtensions.cs index 226b6a77f..6068173d8 100644 --- a/SysML2.NET/Extend/AnnotatingElementExtensions.cs +++ b/SysML2.NET/Extend/AnnotatingElementExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Root.Annotations using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -49,6 +51,7 @@ internal static class AnnotatingElementExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IAnnotatingElement.annotatedElement))] internal static List ComputeAnnotatedElement(this IAnnotatingElement annotatingElementSubject) { if (annotatingElementSubject == null) @@ -87,6 +90,7 @@ internal static List ComputeAnnotatedElement(this IAnnotatingElement a /// /// the computed result /// + [DerivedProperty(name: nameof(IAnnotatingElement.annotation))] internal static List ComputeAnnotation(this IAnnotatingElement annotatingElementSubject) { if (annotatingElementSubject == null) @@ -122,6 +126,7 @@ internal static List ComputeAnnotation(this IAnnotatingElement anno /// /// the computed result /// + [DerivedProperty(name: nameof(IAnnotatingElement.ownedAnnotatingRelationship))] internal static List ComputeOwnedAnnotatingRelationship(this IAnnotatingElement annotatingElementSubject) { if (annotatingElementSubject == null) @@ -152,6 +157,7 @@ internal static List ComputeOwnedAnnotatingRelationship(this IAnnot /// /// the computed result /// + [DerivedProperty(name: nameof(IAnnotatingElement.owningAnnotatingRelationship))] internal static IAnnotation ComputeOwningAnnotatingRelationship(this IAnnotatingElement annotatingElementSubject) { return annotatingElementSubject == null diff --git a/SysML2.NET/Extend/AnnotationExtensions.cs b/SysML2.NET/Extend/AnnotationExtensions.cs index dddecfe36..ddc27c7cf 100644 --- a/SysML2.NET/Extend/AnnotationExtensions.cs +++ b/SysML2.NET/Extend/AnnotationExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Root.Annotations using System; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -49,6 +51,7 @@ internal static class AnnotationExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IAnnotation.annotatingElement))] internal static IAnnotatingElement ComputeAnnotatingElement(this IAnnotation annotationSubject) { return annotationSubject == null @@ -76,6 +79,7 @@ internal static IAnnotatingElement ComputeAnnotatingElement(this IAnnotation ann /// /// the computed result /// + [DerivedProperty(name: nameof(IAnnotation.ownedAnnotatingElement))] internal static IAnnotatingElement ComputeOwnedAnnotatingElement(this IAnnotation annotationSubject) { return annotationSubject == null @@ -92,6 +96,7 @@ internal static IAnnotatingElement ComputeOwnedAnnotatingElement(this IAnnotatio /// /// the computed result /// + [DerivedProperty(name: nameof(IAnnotation.owningAnnotatedElement))] internal static IElement ComputeOwningAnnotatedElement(this IAnnotation annotationSubject) { if (annotationSubject == null) @@ -116,6 +121,7 @@ internal static IElement ComputeOwningAnnotatedElement(this IAnnotation annotati /// /// the computed result /// + [DerivedProperty(name: nameof(IAnnotation.owningAnnotatingElement))] internal static IAnnotatingElement ComputeOwningAnnotatingElement(this IAnnotation annotationSubject) { return annotationSubject == null diff --git a/SysML2.NET/Extend/AssertConstraintUsageExtensions.cs b/SysML2.NET/Extend/AssertConstraintUsageExtensions.cs index 19933aa5c..18c1104cc 100644 --- a/SysML2.NET/Extend/AssertConstraintUsageExtensions.cs +++ b/SysML2.NET/Extend/AssertConstraintUsageExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Systems.Constraints using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -83,6 +85,7 @@ internal static class AssertConstraintUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IAssertConstraintUsage.assertedConstraint))] internal static IConstraintUsage ComputeAssertedConstraint(this IAssertConstraintUsage assertConstraintUsageSubject) { if (assertConstraintUsageSubject == null) diff --git a/SysML2.NET/Extend/AssignmentActionUsageExtensions.cs b/SysML2.NET/Extend/AssignmentActionUsageExtensions.cs index b8bd7fa9e..c34c0e5f2 100644 --- a/SysML2.NET/Extend/AssignmentActionUsageExtensions.cs +++ b/SysML2.NET/Extend/AssignmentActionUsageExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Systems.Actions using System; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.POCO.Kernel.Functions; @@ -56,6 +58,7 @@ internal static class AssignmentActionUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IAssignmentActionUsage.referent))] internal static IFeature ComputeReferent(this IAssignmentActionUsage assignmentActionUsageSubject) { if (assignmentActionUsageSubject == null) @@ -84,6 +87,7 @@ internal static IFeature ComputeReferent(this IAssignmentActionUsage assignmentA /// /// the computed result /// + [DerivedProperty(name: nameof(IAssignmentActionUsage.targetArgument))] internal static IExpression ComputeTargetArgument(this IAssignmentActionUsage assignmentActionUsageSubject) { return assignmentActionUsageSubject == null @@ -106,6 +110,7 @@ internal static IExpression ComputeTargetArgument(this IAssignmentActionUsage as /// /// the computed result /// + [DerivedProperty(name: nameof(IAssignmentActionUsage.valueExpression))] internal static IExpression ComputeValueExpression(this IAssignmentActionUsage assignmentActionUsageSubject) { return assignmentActionUsageSubject == null diff --git a/SysML2.NET/Extend/AssociationExtensions.cs b/SysML2.NET/Extend/AssociationExtensions.cs index f67b18c41..515e080ba 100644 --- a/SysML2.NET/Extend/AssociationExtensions.cs +++ b/SysML2.NET/Extend/AssociationExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Associations using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Core.Types; @@ -42,6 +44,7 @@ internal static class AssociationExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IAssociation.associationEnd))] internal static List ComputeAssociationEnd(this IAssociation associationSubject) { return associationSubject == null @@ -64,6 +67,7 @@ internal static List ComputeAssociationEnd(this IAssociation associati /// /// the computed result /// + [DerivedProperty(name: nameof(IAssociation.relatedType))] internal static List ComputeRelatedType(this IAssociation associationSubject) { return associationSubject == null @@ -88,6 +92,7 @@ internal static List ComputeRelatedType(this IAssociation associationSubj /// /// the computed result /// + [DerivedProperty(name: nameof(IAssociation.sourceType))] internal static IType ComputeSourceType(this IAssociation associationSubject) { if (associationSubject == null) @@ -121,6 +126,7 @@ internal static IType ComputeSourceType(this IAssociation associationSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IAssociation.targetType))] internal static List ComputeTargetType(this IAssociation associationSubject) { if (associationSubject == null) diff --git a/SysML2.NET/Extend/AttributeUsageExtensions.cs b/SysML2.NET/Extend/AttributeUsageExtensions.cs index cd9742a22..68d99de7f 100644 --- a/SysML2.NET/Extend/AttributeUsageExtensions.cs +++ b/SysML2.NET/Extend/AttributeUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Attributes using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Classifiers; @@ -78,6 +80,7 @@ internal static class AttributeUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IAttributeUsage.attributeDefinition))] internal static List ComputeAttributeDefinition(this IAttributeUsage attributeUsageSubject) { return attributeUsageSubject == null @@ -94,6 +97,7 @@ internal static List ComputeAttributeDefinition(this IAttributeUsage /// /// the computed result /// + [DerivedProperty(name: nameof(IAttributeUsage.isReference))] internal static bool ComputeIsReference(this IAttributeUsage attributeUsageSubject) { return attributeUsageSubject == null diff --git a/SysML2.NET/Extend/BehaviorExtensions.cs b/SysML2.NET/Extend/BehaviorExtensions.cs index 89fa59689..399e557f9 100644 --- a/SysML2.NET/Extend/BehaviorExtensions.cs +++ b/SysML2.NET/Extend/BehaviorExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Behaviors using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; /// @@ -41,6 +43,7 @@ internal static class BehaviorExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IBehavior.parameter))] internal static List ComputeParameter(this IBehavior behaviorSubject) { return behaviorSubject == null @@ -63,6 +66,7 @@ internal static List ComputeParameter(this IBehavior behaviorSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IBehavior.step))] internal static List ComputeStep(this IBehavior behaviorSubject) { return behaviorSubject == null diff --git a/SysML2.NET/Extend/BooleanExpressionExtensions.cs b/SysML2.NET/Extend/BooleanExpressionExtensions.cs index 4d002a88c..e4cdd2cb8 100644 --- a/SysML2.NET/Extend/BooleanExpressionExtensions.cs +++ b/SysML2.NET/Extend/BooleanExpressionExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Functions using System; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Exceptions; using SysML2.NET.Extensions; @@ -50,6 +52,7 @@ internal static class BooleanExpressionExtensions /// Thrown when more than one on the subject is an /// (upper-bound violation against the derived [0..1] property). /// + [DerivedProperty(name: nameof(IBooleanExpression.predicate))] internal static IPredicate ComputePredicate(this IBooleanExpression booleanExpressionSubject) { return booleanExpressionSubject == null diff --git a/SysML2.NET/Extend/CalculationDefinitionExtensions.cs b/SysML2.NET/Extend/CalculationDefinitionExtensions.cs index 7e30f37d2..7e968d27b 100644 --- a/SysML2.NET/Extend/CalculationDefinitionExtensions.cs +++ b/SysML2.NET/Extend/CalculationDefinitionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Calculations using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Classifiers; @@ -77,6 +79,7 @@ internal static class CalculationDefinitionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(ICalculationDefinition.calculation))] internal static List ComputeCalculation(this ICalculationDefinition calculationDefinitionSubject) { return calculationDefinitionSubject == null diff --git a/SysML2.NET/Extend/CalculationUsageExtensions.cs b/SysML2.NET/Extend/CalculationUsageExtensions.cs index 4b9aa63b5..6d720eaf8 100644 --- a/SysML2.NET/Extend/CalculationUsageExtensions.cs +++ b/SysML2.NET/Extend/CalculationUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Calculations using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -84,6 +86,7 @@ internal static class CalculationUsageExtensions /// Thrown when more than one targets an /// (upper-bound violation against the derived [0..1] property). /// + [DerivedProperty(name: nameof(ICalculationUsage.calculationDefinition))] internal static IFunction ComputeCalculationDefinition(this ICalculationUsage calculationUsageSubject) { return calculationUsageSubject == null @@ -109,6 +112,7 @@ internal static IFunction ComputeCalculationDefinition(this ICalculationUsage ca /// /// The expected /// + [Operation(name: nameof(ICalculationUsage.ModelLevelEvaluable))] internal static bool ComputeRedefinedModelLevelEvaluableOperation(this ICalculationUsage calculationUsageSubject, List visited) { if (calculationUsageSubject == null) diff --git a/SysML2.NET/Extend/CaseDefinitionExtensions.cs b/SysML2.NET/Extend/CaseDefinitionExtensions.cs index e885e273b..90c7404a5 100644 --- a/SysML2.NET/Extend/CaseDefinitionExtensions.cs +++ b/SysML2.NET/Extend/CaseDefinitionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Cases using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Classifiers; @@ -79,6 +81,7 @@ internal static class CaseDefinitionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(ICaseDefinition.actorParameter))] internal static List ComputeActorParameter(this ICaseDefinition caseDefinitionSubject) { return caseDefinitionSubject == null @@ -108,6 +111,7 @@ internal static List ComputeActorParameter(this ICaseDefinition case /// /// the computed result /// + [DerivedProperty(name: nameof(ICaseDefinition.objectiveRequirement))] internal static IRequirementUsage ComputeObjectiveRequirement(this ICaseDefinition caseDefinitionSubject) { if (caseDefinitionSubject == null) @@ -141,6 +145,7 @@ internal static IRequirementUsage ComputeObjectiveRequirement(this ICaseDefiniti /// /// the computed result /// + [DerivedProperty(name: nameof(ICaseDefinition.subjectParameter))] internal static IUsage ComputeSubjectParameter(this ICaseDefinition caseDefinitionSubject) { if (caseDefinitionSubject == null) diff --git a/SysML2.NET/Extend/CaseUsageExtensions.cs b/SysML2.NET/Extend/CaseUsageExtensions.cs index 19c26da5b..c025a19b7 100644 --- a/SysML2.NET/Extend/CaseUsageExtensions.cs +++ b/SysML2.NET/Extend/CaseUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Cases using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -83,6 +85,7 @@ internal static class CaseUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(ICaseUsage.actorParameter))] internal static List ComputeActorParameter(this ICaseUsage caseUsageSubject) { return caseUsageSubject == null @@ -109,6 +112,7 @@ internal static List ComputeActorParameter(this ICaseUsage caseUsage /// (upper-bound violation against the derived /// [0..1] property). /// + [DerivedProperty(name: nameof(ICaseUsage.caseDefinition))] internal static ICaseDefinition ComputeCaseDefinition(this ICaseUsage caseUsageSubject) { return caseUsageSubject == null @@ -138,6 +142,7 @@ internal static ICaseDefinition ComputeCaseDefinition(this ICaseUsage caseUsageS /// /// the computed result /// + [DerivedProperty(name: nameof(ICaseUsage.objectiveRequirement))] internal static IRequirementUsage ComputeObjectiveRequirement(this ICaseUsage caseUsageSubject) { if (caseUsageSubject == null) @@ -171,6 +176,7 @@ internal static IRequirementUsage ComputeObjectiveRequirement(this ICaseUsage ca /// /// the computed result /// + [DerivedProperty(name: nameof(ICaseUsage.subjectParameter))] internal static IUsage ComputeSubjectParameter(this ICaseUsage caseUsageSubject) { if (caseUsageSubject == null) diff --git a/SysML2.NET/Extend/ClassifierExtensions.cs b/SysML2.NET/Extend/ClassifierExtensions.cs index 0ab4c5934..369f6ad90 100644 --- a/SysML2.NET/Extend/ClassifierExtensions.cs +++ b/SysML2.NET/Extend/ClassifierExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Core.Classifiers using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + /// /// The class provides extensions methods for /// the interface @@ -46,6 +48,7 @@ internal static class ClassifierExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IClassifier.ownedSubclassification))] internal static List ComputeOwnedSubclassification(this IClassifier classifierSubject) { return classifierSubject == null diff --git a/SysML2.NET/Extend/ConcernUsageExtensions.cs b/SysML2.NET/Extend/ConcernUsageExtensions.cs index 1cd0cd6be..155b0f990 100644 --- a/SysML2.NET/Extend/ConcernUsageExtensions.cs +++ b/SysML2.NET/Extend/ConcernUsageExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Systems.Requirements using System; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Extensions; @@ -41,6 +43,7 @@ internal static class ConcernUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IConcernUsage.concernDefinition))] internal static IConcernDefinition ComputeConcernDefinition(this IConcernUsage concernUsageSubject) { return concernUsageSubject == null diff --git a/SysML2.NET/Extend/ConjugatedPortDefinitionExtensions.cs b/SysML2.NET/Extend/ConjugatedPortDefinitionExtensions.cs index 1a76832ac..e716781db 100644 --- a/SysML2.NET/Extend/ConjugatedPortDefinitionExtensions.cs +++ b/SysML2.NET/Extend/ConjugatedPortDefinitionExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Systems.Ports { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Exceptions; using SysML2.NET.Extensions; @@ -40,6 +42,7 @@ internal static class ConjugatedPortDefinitionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IConjugatedPortDefinition.originalPortDefinition))] internal static IPortDefinition ComputeOriginalPortDefinition(this IConjugatedPortDefinition conjugatedPortDefinitionSubject) { if (conjugatedPortDefinitionSubject == null) @@ -61,6 +64,7 @@ internal static IPortDefinition ComputeOriginalPortDefinition(this IConjugatedPo /// /// the computed result /// + [DerivedProperty(name: nameof(IConjugatedPortDefinition.ownedPortConjugator))] internal static IPortConjugation ComputeOwnedPortConjugator(this IConjugatedPortDefinition conjugatedPortDefinitionSubject) { if (conjugatedPortDefinitionSubject == null) @@ -91,6 +95,7 @@ internal static IPortConjugation ComputeOwnedPortConjugator(this IConjugatedPort /// /// The expected /// + [Operation(name: nameof(IConjugatedPortDefinition.EffectiveName))] internal static string ComputeRedefinedEffectiveNameOperation(this IConjugatedPortDefinition conjugatedPortDefinitionSubject) { if (conjugatedPortDefinitionSubject == null) diff --git a/SysML2.NET/Extend/ConjugatedPortTypingExtensions.cs b/SysML2.NET/Extend/ConjugatedPortTypingExtensions.cs index af5aff1b7..d2d5ed7e9 100644 --- a/SysML2.NET/Extend/ConjugatedPortTypingExtensions.cs +++ b/SysML2.NET/Extend/ConjugatedPortTypingExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Systems.Ports using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.POCO.Root.Annotations; @@ -50,6 +52,7 @@ internal static class ConjugatedPortTypingExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IConjugatedPortTyping.portDefinition))] internal static IPortDefinition ComputePortDefinition(this IConjugatedPortTyping conjugatedPortTypingSubject) { return conjugatedPortTypingSubject == null diff --git a/SysML2.NET/Extend/ConjugationExtensions.cs b/SysML2.NET/Extend/ConjugationExtensions.cs index cdae72cee..e906b0c3a 100644 --- a/SysML2.NET/Extend/ConjugationExtensions.cs +++ b/SysML2.NET/Extend/ConjugationExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Core.Types using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Elements; using SysML2.NET.Core.POCO.Root.Namespaces; @@ -42,6 +44,7 @@ internal static class ConjugationExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IConjugation.owningType))] internal static IType ComputeOwningType(this IConjugation conjugationSubject) { return conjugationSubject == null diff --git a/SysML2.NET/Extend/ConnectionDefinitionExtensions.cs b/SysML2.NET/Extend/ConnectionDefinitionExtensions.cs index 5a4b17cfd..9a5f64461 100644 --- a/SysML2.NET/Extend/ConnectionDefinitionExtensions.cs +++ b/SysML2.NET/Extend/ConnectionDefinitionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Connections using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Classifiers; @@ -70,6 +72,7 @@ internal static class ConnectionDefinitionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IConnectionDefinition.connectionEnd))] internal static List ComputeConnectionEnd(this IConnectionDefinition connectionDefinitionSubject) { return connectionDefinitionSubject == null diff --git a/SysML2.NET/Extend/ConnectionUsageExtensions.cs b/SysML2.NET/Extend/ConnectionUsageExtensions.cs index 1f59bed0b..74cca8b18 100644 --- a/SysML2.NET/Extend/ConnectionUsageExtensions.cs +++ b/SysML2.NET/Extend/ConnectionUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Connections using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -74,6 +76,7 @@ internal static class ConnectionUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IConnectionUsage.connectionDefinition))] internal static List ComputeConnectionDefinition(this IConnectionUsage connectionUsageSubject) { return connectionUsageSubject == null diff --git a/SysML2.NET/Extend/ConnectorExtensions.cs b/SysML2.NET/Extend/ConnectorExtensions.cs index 9d563278e..e1ab403f1 100644 --- a/SysML2.NET/Extend/ConnectorExtensions.cs +++ b/SysML2.NET/Extend/ConnectorExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Connectors using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.POCO.Kernel.Associations; @@ -43,6 +45,7 @@ internal static class ConnectorExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IConnector.association))] internal static List ComputeAssociation(this IConnector connectorSubject) { return connectorSubject == null @@ -59,6 +62,7 @@ internal static List ComputeAssociation(this IConnector connectorS /// /// the computed result /// + [DerivedProperty(name: nameof(IConnector.connectorEnd))] internal static List ComputeConnectorEnd(this IConnector connectorSubject) { return connectorSubject == null @@ -92,6 +96,7 @@ internal static List ComputeConnectorEnd(this IConnector connectorSubj /// /// the computed result /// + [DerivedProperty(name: nameof(IConnector.defaultFeaturingType))] internal static IType ComputeDefaultFeaturingType(this IConnector connectorSubject) { if (connectorSubject == null) @@ -142,6 +147,7 @@ internal static IType ComputeDefaultFeaturingType(this IConnector connectorSubje /// /// the computed result /// + [DerivedProperty(name: nameof(IConnector.relatedFeature))] internal static List ComputeRelatedFeature(this IConnector connectorSubject) { return connectorSubject == null @@ -170,6 +176,7 @@ internal static List ComputeRelatedFeature(this IConnector connectorSu /// /// the computed result /// + [DerivedProperty(name: nameof(IConnector.sourceFeature))] internal static IFeature ComputeSourceFeature(this IConnector connectorSubject) { if (connectorSubject == null) @@ -203,6 +210,7 @@ internal static IFeature ComputeSourceFeature(this IConnector connectorSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IConnector.targetFeature))] internal static List ComputeTargetFeature(this IConnector connectorSubject) { if (connectorSubject == null) diff --git a/SysML2.NET/Extend/ConstraintUsageExtensions.cs b/SysML2.NET/Extend/ConstraintUsageExtensions.cs index 71f49cc2f..1086599c4 100644 --- a/SysML2.NET/Extend/ConstraintUsageExtensions.cs +++ b/SysML2.NET/Extend/ConstraintUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Constraints using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -84,6 +86,7 @@ internal static class ConstraintUsageExtensions /// Thrown when more than one targets an /// (upper-bound violation against the derived [0..1] property). /// + [DerivedProperty(name: nameof(IConstraintUsage.constraintDefinition))] internal static IPredicate ComputeConstraintDefinition(this IConstraintUsage constraintUsageSubject) { return constraintUsageSubject == null @@ -114,6 +117,7 @@ internal static IPredicate ComputeConstraintDefinition(this IConstraintUsage con /// /// The expected /// + [Operation(name: nameof(IConstraintUsage.NamingFeature))] internal static IFeature ComputeRedefinedNamingFeatureOperation(this IConstraintUsage constraintUsageSubject) { if (constraintUsageSubject == null) @@ -150,6 +154,7 @@ internal static IFeature ComputeRedefinedNamingFeatureOperation(this IConstraint /// /// The expected /// + [Operation(name: nameof(IConstraintUsage.ModelLevelEvaluable))] internal static bool ComputeRedefinedModelLevelEvaluableOperation(this IConstraintUsage constraintUsageSubject, List visited) { if (constraintUsageSubject == null) diff --git a/SysML2.NET/Extend/ConstructorExpressionExtensions.cs b/SysML2.NET/Extend/ConstructorExpressionExtensions.cs index 74ef8a3f5..c09d4fb58 100644 --- a/SysML2.NET/Extend/ConstructorExpressionExtensions.cs +++ b/SysML2.NET/Extend/ConstructorExpressionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Expressions using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; /// @@ -51,6 +53,7 @@ internal static class ConstructorExpressionExtensions /// /// The expected /// + [Operation(name: nameof(IConstructorExpression.ModelLevelEvaluable))] internal static bool ComputeRedefinedModelLevelEvaluableOperation(this IConstructorExpression constructorExpressionSubject, List visited) { if (constructorExpressionSubject == null) diff --git a/SysML2.NET/Extend/ControlNodeExtensions.cs b/SysML2.NET/Extend/ControlNodeExtensions.cs index 82604e14e..9951d7546 100644 --- a/SysML2.NET/Extend/ControlNodeExtensions.cs +++ b/SysML2.NET/Extend/ControlNodeExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Actions using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -97,6 +99,7 @@ internal static class ControlNodeExtensions /// /// The expected /// + [Operation(name: nameof(IControlNode.MultiplicityHasBounds))] internal static bool ComputeMultiplicityHasBoundsOperation(this IControlNode controlNodeSubject, IMultiplicity mult, int lower, string upper) { if (controlNodeSubject == null) diff --git a/SysML2.NET/Extend/CrossSubsettingExtensions.cs b/SysML2.NET/Extend/CrossSubsettingExtensions.cs index 5c101ba30..9dc806df7 100644 --- a/SysML2.NET/Extend/CrossSubsettingExtensions.cs +++ b/SysML2.NET/Extend/CrossSubsettingExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Core.Features using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Elements; @@ -43,6 +45,7 @@ internal static class CrossSubsettingExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(ICrossSubsetting.crossingFeature))] internal static IFeature ComputeCrossingFeature(this ICrossSubsetting crossSubsettingSubject) { return crossSubsettingSubject == null diff --git a/SysML2.NET/Extend/DefinitionExtensions.cs b/SysML2.NET/Extend/DefinitionExtensions.cs index d20a80ab8..efaf49322 100644 --- a/SysML2.NET/Extend/DefinitionExtensions.cs +++ b/SysML2.NET/Extend/DefinitionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.DefinitionAndUsage using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Systems.Actions; using SysML2.NET.Core.POCO.Systems.Allocations; using SysML2.NET.Core.POCO.Systems.AnalysisCases; @@ -67,6 +69,7 @@ internal static class DefinitionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.directedUsage))] internal static List ComputeDirectedUsage(this IDefinition definitionSubject) { return definitionSubject == null @@ -89,6 +92,7 @@ internal static List ComputeDirectedUsage(this IDefinition definitionSub /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedAction))] internal static List ComputeOwnedAction(this IDefinition definitionSubject) { return definitionSubject == null @@ -111,6 +115,7 @@ internal static List ComputeOwnedAction(this IDefinition definitio /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedAllocation))] internal static List ComputeOwnedAllocation(this IDefinition definitionSubject) { return definitionSubject == null @@ -133,6 +138,7 @@ internal static List ComputeOwnedAllocation(this IDefinition d /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedAnalysisCase))] internal static List ComputeOwnedAnalysisCase(this IDefinition definitionSubject) { return definitionSubject == null @@ -155,6 +161,7 @@ internal static List ComputeOwnedAnalysisCase(this IDefiniti /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedAttribute))] internal static List ComputeOwnedAttribute(this IDefinition definitionSubject) { return definitionSubject == null @@ -177,6 +184,7 @@ internal static List ComputeOwnedAttribute(this IDefinition def /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedCalculation))] internal static List ComputeOwnedCalculation(this IDefinition definitionSubject) { return definitionSubject == null @@ -199,6 +207,7 @@ internal static List ComputeOwnedCalculation(this IDefinition /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedCase))] internal static List ComputeOwnedCase(this IDefinition definitionSubject) { return definitionSubject == null @@ -221,6 +230,7 @@ internal static List ComputeOwnedCase(this IDefinition definitionSub /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedConcern))] internal static List ComputeOwnedConcern(this IDefinition definitionSubject) { return definitionSubject == null @@ -243,6 +253,7 @@ internal static List ComputeOwnedConcern(this IDefinition definit /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedConnection))] internal static List ComputeOwnedConnection(this IDefinition definitionSubject) { return definitionSubject == null @@ -265,6 +276,7 @@ internal static List ComputeOwnedConnection(this IDefinition /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedConstraint))] internal static List ComputeOwnedConstraint(this IDefinition definitionSubject) { return definitionSubject == null @@ -287,6 +299,7 @@ internal static List ComputeOwnedConstraint(this IDefinition d /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedEnumeration))] internal static List ComputeOwnedEnumeration(this IDefinition definitionSubject) { return definitionSubject == null @@ -309,6 +322,7 @@ internal static List ComputeOwnedEnumeration(this IDefinition /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedFlow))] internal static List ComputeOwnedFlow(this IDefinition definitionSubject) { return definitionSubject == null @@ -331,6 +345,7 @@ internal static List ComputeOwnedFlow(this IDefinition definitionSub /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedInterface))] internal static List ComputeOwnedInterface(this IDefinition definitionSubject) { return definitionSubject == null @@ -353,6 +368,7 @@ internal static List ComputeOwnedInterface(this IDefinition def /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedItem))] internal static List ComputeOwnedItem(this IDefinition definitionSubject) { return definitionSubject == null @@ -375,6 +391,7 @@ internal static List ComputeOwnedItem(this IDefinition definitionSub /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedMetadata))] internal static List ComputeOwnedMetadata(this IDefinition definitionSubject) { return definitionSubject == null @@ -397,6 +414,7 @@ internal static List ComputeOwnedMetadata(this IDefinition defin /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedOccurrence))] internal static List ComputeOwnedOccurrence(this IDefinition definitionSubject) { return definitionSubject == null @@ -419,6 +437,7 @@ internal static List ComputeOwnedOccurrence(this IDefinition d /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedPart))] internal static List ComputeOwnedPart(this IDefinition definitionSubject) { return definitionSubject == null @@ -441,6 +460,7 @@ internal static List ComputeOwnedPart(this IDefinition definitionSub /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedPort))] internal static List ComputeOwnedPort(this IDefinition definitionSubject) { return definitionSubject == null @@ -463,6 +483,7 @@ internal static List ComputeOwnedPort(this IDefinition definitionSub /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedReference))] internal static List ComputeOwnedReference(this IDefinition definitionSubject) { return definitionSubject == null @@ -485,6 +506,7 @@ internal static List ComputeOwnedReference(this IDefinition def /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedRendering))] internal static List ComputeOwnedRendering(this IDefinition definitionSubject) { return definitionSubject == null @@ -507,6 +529,7 @@ internal static List ComputeOwnedRendering(this IDefinition def /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedRequirement))] internal static List ComputeOwnedRequirement(this IDefinition definitionSubject) { return definitionSubject == null @@ -529,6 +552,7 @@ internal static List ComputeOwnedRequirement(this IDefinition /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedState))] internal static List ComputeOwnedState(this IDefinition definitionSubject) { return definitionSubject == null @@ -551,6 +575,7 @@ internal static List ComputeOwnedState(this IDefinition definitionS /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedTransition))] internal static List ComputeOwnedTransition(this IDefinition definitionSubject) { return definitionSubject == null @@ -573,6 +598,7 @@ internal static List ComputeOwnedTransition(this IDefinition d /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedUsage))] internal static List ComputeOwnedUsage(this IDefinition definitionSubject) { return definitionSubject == null @@ -595,6 +621,7 @@ internal static List ComputeOwnedUsage(this IDefinition definitionSubjec /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedUseCase))] internal static List ComputeOwnedUseCase(this IDefinition definitionSubject) { return definitionSubject == null @@ -617,6 +644,7 @@ internal static List ComputeOwnedUseCase(this IDefinition definit /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedVerificationCase))] internal static List ComputeOwnedVerificationCase(this IDefinition definitionSubject) { return definitionSubject == null @@ -639,6 +667,7 @@ internal static List ComputeOwnedVerificationCase(this I /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedView))] internal static List ComputeOwnedView(this IDefinition definitionSubject) { return definitionSubject == null @@ -661,6 +690,7 @@ internal static List ComputeOwnedView(this IDefinition definitionSub /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.ownedViewpoint))] internal static List ComputeOwnedViewpoint(this IDefinition definitionSubject) { return definitionSubject == null @@ -683,6 +713,7 @@ internal static List ComputeOwnedViewpoint(this IDefinition def /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.usage))] internal static List ComputeUsage(this IDefinition definitionSubject) { return definitionSubject == null @@ -705,6 +736,7 @@ internal static List ComputeUsage(this IDefinition definitionSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.variant))] internal static List ComputeVariant(this IDefinition definitionSubject) { return definitionSubject == null @@ -727,6 +759,7 @@ internal static List ComputeVariant(this IDefinition definitionSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IDefinition.variantMembership))] internal static List ComputeVariantMembership(this IDefinition definitionSubject) { return definitionSubject == null diff --git a/SysML2.NET/Extend/DifferencingExtensions.cs b/SysML2.NET/Extend/DifferencingExtensions.cs index c27820c44..e55cad9fb 100644 --- a/SysML2.NET/Extend/DifferencingExtensions.cs +++ b/SysML2.NET/Extend/DifferencingExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Core.Types using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Elements; using SysML2.NET.Core.POCO.Root.Namespaces; @@ -42,6 +44,7 @@ internal static class DifferencingExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IDifferencing.typeDifferenced))] internal static IType ComputeTypeDifferenced(this IDifferencing differencingSubject) { return differencingSubject == null diff --git a/SysML2.NET/Extend/DisjoiningExtensions.cs b/SysML2.NET/Extend/DisjoiningExtensions.cs index bbd9b2def..da68c9338 100644 --- a/SysML2.NET/Extend/DisjoiningExtensions.cs +++ b/SysML2.NET/Extend/DisjoiningExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Core.Types using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Elements; using SysML2.NET.Core.POCO.Root.Namespaces; @@ -42,6 +44,7 @@ internal static class DisjoiningExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IDisjoining.owningType))] internal static IType ComputeOwningType(this IDisjoining disjoiningSubject) { return disjoiningSubject == null diff --git a/SysML2.NET/Extend/DocumentationExtensions.cs b/SysML2.NET/Extend/DocumentationExtensions.cs index 17ec4a9c2..a5d725847 100644 --- a/SysML2.NET/Extend/DocumentationExtensions.cs +++ b/SysML2.NET/Extend/DocumentationExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Root.Annotations { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Root.Elements; using SysML2.NET.Exceptions; @@ -46,6 +48,7 @@ internal static class DocumentationExtensions /// /// The that is documented by this /// + [DerivedProperty(name: nameof(IDocumentation.documentedElement))] internal static IElement ComputeDocumentedElement(this IDocumentation documentationSubject) { if (documentationSubject == null) diff --git a/SysML2.NET/Extend/ElementExtensions.cs b/SysML2.NET/Extend/ElementExtensions.cs index 3c748c4bc..e951caf7e 100644 --- a/SysML2.NET/Extend/ElementExtensions.cs +++ b/SysML2.NET/Extend/ElementExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Root.Elements using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Namespaces; using SysML2.NET.Extensions; @@ -50,6 +52,7 @@ internal static class ElementExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IElement.documentation))] internal static List ComputeDocumentation(this IElement elementSubject) { return elementSubject == null ? throw new ArgumentNullException(nameof(elementSubject)) : [..elementSubject.ownedElement.OfType()]; @@ -71,6 +74,7 @@ internal static List ComputeDocumentation(this IElement elementS /// /// the computed result /// + [DerivedProperty(name: nameof(IElement.isLibraryElement))] internal static bool ComputeIsLibraryElement(this IElement elementSubject) { return elementSubject == null ? throw new ArgumentNullException(nameof(elementSubject)) : elementSubject.LibraryNamespace() != null; @@ -92,6 +96,7 @@ internal static bool ComputeIsLibraryElement(this IElement elementSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IElement.name))] internal static string ComputeName(this IElement elementSubject) { return elementSubject == null ? throw new ArgumentNullException(nameof(elementSubject)) : elementSubject.EffectiveName(); @@ -115,6 +120,7 @@ internal static string ComputeName(this IElement elementSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IElement.ownedAnnotation))] internal static List ComputeOwnedAnnotation(this IElement elementSubject) { return elementSubject == null ? throw new ArgumentNullException(nameof(elementSubject)) : [..elementSubject.OwnedRelationship.OfType().Where(x => x.AnnotatedElement == elementSubject)]; @@ -136,6 +142,7 @@ internal static List ComputeOwnedAnnotation(this IElement elementSu /// /// the computed result /// + [DerivedProperty(name: nameof(IElement.ownedElement))] internal static List ComputeOwnedElement(this IElement elementSubject) { return elementSubject == null ? throw new ArgumentNullException(nameof(elementSubject)) : [..elementSubject.OwnedRelationship.SelectMany(x => x.OwnedRelatedElement)]; @@ -157,6 +164,7 @@ internal static List ComputeOwnedElement(this IElement elementSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IElement.owner))] internal static IElement ComputeOwner(this IElement elementSubject) { return elementSubject == null ? throw new ArgumentNullException(nameof(elementSubject)) :elementSubject.OwningRelationship?.OwningRelatedElement; @@ -175,6 +183,7 @@ internal static IElement ComputeOwner(this IElement elementSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IElement.owningMembership))] internal static IOwningMembership ComputeOwningMembership(this IElement elementSubject) { return elementSubject == null ? throw new ArgumentNullException(nameof(elementSubject)) : elementSubject.OwningRelationship as IOwningMembership; @@ -199,6 +208,7 @@ internal static IOwningMembership ComputeOwningMembership(this IElement elementS /// /// the computed result /// + [DerivedProperty(name: nameof(IElement.owningNamespace))] internal static INamespace ComputeOwningNamespace(this IElement elementSubject) { return elementSubject == null ? throw new ArgumentNullException(nameof(elementSubject)) : elementSubject.owningMembership?.membershipOwningNamespace; @@ -229,6 +239,7 @@ internal static INamespace ComputeOwningNamespace(this IElement elementSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IElement.qualifiedName))] internal static string ComputeQualifiedName(this IElement elementSubject) { if (elementSubject == null) @@ -283,6 +294,7 @@ internal static string ComputeQualifiedName(this IElement elementSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IElement.shortName))] internal static string ComputeShortName(this IElement elementSubject) { return elementSubject == null ? throw new ArgumentNullException(nameof(elementSubject)) : elementSubject.EffectiveShortName(); @@ -304,6 +316,7 @@ internal static string ComputeShortName(this IElement elementSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IElement.textualRepresentation))] internal static List ComputeTextualRepresentation(this IElement elementSubject) { return elementSubject == null ? throw new ArgumentNullException(nameof(elementSubject)) : [..elementSubject.ownedElement.OfType()]; @@ -350,6 +363,7 @@ internal static bool ValidateIsImpliedIncluded(this IElement elementSubject) /// /// The expected /// + [Operation(name: nameof(IElement.EscapedName))] internal static string ComputeEscapedNameOperation(this IElement elementSubject) { if (elementSubject == null) @@ -389,6 +403,7 @@ internal static string ComputeEscapedNameOperation(this IElement elementSubject) /// /// The expected /// + [Operation(name: nameof(IElement.EffectiveShortName))] internal static string ComputeEffectiveShortNameOperation(this IElement elementSubject) { return elementSubject == null ? throw new ArgumentNullException(nameof(elementSubject)) : elementSubject.DeclaredShortName; @@ -410,6 +425,7 @@ internal static string ComputeEffectiveShortNameOperation(this IElement elementS /// /// The expected /// + [Operation(name: nameof(IElement.EffectiveName))] internal static string ComputeEffectiveNameOperation(this IElement elementSubject) { return elementSubject == null ? throw new ArgumentNullException(nameof(elementSubject)) : elementSubject.DeclaredName; @@ -432,6 +448,7 @@ internal static string ComputeEffectiveNameOperation(this IElement elementSubjec /// /// The expected /// + [Operation(name: nameof(IElement.LibraryNamespace))] internal static INamespace ComputeLibraryNamespaceOperation(this IElement elementSubject) { return elementSubject == null ? throw new ArgumentNullException(nameof(elementSubject)) : elementSubject.OwningRelationship?.LibraryNamespace(); @@ -464,6 +481,7 @@ internal static INamespace ComputeLibraryNamespaceOperation(this IElement elemen /// /// The expected /// + [Operation(name: nameof(IElement.Path))] internal static string ComputePathOperation(this IElement elementSubject) { if (elementSubject == null) diff --git a/SysML2.NET/Extend/ElementFilterMembershipExtensions.cs b/SysML2.NET/Extend/ElementFilterMembershipExtensions.cs index 57236a33a..8f4b7f50c 100644 --- a/SysML2.NET/Extend/ElementFilterMembershipExtensions.cs +++ b/SysML2.NET/Extend/ElementFilterMembershipExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Packages { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Kernel.Functions; using SysML2.NET.Extensions; @@ -40,6 +42,7 @@ internal static class ElementFilterMembershipExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IElementFilterMembership.condition))] internal static IExpression ComputeCondition(this IElementFilterMembership elementFilterMembershipSubject) { if (elementFilterMembershipSubject == null) diff --git a/SysML2.NET/Extend/EndFeatureMembershipExtensions.cs b/SysML2.NET/Extend/EndFeatureMembershipExtensions.cs index ecf539aea..11fa6f73a 100644 --- a/SysML2.NET/Extend/EndFeatureMembershipExtensions.cs +++ b/SysML2.NET/Extend/EndFeatureMembershipExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Core.Features { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Extensions; /// @@ -39,6 +41,7 @@ internal static class EndFeatureMembershipExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IEndFeatureMembership.ownedMemberFeature))] internal static IFeature ComputeOwnedMemberFeature(this IEndFeatureMembership endFeatureMembershipSubject) { if (endFeatureMembershipSubject == null) diff --git a/SysML2.NET/Extend/EnumerationDefinitionExtensions.cs b/SysML2.NET/Extend/EnumerationDefinitionExtensions.cs index c5df96f72..64f743e2a 100644 --- a/SysML2.NET/Extend/EnumerationDefinitionExtensions.cs +++ b/SysML2.NET/Extend/EnumerationDefinitionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Enumerations using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Systems.DefinitionAndUsage; /// @@ -41,6 +43,7 @@ internal static class EnumerationDefinitionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IEnumerationDefinition.enumeratedValue))] internal static List ComputeEnumeratedValue(this IEnumerationDefinition enumerationDefinitionSubject) { return enumerationDefinitionSubject == null diff --git a/SysML2.NET/Extend/EnumerationUsageExtensions.cs b/SysML2.NET/Extend/EnumerationUsageExtensions.cs index 1bc442bc4..3b0dcb74a 100644 --- a/SysML2.NET/Extend/EnumerationUsageExtensions.cs +++ b/SysML2.NET/Extend/EnumerationUsageExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Systems.Enumerations { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Extensions; @@ -40,6 +42,7 @@ internal static class EnumerationUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IEnumerationUsage.enumerationDefinition))] internal static IEnumerationDefinition ComputeEnumerationDefinition(this IEnumerationUsage enumerationUsageSubject) { return enumerationUsageSubject == null diff --git a/SysML2.NET/Extend/EventOccurrenceUsageExtensions.cs b/SysML2.NET/Extend/EventOccurrenceUsageExtensions.cs index 7d81c86eb..4a98f3211 100644 --- a/SysML2.NET/Extend/EventOccurrenceUsageExtensions.cs +++ b/SysML2.NET/Extend/EventOccurrenceUsageExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Systems.Occurrences using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -81,6 +83,7 @@ internal static class EventOccurrenceUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IEventOccurrenceUsage.eventOccurrence))] internal static IOccurrenceUsage ComputeEventOccurrence(this IEventOccurrenceUsage eventOccurrenceUsageSubject) { if (eventOccurrenceUsageSubject == null) @@ -104,6 +107,7 @@ internal static IOccurrenceUsage ComputeEventOccurrence(this IEventOccurrenceUsa /// /// the computed result /// + [DerivedProperty(name: nameof(IEventOccurrenceUsage.isReference))] internal static bool ComputeIsReference(this IEventOccurrenceUsage eventOccurrenceUsageSubject) { // EventOccurrenceUsage::isReference is always true (SysML 2.0 spec, Clause 8.3.9.2). diff --git a/SysML2.NET/Extend/ExhibitStateUsageExtensions.cs b/SysML2.NET/Extend/ExhibitStateUsageExtensions.cs index 5f765e0af..c6137bdbe 100644 --- a/SysML2.NET/Extend/ExhibitStateUsageExtensions.cs +++ b/SysML2.NET/Extend/ExhibitStateUsageExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Systems.States using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -72,6 +74,7 @@ internal static class ExhibitStateUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IExhibitStateUsage.exhibitedState))] internal static IStateUsage ComputeExhibitedState(this IExhibitStateUsage exhibitStateUsageSubject) { if (exhibitStateUsageSubject == null) diff --git a/SysML2.NET/Extend/ExpressionExtensions.cs b/SysML2.NET/Extend/ExpressionExtensions.cs index 6f9eea3c5..45896a30e 100644 --- a/SysML2.NET/Extend/ExpressionExtensions.cs +++ b/SysML2.NET/Extend/ExpressionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Functions using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Core.Types; @@ -55,6 +57,7 @@ internal static class ExpressionExtensions /// Thrown when more than one on the subject is an /// (upper-bound violation against the derived [0..1] property). /// + [DerivedProperty(name: nameof(IExpression.function))] internal static IFunction ComputeFunction(this IExpression expressionSubject) { return expressionSubject == null @@ -77,6 +80,7 @@ internal static IFunction ComputeFunction(this IExpression expressionSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IExpression.isModelLevelEvaluable))] internal static bool ComputeIsModelLevelEvaluable(this IExpression expressionSubject) { return expressionSubject?.ModelLevelEvaluable([]) ?? throw new ArgumentNullException(nameof(expressionSubject)); @@ -104,6 +108,7 @@ internal static bool ComputeIsModelLevelEvaluable(this IExpression expressionSub /// /// the computed result /// + [DerivedProperty(name: nameof(IExpression.result))] internal static IFeature ComputeResult(this IExpression expressionSubject) { if (expressionSubject == null) @@ -149,6 +154,7 @@ internal static IFeature ComputeResult(this IExpression expressionSubject) /// /// The expected /// + [Operation(name: nameof(IExpression.ModelLevelEvaluable))] internal static bool ComputeModelLevelEvaluableOperation(this IExpression expressionSubject, List visited) { if (expressionSubject == null) @@ -217,6 +223,7 @@ ownedFeature.owningFeatureMembership is IResultExpressionMembership /// /// The expected collection of /// + [Operation(name: nameof(IExpression.Evaluate))] internal static List ComputeEvaluateOperation(this IExpression expressionSubject, IElement target) { if (expressionSubject == null) @@ -256,6 +263,7 @@ internal static List ComputeEvaluateOperation(this IExpression express /// /// The expected /// + [Operation(name: nameof(IExpression.CheckCondition))] internal static bool ComputeCheckConditionOperation(this IExpression expressionSubject, IElement target) { if (expressionSubject == null) diff --git a/SysML2.NET/Extend/FeatureChainExpressionExtensions.cs b/SysML2.NET/Extend/FeatureChainExpressionExtensions.cs index 0220d7275..86a72f1cb 100644 --- a/SysML2.NET/Extend/FeatureChainExpressionExtensions.cs +++ b/SysML2.NET/Extend/FeatureChainExpressionExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Expressions using System; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Kernel.Behaviors; @@ -55,6 +57,7 @@ internal static class FeatureChainExpressionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IFeatureChainExpression.targetFeature))] internal static IFeature ComputeTargetFeature(this IFeatureChainExpression featureChainExpressionSubject) { if (featureChainExpressionSubject == null) @@ -90,6 +93,7 @@ internal static IFeature ComputeTargetFeature(this IFeatureChainExpression featu /// /// The expected /// + [Operation(name: nameof(IFeatureChainExpression.SourceTargetFeature))] internal static IFeature ComputeSourceTargetFeatureOperation(this IFeatureChainExpression featureChainExpressionSubject) { if (featureChainExpressionSubject == null) diff --git a/SysML2.NET/Extend/FeatureChainingExtensions.cs b/SysML2.NET/Extend/FeatureChainingExtensions.cs index 6ca2adf20..dfed9c696 100644 --- a/SysML2.NET/Extend/FeatureChainingExtensions.cs +++ b/SysML2.NET/Extend/FeatureChainingExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Core.Features using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Elements; using SysML2.NET.Core.POCO.Root.Namespaces; @@ -42,6 +44,7 @@ internal static class FeatureChainingExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IFeatureChaining.featureChained))] internal static IFeature ComputeFeatureChained(this IFeatureChaining featureChainingSubject) { return featureChainingSubject == null diff --git a/SysML2.NET/Extend/FeatureExtensions.cs b/SysML2.NET/Extend/FeatureExtensions.cs index fe7973137..1148f20f4 100644 --- a/SysML2.NET/Extend/FeatureExtensions.cs +++ b/SysML2.NET/Extend/FeatureExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Core.Features using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.POCO.Kernel.FeatureValues; @@ -52,6 +54,7 @@ internal static class FeatureExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IFeature.chainingFeature))] internal static List ComputeChainingFeature(this IFeature featureSubject) { return featureSubject == null @@ -82,6 +85,7 @@ internal static List ComputeChainingFeature(this IFeature featureSubje /// /// the computed result /// + [DerivedProperty(name: nameof(IFeature.crossFeature))] internal static IFeature ComputeCrossFeature(this IFeature featureSubject) { if (featureSubject == null) @@ -111,6 +115,7 @@ internal static IFeature ComputeCrossFeature(this IFeature featureSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IFeature.endOwningType))] internal static IType ComputeEndOwningType(this IFeature featureSubject) { return featureSubject == null @@ -136,6 +141,7 @@ internal static IType ComputeEndOwningType(this IFeature featureSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IFeature.featureTarget))] internal static IFeature ComputeFeatureTarget(this IFeature featureSubject) { if (featureSubject == null) @@ -175,6 +181,7 @@ internal static IFeature ComputeFeatureTarget(this IFeature featureSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IFeature.featuringType))] internal static List ComputeFeaturingType(this IFeature featureSubject) { if (featureSubject == null) @@ -223,6 +230,7 @@ internal static List ComputeFeaturingType(this IFeature featureSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IFeature.ownedCrossSubsetting))] internal static ICrossSubsetting ComputeOwnedCrossSubsetting(this IFeature featureSubject) { return featureSubject == null @@ -246,6 +254,7 @@ internal static ICrossSubsetting ComputeOwnedCrossSubsetting(this IFeature featu /// /// the computed result /// + [DerivedProperty(name: nameof(IFeature.ownedFeatureChaining))] internal static List ComputeOwnedFeatureChaining(this IFeature featureSubject) { return featureSubject == null @@ -271,6 +280,7 @@ internal static List ComputeOwnedFeatureChaining(this IFeature /// /// the computed result /// + [DerivedProperty(name: nameof(IFeature.ownedFeatureInverting))] internal static List ComputeOwnedFeatureInverting(this IFeature featureSubject) { return featureSubject == null @@ -294,6 +304,7 @@ internal static List ComputeOwnedFeatureInverting(this IFeatu /// /// the computed result /// + [DerivedProperty(name: nameof(IFeature.ownedRedefinition))] internal static List ComputeOwnedRedefinition(this IFeature featureSubject) { return featureSubject == null @@ -322,6 +333,7 @@ internal static List ComputeOwnedRedefinition(this IFeature featu /// /// the computed result /// + [DerivedProperty(name: nameof(IFeature.ownedReferenceSubsetting))] internal static IReferenceSubsetting ComputeOwnedReferenceSubsetting(this IFeature featureSubject) { return featureSubject == null @@ -345,6 +357,7 @@ internal static IReferenceSubsetting ComputeOwnedReferenceSubsetting(this IFeatu /// /// the computed result /// + [DerivedProperty(name: nameof(IFeature.ownedSubsetting))] internal static List ComputeOwnedSubsetting(this IFeature featureSubject) { return featureSubject == null @@ -370,6 +383,7 @@ internal static List ComputeOwnedSubsetting(this IFeature featureSu /// /// the computed result /// + [DerivedProperty(name: nameof(IFeature.ownedTypeFeaturing))] internal static List ComputeOwnedTypeFeaturing(this IFeature featureSubject) { return featureSubject == null @@ -393,6 +407,7 @@ internal static List ComputeOwnedTypeFeaturing(this IFeature fea /// /// the computed result /// + [DerivedProperty(name: nameof(IFeature.ownedTyping))] internal static List ComputeOwnedTyping(this IFeature featureSubject) { return featureSubject == null @@ -414,6 +429,7 @@ internal static List ComputeOwnedTyping(this IFeature featureSub /// /// the computed result /// + [DerivedProperty(name: nameof(IFeature.owningFeatureMembership))] internal static IFeatureMembership ComputeOwningFeatureMembership(this IFeature featureSubject) { return featureSubject == null @@ -435,6 +451,7 @@ internal static IFeatureMembership ComputeOwningFeatureMembership(this IFeature /// /// the computed result /// + [DerivedProperty(name: nameof(IFeature.owningType))] internal static IType ComputeOwningType(this IFeature featureSubject) { return featureSubject == null @@ -463,6 +480,7 @@ internal static IType ComputeOwningType(this IFeature featureSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IFeature.type))] internal static List ComputeType(this IFeature featureSubject) { return featureSubject == null @@ -489,6 +507,7 @@ internal static List ComputeType(this IFeature featureSubject) /// /// The expected /// + [Operation(name: nameof(IFeature.DirectionFor))] internal static FeatureDirectionKind? ComputeDirectionForOperation(this IFeature featureSubject, IType type) { return featureSubject == null @@ -523,6 +542,7 @@ internal static List ComputeType(this IFeature featureSubject) /// /// The expected /// + [Operation(name: nameof(IFeature.EffectiveShortName))] internal static string ComputeRedefinedEffectiveShortNameOperation(this IFeature featureSubject) { if (featureSubject == null) @@ -568,6 +588,7 @@ internal static string ComputeRedefinedEffectiveShortNameOperation(this IFeature /// /// The expected /// + [Operation(name: nameof(IFeature.EffectiveName))] internal static string ComputeRedefinedEffectiveNameOperation(this IFeature featureSubject) { if (featureSubject == null) @@ -606,6 +627,7 @@ internal static string ComputeRedefinedEffectiveNameOperation(this IFeature feat /// /// The expected /// + [Operation(name: nameof(IFeature.NamingFeature))] internal static IFeature ComputeNamingFeatureOperation(this IFeature featureSubject) { return featureSubject == null @@ -635,6 +657,7 @@ internal static IFeature ComputeNamingFeatureOperation(this IFeature featureSubj /// /// The expected collection of /// + [Operation(name: nameof(IFeature.Supertypes))] internal static List ComputeRedefinedSupertypesOperation(this IFeature featureSubject, bool excludeImplied) { if (featureSubject == null) @@ -691,6 +714,7 @@ internal static List ComputeRedefinedSupertypesOperation(this IFeature fe /// /// The expected /// + [Operation(name: nameof(IFeature.Redefines))] internal static bool ComputeRedefinesOperation(this IFeature featureSubject, IFeature redefinedFeature) { if (featureSubject == null) @@ -726,6 +750,7 @@ internal static bool ComputeRedefinesOperation(this IFeature featureSubject, IFe /// /// The expected /// + [Operation(name: nameof(IFeature.RedefinesFromLibrary))] internal static bool ComputeRedefinesFromLibraryOperation(this IFeature featureSubject, string libraryFeatureName) { if (featureSubject == null) @@ -769,6 +794,7 @@ internal static bool ComputeRedefinesFromLibraryOperation(this IFeature featureS /// /// The expected /// + [Operation(name: nameof(IFeature.SubsetsChain))] internal static bool ComputeSubsetsChainOperation(this IFeature featureSubject, IFeature first, IFeature second) { if (featureSubject == null) @@ -862,6 +888,7 @@ internal static bool ComputeSubsetsChainOperation(this IFeature featureSubject, /// /// The expected /// + [Operation(name: nameof(IFeature.IsCompatibleWith))] internal static bool ComputeRedefinedIsCompatibleWithOperation(this IFeature featureSubject, IType otherType) { if (featureSubject == null) @@ -931,6 +958,7 @@ internal static bool ComputeRedefinedIsCompatibleWithOperation(this IFeature fea /// /// The expected collection of /// + [Operation(name: nameof(IFeature.TypingFeatures))] internal static List ComputeTypingFeaturesOperation(this IFeature featureSubject) { if (featureSubject == null) @@ -991,6 +1019,7 @@ internal static List ComputeTypingFeaturesOperation(this IFeature feat /// /// The expected collection of /// + [Operation(name: nameof(IFeature.AsCartesianProduct))] internal static List ComputeAsCartesianProductOperation(this IFeature featureSubject) { if (featureSubject == null) @@ -1029,6 +1058,7 @@ internal static List ComputeAsCartesianProductOperation(this IFeature fea /// /// The expected /// + [Operation(name: nameof(IFeature.IsCartesianProduct))] internal static bool ComputeIsCartesianProductOperation(this IFeature featureSubject) { if (featureSubject == null) @@ -1070,6 +1100,7 @@ internal static bool ComputeIsCartesianProductOperation(this IFeature featureSub /// /// The expected /// + [Operation(name: nameof(IFeature.IsOwnedCrossFeature))] internal static bool ComputeIsOwnedCrossFeatureOperation(this IFeature featureSubject) { if (featureSubject == null) @@ -1111,6 +1142,7 @@ internal static bool ComputeIsOwnedCrossFeatureOperation(this IFeature featureSu /// /// The expected /// + [Operation(name: nameof(IFeature.OwnedCrossFeature))] internal static IFeature ComputeOwnedCrossFeatureOperation(this IFeature featureSubject) { if (featureSubject == null) @@ -1152,6 +1184,7 @@ internal static IFeature ComputeOwnedCrossFeatureOperation(this IFeature feature /// /// The expected collection of /// + [Operation(name: nameof(IFeature.AllRedefinedFeatures))] internal static List ComputeAllRedefinedFeaturesOperation(this IFeature featureSubject) { if (featureSubject == null) @@ -1219,6 +1252,7 @@ internal static List ComputeAllRedefinedFeaturesOperation(this IFeatur /// /// The expected /// + [Operation(name: nameof(IFeature.IsFeaturedWithin))] internal static bool ComputeIsFeaturedWithinOperation(this IFeature featureSubject, IType type) { if (featureSubject == null) @@ -1291,6 +1325,7 @@ internal static bool ComputeIsFeaturedWithinOperation(this IFeature featureSubje /// /// The expected /// + [Operation(name: nameof(IFeature.CanAccess))] internal static bool ComputeCanAccessOperation(this IFeature featureSubject, IFeature feature) { if (featureSubject == null) @@ -1367,6 +1402,7 @@ internal static bool ComputeCanAccessOperation(this IFeature featureSubject, IFe /// /// The expected /// + [Operation(name: nameof(IFeature.IsFeaturingType))] internal static bool ComputeIsFeaturingTypeOperation(this IFeature featureSubject, IType type) { if (featureSubject == null) diff --git a/SysML2.NET/Extend/FeatureInvertingExtensions.cs b/SysML2.NET/Extend/FeatureInvertingExtensions.cs index 4fba099a1..7a758002b 100644 --- a/SysML2.NET/Extend/FeatureInvertingExtensions.cs +++ b/SysML2.NET/Extend/FeatureInvertingExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Core.Features using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Elements; using SysML2.NET.Core.POCO.Root.Namespaces; @@ -42,6 +44,7 @@ internal static class FeatureInvertingExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IFeatureInverting.owningFeature))] internal static IFeature ComputeOwningFeature(this IFeatureInverting featureInvertingSubject) { return featureInvertingSubject == null diff --git a/SysML2.NET/Extend/FeatureMembershipExtensions.cs b/SysML2.NET/Extend/FeatureMembershipExtensions.cs index e247d4f55..9574ec280 100644 --- a/SysML2.NET/Extend/FeatureMembershipExtensions.cs +++ b/SysML2.NET/Extend/FeatureMembershipExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Core.Types using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Root.Annotations; @@ -45,6 +47,7 @@ internal static class FeatureMembershipExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IFeatureMembership.ownedMemberFeature))] internal static IFeature ComputeOwnedMemberFeature(this IFeatureMembership featureMembershipSubject) { if (featureMembershipSubject == null) @@ -64,6 +67,7 @@ internal static IFeature ComputeOwnedMemberFeature(this IFeatureMembership featu /// /// the computed result /// + [DerivedProperty(name: nameof(IFeatureMembership.owningType))] internal static IType ComputeOwningType(this IFeatureMembership featureMembershipSubject) { return featureMembershipSubject == null diff --git a/SysML2.NET/Extend/FeatureReferenceExpressionExtensions.cs b/SysML2.NET/Extend/FeatureReferenceExpressionExtensions.cs index b62b3558c..dbd15132e 100644 --- a/SysML2.NET/Extend/FeatureReferenceExpressionExtensions.cs +++ b/SysML2.NET/Extend/FeatureReferenceExpressionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Expressions using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.POCO.Kernel.Behaviors; @@ -60,6 +62,7 @@ internal static class FeatureReferenceExpressionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IFeatureReferenceExpression.referent))] internal static IFeature ComputeReferent(this IFeatureReferenceExpression featureReferenceExpressionSubject) { if (featureReferenceExpressionSubject == null) @@ -109,6 +112,7 @@ internal static IFeature ComputeReferent(this IFeatureReferenceExpression featur /// /// The expected /// + [Operation(name: nameof(IFeatureReferenceExpression.ModelLevelEvaluable))] internal static bool ComputeRedefinedModelLevelEvaluableOperation(this IFeatureReferenceExpression featureReferenceExpressionSubject, List visited) { if (featureReferenceExpressionSubject == null) @@ -200,6 +204,7 @@ internal static bool ComputeRedefinedModelLevelEvaluableOperation(this IFeatureR /// /// The expected collection of /// + [Operation(name: nameof(IFeatureReferenceExpression.Evaluate))] internal static List ComputeRedefinedEvaluateOperation(this IFeatureReferenceExpression featureReferenceExpressionSubject, IElement target) { if (featureReferenceExpressionSubject == null) diff --git a/SysML2.NET/Extend/FeatureTypingExtensions.cs b/SysML2.NET/Extend/FeatureTypingExtensions.cs index 47af06c1e..dc64dc4bb 100644 --- a/SysML2.NET/Extend/FeatureTypingExtensions.cs +++ b/SysML2.NET/Extend/FeatureTypingExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Core.Features using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Elements; @@ -43,6 +45,7 @@ internal static class FeatureTypingExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IFeatureTyping.owningFeature))] internal static IFeature ComputeOwningFeature(this IFeatureTyping featureTypingSubject) { return featureTypingSubject == null diff --git a/SysML2.NET/Extend/FeatureValueExtensions.cs b/SysML2.NET/Extend/FeatureValueExtensions.cs index 5e7a0647a..5436936f8 100644 --- a/SysML2.NET/Extend/FeatureValueExtensions.cs +++ b/SysML2.NET/Extend/FeatureValueExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Kernel.FeatureValues using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Kernel.Functions; @@ -46,6 +48,7 @@ internal static class FeatureValueExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IFeatureValue.featureWithValue))] internal static IFeature ComputeFeatureWithValue(this IFeatureValue featureValueSubject) { return featureValueSubject == null @@ -62,6 +65,7 @@ internal static IFeature ComputeFeatureWithValue(this IFeatureValue featureValue /// /// the computed result /// + [DerivedProperty(name: nameof(IFeatureValue.value))] internal static IExpression ComputeValue(this IFeatureValue featureValueSubject) { if (featureValueSubject == null) diff --git a/SysML2.NET/Extend/FlowDefinitionExtensions.cs b/SysML2.NET/Extend/FlowDefinitionExtensions.cs index 270579a3d..5c155195b 100644 --- a/SysML2.NET/Extend/FlowDefinitionExtensions.cs +++ b/SysML2.NET/Extend/FlowDefinitionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Flows using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.POCO.Systems.DefinitionAndUsage; @@ -42,6 +44,7 @@ internal static class FlowDefinitionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IFlowDefinition.flowEnd))] internal static List ComputeFlowEnd(this IFlowDefinition flowDefinitionSubject) { return flowDefinitionSubject == null diff --git a/SysML2.NET/Extend/FlowExtensions.cs b/SysML2.NET/Extend/FlowExtensions.cs index 8c098695b..be9b225f2 100644 --- a/SysML2.NET/Extend/FlowExtensions.cs +++ b/SysML2.NET/Extend/FlowExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Interactions using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Classifiers; using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Core.Types; @@ -52,6 +54,7 @@ internal static class FlowExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IFlow.flowEnd))] internal static List ComputeFlowEnd(this IFlow flowSubject) { return flowSubject == null @@ -68,6 +71,7 @@ internal static List ComputeFlowEnd(this IFlow flowSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IFlow.interaction))] internal static List ComputeInteraction(this IFlow flowSubject) { return flowSubject == null @@ -95,6 +99,7 @@ internal static List ComputeInteraction(this IFlow flowSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IFlow.payloadFeature))] internal static IPayloadFeature ComputePayloadFeature(this IFlow flowSubject) { if (flowSubject == null) @@ -125,6 +130,7 @@ internal static IPayloadFeature ComputePayloadFeature(this IFlow flowSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IFlow.payloadType))] internal static List ComputePayloadType(this IFlow flowSubject) { if (flowSubject == null) @@ -159,6 +165,7 @@ internal static List ComputePayloadType(this IFlow flowSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IFlow.sourceOutputFeature))] internal static IFeature ComputeSourceOutputFeature(this IFlow flowSubject) { if (flowSubject == null) @@ -198,6 +205,7 @@ internal static IFeature ComputeSourceOutputFeature(this IFlow flowSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IFlow.targetInputFeature))] internal static IFeature ComputeTargetInputFeature(this IFlow flowSubject) { if (flowSubject == null) diff --git a/SysML2.NET/Extend/FlowUsageExtensions.cs b/SysML2.NET/Extend/FlowUsageExtensions.cs index 0073942f9..bde61703e 100644 --- a/SysML2.NET/Extend/FlowUsageExtensions.cs +++ b/SysML2.NET/Extend/FlowUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Flows using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Kernel.Interactions; @@ -42,6 +44,7 @@ internal static class FlowUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IFlowUsage.flowDefinition))] internal static List ComputeFlowDefinition(this IFlowUsage flowUsageSubject) { return flowUsageSubject == null diff --git a/SysML2.NET/Extend/ForLoopActionUsageExtensions.cs b/SysML2.NET/Extend/ForLoopActionUsageExtensions.cs index 47e6939b3..bab75be97 100644 --- a/SysML2.NET/Extend/ForLoopActionUsageExtensions.cs +++ b/SysML2.NET/Extend/ForLoopActionUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Actions using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -85,6 +87,7 @@ internal static class ForLoopActionUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IForLoopActionUsage.loopVariable))] internal static IReferenceUsage ComputeLoopVariable(this IForLoopActionUsage forLoopActionUsageSubject) { if (forLoopActionUsageSubject == null) @@ -110,6 +113,7 @@ internal static IReferenceUsage ComputeLoopVariable(this IForLoopActionUsage for /// /// the computed result /// + [DerivedProperty(name: nameof(IForLoopActionUsage.seqArgument))] internal static IExpression ComputeSeqArgument(this IForLoopActionUsage forLoopActionUsageSubject) { return forLoopActionUsageSubject == null diff --git a/SysML2.NET/Extend/FramedConcernMembershipExtensions.cs b/SysML2.NET/Extend/FramedConcernMembershipExtensions.cs index 555038886..fc3e5c592 100644 --- a/SysML2.NET/Extend/FramedConcernMembershipExtensions.cs +++ b/SysML2.NET/Extend/FramedConcernMembershipExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Systems.Requirements using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Requirements; using SysML2.NET.Core.POCO.Core.Features; @@ -48,6 +50,7 @@ internal static class FramedConcernMembershipExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IFramedConcernMembership.ownedConcern))] internal static IConcernUsage ComputeOwnedConcern(this IFramedConcernMembership framedConcernMembershipSubject) { if (framedConcernMembershipSubject == null) @@ -67,6 +70,7 @@ internal static IConcernUsage ComputeOwnedConcern(this IFramedConcernMembership /// /// the computed result /// + [DerivedProperty(name: nameof(IFramedConcernMembership.referencedConcern))] internal static IConcernUsage ComputeReferencedConcern(this IFramedConcernMembership framedConcernMembershipSubject) { if (framedConcernMembershipSubject == null) diff --git a/SysML2.NET/Extend/FunctionExtensions.cs b/SysML2.NET/Extend/FunctionExtensions.cs index f2bc0e65f..1eed59035 100644 --- a/SysML2.NET/Extend/FunctionExtensions.cs +++ b/SysML2.NET/Extend/FunctionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Functions using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Classifiers; @@ -51,6 +53,7 @@ internal static class FunctionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IFunction.expression))] internal static List ComputeExpression(this IFunction functionSubject) { return functionSubject == null @@ -75,6 +78,7 @@ internal static List ComputeExpression(this IFunction functionSubje /// /// Thrown when is null. /// + [DerivedProperty(name: nameof(IFunction.isModelLevelEvaluable))] internal static bool ComputeIsModelLevelEvaluable(this IFunction functionSubject) { return functionSubject == null @@ -104,6 +108,7 @@ internal static bool ComputeIsModelLevelEvaluable(this IFunction functionSubject /// /// the computed result /// + [DerivedProperty(name: nameof(IFunction.result))] internal static IFeature ComputeResult(this IFunction functionSubject) { if (functionSubject == null) diff --git a/SysML2.NET/Extend/IfActionUsageExtensions.cs b/SysML2.NET/Extend/IfActionUsageExtensions.cs index 01c4f73aa..2acda6d29 100644 --- a/SysML2.NET/Extend/IfActionUsageExtensions.cs +++ b/SysML2.NET/Extend/IfActionUsageExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Systems.Actions { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Kernel.Functions; /// @@ -51,6 +53,7 @@ internal static class IfActionUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IIfActionUsage.elseAction))] internal static IActionUsage ComputeElseAction(this IIfActionUsage ifActionUsageSubject) { return ifActionUsageSubject == null @@ -79,6 +82,7 @@ internal static IActionUsage ComputeElseAction(this IIfActionUsage ifActionUsage /// /// the computed result /// + [DerivedProperty(name: nameof(IIfActionUsage.ifArgument))] internal static IExpression ComputeIfArgument(this IIfActionUsage ifActionUsageSubject) { return ifActionUsageSubject == null @@ -107,6 +111,7 @@ internal static IExpression ComputeIfArgument(this IIfActionUsage ifActionUsageS /// /// the computed result /// + [DerivedProperty(name: nameof(IIfActionUsage.thenAction))] internal static IActionUsage ComputeThenAction(this IIfActionUsage ifActionUsageSubject) { return ifActionUsageSubject == null diff --git a/SysML2.NET/Extend/ImportExtensions.cs b/SysML2.NET/Extend/ImportExtensions.cs index 40a3de45d..aa8c29ac4 100644 --- a/SysML2.NET/Extend/ImportExtensions.cs +++ b/SysML2.NET/Extend/ImportExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Root.Namespaces using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Elements; @@ -50,6 +52,7 @@ internal static class ImportExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IImport.importedElement))] internal static IElement ComputeImportedElement(this IImport importSubject) { if (importSubject == null) @@ -74,6 +77,7 @@ internal static IElement ComputeImportedElement(this IImport importSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IImport.importOwningNamespace))] internal static INamespace ComputeImportOwningNamespace(this IImport importSubject) { return importSubject == null ? throw new ArgumentNullException(nameof(importSubject)) : importSubject.OwningRelatedElement as INamespace; @@ -102,6 +106,7 @@ internal static INamespace ComputeImportOwningNamespace(this IImport importSubje /// guards any future direct call. /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IImport.ImportedMemberships))] internal static List ComputeImportedMembershipsOperation(this IImport importSubject, List excluded) { throw new NotSupportedException( diff --git a/SysML2.NET/Extend/IncludeUseCaseUsageExtensions.cs b/SysML2.NET/Extend/IncludeUseCaseUsageExtensions.cs index 96b0843d8..e938e00e1 100644 --- a/SysML2.NET/Extend/IncludeUseCaseUsageExtensions.cs +++ b/SysML2.NET/Extend/IncludeUseCaseUsageExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Systems.UseCases using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -72,6 +74,7 @@ internal static class IncludeUseCaseUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IIncludeUseCaseUsage.useCaseIncluded))] internal static IUseCaseUsage ComputeUseCaseIncluded(this IIncludeUseCaseUsage includeUseCaseUsageSubject) { if (includeUseCaseUsageSubject == null) diff --git a/SysML2.NET/Extend/InstantiationExpressionExtensions.cs b/SysML2.NET/Extend/InstantiationExpressionExtensions.cs index 29f0a043a..12ef19c53 100644 --- a/SysML2.NET/Extend/InstantiationExpressionExtensions.cs +++ b/SysML2.NET/Extend/InstantiationExpressionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Expressions using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.POCO.Kernel.FeatureValues; @@ -44,6 +46,7 @@ internal static class InstantiationExpressionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IInstantiationExpression.argument))] internal static List ComputeArgument(this IInstantiationExpression instantiationExpressionSubject) { if (instantiationExpressionSubject == null) @@ -89,6 +92,7 @@ static IExpression ValueOf(IFeature feature) /// /// the computed result /// + [DerivedProperty(name: nameof(IInstantiationExpression.instantiatedType))] internal static IType ComputeInstantiatedType(this IInstantiationExpression instantiationExpressionSubject) { if (instantiationExpressionSubject == null) @@ -121,6 +125,7 @@ internal static IType ComputeInstantiatedType(this IInstantiationExpression inst /// /// The expected /// + [Operation(name: nameof(IInstantiationExpression.InstantiatedType))] internal static IType ComputeInstantiatedTypeOperation(this IInstantiationExpression instantiationExpressionSubject) { if (instantiationExpressionSubject == null) diff --git a/SysML2.NET/Extend/InterfaceDefinitionExtensions.cs b/SysML2.NET/Extend/InterfaceDefinitionExtensions.cs index a86734660..b1c73e298 100644 --- a/SysML2.NET/Extend/InterfaceDefinitionExtensions.cs +++ b/SysML2.NET/Extend/InterfaceDefinitionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Interfaces using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Systems.Ports; /// @@ -41,6 +43,7 @@ internal static class InterfaceDefinitionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IInterfaceDefinition.interfaceEnd))] internal static List ComputeInterfaceEnd(this IInterfaceDefinition interfaceDefinitionSubject) { return interfaceDefinitionSubject == null diff --git a/SysML2.NET/Extend/InterfaceUsageExtensions.cs b/SysML2.NET/Extend/InterfaceUsageExtensions.cs index cf0c872e9..86690f198 100644 --- a/SysML2.NET/Extend/InterfaceUsageExtensions.cs +++ b/SysML2.NET/Extend/InterfaceUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Interfaces using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; /// @@ -41,6 +43,7 @@ internal static class InterfaceUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IInterfaceUsage.interfaceDefinition))] internal static List ComputeInterfaceDefinition(this IInterfaceUsage interfaceUsageSubject) { return interfaceUsageSubject == null diff --git a/SysML2.NET/Extend/IntersectingExtensions.cs b/SysML2.NET/Extend/IntersectingExtensions.cs index c0c762b89..2d0a2c35d 100644 --- a/SysML2.NET/Extend/IntersectingExtensions.cs +++ b/SysML2.NET/Extend/IntersectingExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Core.Types { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Exceptions; /// @@ -39,6 +41,7 @@ internal static class IntersectingExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IIntersecting.typeIntersected))] internal static IType ComputeTypeIntersected(this IIntersecting intersectingSubject) { if (intersectingSubject == null) diff --git a/SysML2.NET/Extend/InvocationExpressionExtensions.cs b/SysML2.NET/Extend/InvocationExpressionExtensions.cs index ebcdd8e38..dfbd2698b 100644 --- a/SysML2.NET/Extend/InvocationExpressionExtensions.cs +++ b/SysML2.NET/Extend/InvocationExpressionExtensions.cs @@ -25,6 +25,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Expressions using System.Diagnostics.CodeAnalysis; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Root.Elements; @@ -54,6 +56,7 @@ internal static class InvocationExpressionExtensions /// /// The expected /// + [Operation(name: nameof(IInvocationExpression.ModelLevelEvaluable))] internal static bool ComputeRedefinedModelLevelEvaluableOperation(this IInvocationExpression invocationExpressionSubject, List visited) { if (invocationExpressionSubject == null) @@ -80,6 +83,7 @@ internal static bool ComputeRedefinedModelLevelEvaluableOperation(this IInvocati /// The expected collection of /// [ExcludeFromCodeCoverage] + [Operation(name: nameof(IInvocationExpression.Evaluate))] internal static List ComputeRedefinedEvaluateOperation(this IInvocationExpression invocationExpressionSubject, IElement target) { throw new NotSupportedException("Create a GitHub issue when this method is required"); diff --git a/SysML2.NET/Extend/ItemUsageExtensions.cs b/SysML2.NET/Extend/ItemUsageExtensions.cs index d4760537d..a0c09d033 100644 --- a/SysML2.NET/Extend/ItemUsageExtensions.cs +++ b/SysML2.NET/Extend/ItemUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Items using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Kernel.Structures; @@ -48,6 +50,7 @@ internal static class ItemUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IItemUsage.itemDefinition))] internal static List ComputeItemDefinition(this IItemUsage itemUsageSubject) { return itemUsageSubject == null diff --git a/SysML2.NET/Extend/LibraryPackageExtensions.cs b/SysML2.NET/Extend/LibraryPackageExtensions.cs index e3c39e597..e96bedfc7 100644 --- a/SysML2.NET/Extend/LibraryPackageExtensions.cs +++ b/SysML2.NET/Extend/LibraryPackageExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Packages using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Kernel.Functions; using SysML2.NET.Core.POCO.Root.Annotations; @@ -50,6 +52,7 @@ internal static class LibraryPackageExtensions /// /// The expected /// + [Operation(name: nameof(ILibraryPackage.LibraryNamespace))] internal static INamespace ComputeRedefinedLibraryNamespaceOperation(this ILibraryPackage libraryPackageSubject) { if (libraryPackageSubject == null) diff --git a/SysML2.NET/Extend/LiteralExpressionExtensions.cs b/SysML2.NET/Extend/LiteralExpressionExtensions.cs index efdfcf493..55b577aaa 100644 --- a/SysML2.NET/Extend/LiteralExpressionExtensions.cs +++ b/SysML2.NET/Extend/LiteralExpressionExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Expressions using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Root.Elements; @@ -50,6 +52,7 @@ internal static class LiteralExpressionExtensions /// /// The expected /// + [Operation(name: nameof(ILiteralExpression.ModelLevelEvaluable))] internal static bool ComputeRedefinedModelLevelEvaluableOperation(this ILiteralExpression literalExpressionSubject, List visited) { if (literalExpressionSubject == null) @@ -78,6 +81,7 @@ internal static bool ComputeRedefinedModelLevelEvaluableOperation(this ILiteralE /// /// The expected collection of /// + [Operation(name: nameof(ILiteralExpression.Evaluate))] internal static List ComputeRedefinedEvaluateOperation(this ILiteralExpression literalExpressionSubject, IElement target) { if (literalExpressionSubject == null) diff --git a/SysML2.NET/Extend/LoopActionUsageExtensions.cs b/SysML2.NET/Extend/LoopActionUsageExtensions.cs index e055e378f..6d6d79fb5 100644 --- a/SysML2.NET/Extend/LoopActionUsageExtensions.cs +++ b/SysML2.NET/Extend/LoopActionUsageExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Systems.Actions using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -84,6 +86,7 @@ internal static class LoopActionUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(ILoopActionUsage.bodyAction))] internal static IActionUsage ComputeBodyAction(this ILoopActionUsage loopActionUsageSubject) { if (loopActionUsageSubject == null) diff --git a/SysML2.NET/Extend/MembershipExtensions.cs b/SysML2.NET/Extend/MembershipExtensions.cs index 1f09a55a5..41a2f2921 100644 --- a/SysML2.NET/Extend/MembershipExtensions.cs +++ b/SysML2.NET/Extend/MembershipExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Root.Namespaces using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Elements; @@ -42,6 +44,7 @@ internal static class MembershipExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IMembership.memberElementId))] internal static string ComputeMemberElementId(this IMembership membershipSubject) { return membershipSubject == null @@ -58,6 +61,7 @@ internal static string ComputeMemberElementId(this IMembership membershipSubject /// /// the computed result /// + [DerivedProperty(name: nameof(IMembership.membershipOwningNamespace))] internal static INamespace ComputeMembershipOwningNamespace(this IMembership membershipSubject) { return membershipSubject == null ? throw new ArgumentNullException(nameof(membershipSubject)) : membershipSubject.OwningRelatedElement as INamespace; @@ -79,6 +83,7 @@ internal static INamespace ComputeMembershipOwningNamespace(this IMembership mem /// /// The expected /// + [Operation(name: nameof(IMembership.IsDistinguishableFrom))] internal static bool ComputeIsDistinguishableFromOperation(this IMembership membershipSubject, IMembership other) { if (membershipSubject == null) diff --git a/SysML2.NET/Extend/MembershipImportExtensions.cs b/SysML2.NET/Extend/MembershipImportExtensions.cs index 151a19d2e..0dc84f334 100644 --- a/SysML2.NET/Extend/MembershipImportExtensions.cs +++ b/SysML2.NET/Extend/MembershipImportExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Root.Namespaces using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Elements; @@ -60,6 +62,7 @@ internal static class MembershipImportExtensions /// /// The expected collection of /// + [Operation(name: nameof(IMembershipImport.ImportedMemberships))] internal static List ComputeRedefinedImportedMembershipsOperation(this IMembershipImport membershipImportSubject, List excluded) { if (membershipImportSubject == null) diff --git a/SysML2.NET/Extend/MetadataAccessExpressionExtensions.cs b/SysML2.NET/Extend/MetadataAccessExpressionExtensions.cs index c6a77d930..8cd01ae4d 100644 --- a/SysML2.NET/Extend/MetadataAccessExpressionExtensions.cs +++ b/SysML2.NET/Extend/MetadataAccessExpressionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Expressions using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.POCO.Kernel.Metadata; @@ -47,6 +49,7 @@ internal static class MetadataAccessExpressionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IMetadataAccessExpression.referencedElement))] internal static IElement ComputeReferencedElement(this IMetadataAccessExpression metadataAccessExpressionSubject) { if (metadataAccessExpressionSubject == null) @@ -86,6 +89,7 @@ internal static IElement ComputeReferencedElement(this IMetadataAccessExpression /// /// The expected /// + [Operation(name: nameof(IMetadataAccessExpression.ModelLevelEvaluable))] internal static bool ComputeRedefinedModelLevelEvaluableOperation(this IMetadataAccessExpression metadataAccessExpressionSubject, List visited) { if (metadataAccessExpressionSubject == null) @@ -121,6 +125,7 @@ internal static bool ComputeRedefinedModelLevelEvaluableOperation(this IMetadata /// /// The expected collection of /// + [Operation(name: nameof(IMetadataAccessExpression.Evaluate))] internal static List ComputeRedefinedEvaluateOperation(this IMetadataAccessExpression metadataAccessExpressionSubject, IElement target) { if (metadataAccessExpressionSubject == null) @@ -158,6 +163,7 @@ internal static List ComputeRedefinedEvaluateOperation(this IMetadataA /// The expected /// [ExcludeFromCodeCoverage] + [Operation(name: nameof(IMetadataAccessExpression.MetaclassFeature))] internal static IMetadataFeature ComputeMetaclassFeatureOperation(this IMetadataAccessExpression metadataAccessExpressionSubject) { throw new NotSupportedException("Create a GitHub issue when this method is required"); diff --git a/SysML2.NET/Extend/MetadataFeatureExtensions.cs b/SysML2.NET/Extend/MetadataFeatureExtensions.cs index 87cc35d64..a280e02eb 100644 --- a/SysML2.NET/Extend/MetadataFeatureExtensions.cs +++ b/SysML2.NET/Extend/MetadataFeatureExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Metadata using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Kernel.FeatureValues; using SysML2.NET.Core.POCO.Root.Elements; @@ -53,6 +55,7 @@ internal static class MetadataFeatureExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IMetadataFeature.metaclass))] internal static IMetaclass ComputeMetaclass(this IMetadataFeature metadataFeatureSubject) { if (metadataFeatureSubject == null) @@ -97,6 +100,7 @@ internal static IMetaclass ComputeMetaclass(this IMetadataFeature metadataFeatur /// /// The expected collection of /// + [Operation(name: nameof(IMetadataFeature.EvaluateFeature))] internal static List ComputeEvaluateFeatureOperation(this IMetadataFeature metadataFeatureSubject, IFeature baseFeature) { if (metadataFeatureSubject == null) @@ -150,6 +154,7 @@ internal static List ComputeEvaluateFeatureOperation(this IMetadataFea /// /// The expected /// + [Operation(name: nameof(IMetadataFeature.IsSemantic))] internal static bool ComputeIsSemanticOperation(this IMetadataFeature metadataFeatureSubject) { return metadataFeatureSubject == null @@ -173,6 +178,7 @@ internal static bool ComputeIsSemanticOperation(this IMetadataFeature metadataFe /// /// The expected /// + [Operation(name: nameof(IMetadataFeature.IsSyntactic))] internal static bool ComputeIsSyntacticOperation(this IMetadataFeature metadataFeatureSubject) { return metadataFeatureSubject == null @@ -201,6 +207,7 @@ internal static bool ComputeIsSyntacticOperation(this IMetadataFeature metadataF /// The expected /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [Operation(name: nameof(IMetadataFeature.SyntaxElement))] internal static IElement ComputeSyntaxElementOperation(this IMetadataFeature metadataFeatureSubject) { // Implementation deferred: requires a MOF reflective metaclass registry diff --git a/SysML2.NET/Extend/MetadataUsageExtensions.cs b/SysML2.NET/Extend/MetadataUsageExtensions.cs index 219d5548c..d822e2e74 100644 --- a/SysML2.NET/Extend/MetadataUsageExtensions.cs +++ b/SysML2.NET/Extend/MetadataUsageExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Systems.Metadata { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Kernel.Metadata; using SysML2.NET.Extensions; @@ -41,6 +43,7 @@ internal static class MetadataUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IMetadataUsage.metadataDefinition))] internal static IMetaclass ComputeMetadataDefinition(this IMetadataUsage metadataUsageSubject) { return metadataUsageSubject == null diff --git a/SysML2.NET/Extend/MultiplicityRangeExtensions.cs b/SysML2.NET/Extend/MultiplicityRangeExtensions.cs index 9a43a1367..976dd6d3f 100644 --- a/SysML2.NET/Extend/MultiplicityRangeExtensions.cs +++ b/SysML2.NET/Extend/MultiplicityRangeExtensions.cs @@ -25,6 +25,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Multiplicities using System.Globalization; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Kernel.Expressions; using SysML2.NET.Core.POCO.Kernel.Functions; @@ -53,6 +55,7 @@ internal static class MultiplicityRangeExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IMultiplicityRange.bound))] internal static List ComputeBound(this IMultiplicityRange multiplicityRangeSubject) { if (multiplicityRangeSubject is null) @@ -92,6 +95,7 @@ internal static List ComputeBound(this IMultiplicityRange multiplic /// /// the computed result /// + [DerivedProperty(name: nameof(IMultiplicityRange.lowerBound))] internal static IExpression ComputeLowerBound(this IMultiplicityRange multiplicityRangeSubject) { if (multiplicityRangeSubject is null) @@ -127,6 +131,7 @@ internal static IExpression ComputeLowerBound(this IMultiplicityRange multiplici /// /// the computed result /// + [DerivedProperty(name: nameof(IMultiplicityRange.upperBound))] internal static IExpression ComputeUpperBound(this IMultiplicityRange multiplicityRangeSubject) { if (multiplicityRangeSubject is null) @@ -173,6 +178,7 @@ internal static IExpression ComputeUpperBound(this IMultiplicityRange multiplici /// /// The expected /// + [Operation(name: nameof(IMultiplicityRange.HasBounds))] internal static bool ComputeHasBoundsOperation(this IMultiplicityRange multiplicityRangeSubject, int lower, string upper) { if (multiplicityRangeSubject is null) @@ -237,6 +243,7 @@ internal static bool ComputeHasBoundsOperation(this IMultiplicityRange multiplic /// /// The expected /// + [Operation(name: nameof(IMultiplicityRange.ValueOf))] internal static string ComputeValueOfOperation(this IMultiplicityRange multiplicityRangeSubject, IExpression bound) { if (multiplicityRangeSubject is null) diff --git a/SysML2.NET/Extend/NamespaceExtensions.cs b/SysML2.NET/Extend/NamespaceExtensions.cs index b22f67851..f13121ed3 100644 --- a/SysML2.NET/Extend/NamespaceExtensions.cs +++ b/SysML2.NET/Extend/NamespaceExtensions.cs @@ -25,6 +25,8 @@ namespace SysML2.NET.Core.POCO.Root.Namespaces using System.Linq; using System.Text; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.POCO.Root.Annotations; @@ -52,6 +54,7 @@ internal static class NamespaceExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(INamespace.importedMembership))] internal static List ComputeImportedMembership(this INamespace namespaceSubject) { return namespaceSubject == null ? throw new ArgumentNullException(nameof(namespaceSubject)) : namespaceSubject.ImportedMemberships([]); @@ -72,6 +75,7 @@ internal static List ComputeImportedMembership(this INamespace name /// /// the computed result /// + [DerivedProperty(name: nameof(INamespace.member))] internal static List ComputeMember(this INamespace namespaceSubject) { return namespaceSubject == null ? throw new ArgumentNullException(nameof(namespaceSubject)) : [..namespaceSubject.membership.Select(x => x.MemberElement)]; @@ -86,6 +90,7 @@ internal static List ComputeMember(this INamespace namespaceSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(INamespace.membership))] internal static List ComputeMembership(this INamespace namespaceSubject) { if (namespaceSubject == null) @@ -119,6 +124,7 @@ internal static List ComputeMembership(this INamespace namespaceSub /// /// the computed result /// + [DerivedProperty(name: nameof(INamespace.ownedImport))] internal static List ComputeOwnedImport(this INamespace namespaceSubject) { return namespaceSubject == null ? throw new ArgumentNullException(nameof(namespaceSubject)) : [..namespaceSubject.OwnedRelationship.OfType()]; @@ -139,6 +145,7 @@ internal static List ComputeOwnedImport(this INamespace namespaceSubjec /// /// the computed result /// + [DerivedProperty(name: nameof(INamespace.ownedMember))] internal static List ComputeOwnedMember(this INamespace namespaceSubject) { return namespaceSubject == null ? throw new ArgumentNullException(nameof(namespaceSubject)) : [..namespaceSubject.ownedMembership.OfType().Select(x => x.ownedMemberElement)]; @@ -159,6 +166,7 @@ internal static List ComputeOwnedMember(this INamespace namespaceSubje /// /// the computed result /// + [DerivedProperty(name: nameof(INamespace.ownedMembership))] internal static List ComputeOwnedMembership(this INamespace namespaceSubject) { return namespaceSubject == null ? throw new ArgumentNullException(nameof(namespaceSubject)) : [..namespaceSubject.OwnedRelationship.OfType()]; @@ -183,6 +191,7 @@ internal static List ComputeOwnedMembership(this INamespace namespa /// /// The expected collection of /// + [Operation(name: nameof(INamespace.NamesOf))] internal static List ComputeNamesOfOperation(this INamespace namespaceSubject, IElement element) { if (namespaceSubject == null) @@ -239,6 +248,7 @@ internal static List ComputeNamesOfOperation(this INamespace namespaceSu /// /// The expected /// + [Operation(name: nameof(INamespace.VisibilityOf))] internal static VisibilityKind ComputeVisibilityOfOperation(this INamespace namespaceSubject, IMembership mem) { if (namespaceSubject == null) @@ -302,6 +312,7 @@ internal static VisibilityKind ComputeVisibilityOfOperation(this INamespace name /// /// The expected collection of /// + [Operation(name: nameof(INamespace.VisibleMemberships))] internal static List ComputeVisibleMembershipsOperation(this INamespace namespaceSubject, List excluded, bool isRecursive, bool includeAll) { if (namespaceSubject == null) @@ -362,6 +373,7 @@ internal static List ComputeVisibleMembershipsOperation(this INames /// /// The expected collection of /// + [Operation(name: nameof(INamespace.ImportedMemberships))] internal static List ComputeImportedMembershipsOperation(this INamespace namespaceSubject, List excluded) { if (namespaceSubject == null) @@ -413,6 +425,7 @@ internal static List ComputeImportedMembershipsOperation(this IName /// /// The expected collection of /// + [Operation(name: nameof(INamespace.MembershipsOfVisibility))] internal static List ComputeMembershipsOfVisibilityOperation(this INamespace namespaceSubject, VisibilityKind? visibility, List excluded) { if (namespaceSubject == null) @@ -481,6 +494,7 @@ internal static List ComputeMembershipsOfVisibilityOperation(this I /// /// The expected /// + [Operation(name: nameof(INamespace.Resolve))] internal static IMembership ComputeResolveOperation(this INamespace namespaceSubject, string qualifiedName) { if (namespaceSubject == null) @@ -525,6 +539,7 @@ internal static IMembership ComputeResolveOperation(this INamespace namespaceSub /// /// The expected /// + [Operation(name: nameof(INamespace.ResolveGlobal))] internal static IMembership ComputeResolveGlobalOperation(this INamespace namespaceSubject, string qualifiedName) { if (namespaceSubject == null) @@ -589,6 +604,7 @@ internal static IMembership ComputeResolveGlobalOperation(this INamespace namesp /// /// The expected /// + [Operation(name: nameof(INamespace.ResolveLocal))] internal static IMembership ComputeResolveLocalOperation(this INamespace namespaceSubject, string name) { if (namespaceSubject == null) @@ -640,6 +656,7 @@ internal static IMembership ComputeResolveLocalOperation(this INamespace namespa /// /// The expected /// + [Operation(name: nameof(INamespace.ResolveVisible))] internal static IMembership ComputeResolveVisibleOperation(this INamespace namespaceSubject, string name) { if (namespaceSubject == null) @@ -671,6 +688,7 @@ internal static IMembership ComputeResolveVisibleOperation(this INamespace names /// /// The expected /// + [Operation(name: nameof(INamespace.QualificationOf))] internal static string ComputeQualificationOfOperation(this INamespace namespaceSubject, string qualifiedName) { if (namespaceSubject == null) @@ -702,6 +720,7 @@ internal static string ComputeQualificationOfOperation(this INamespace namespace /// /// The expected /// + [Operation(name: nameof(INamespace.UnqualifiedNameOf))] internal static string ComputeUnqualifiedNameOfOperation(this INamespace namespaceSubject, string qualifiedName) { if (namespaceSubject == null) diff --git a/SysML2.NET/Extend/NamespaceImportExtensions.cs b/SysML2.NET/Extend/NamespaceImportExtensions.cs index b4c162cb6..63a48910b 100644 --- a/SysML2.NET/Extend/NamespaceImportExtensions.cs +++ b/SysML2.NET/Extend/NamespaceImportExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Root.Namespaces using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Elements; @@ -55,6 +57,7 @@ internal static class NamespaceImportExtensions /// /// The expected collection of /// + [Operation(name: nameof(INamespaceImport.ImportedMemberships))] internal static List ComputeRedefinedImportedMembershipsOperation(this INamespaceImport namespaceImportSubject, List excluded) { if (namespaceImportSubject == null) diff --git a/SysML2.NET/Extend/NullExpressionExtensions.cs b/SysML2.NET/Extend/NullExpressionExtensions.cs index e2f8ea47b..c3d1746ed 100644 --- a/SysML2.NET/Extend/NullExpressionExtensions.cs +++ b/SysML2.NET/Extend/NullExpressionExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Expressions using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Root.Elements; @@ -50,6 +52,7 @@ internal static class NullExpressionExtensions /// /// The expected /// + [Operation(name: nameof(INullExpression.ModelLevelEvaluable))] internal static bool ComputeRedefinedModelLevelEvaluableOperation(this INullExpression nullExpressionSubject, List visited) { if (nullExpressionSubject == null) @@ -78,6 +81,7 @@ internal static bool ComputeRedefinedModelLevelEvaluableOperation(this INullExpr /// /// The expected collection of /// + [Operation(name: nameof(INullExpression.Evaluate))] internal static List ComputeRedefinedEvaluateOperation(this INullExpression nullExpressionSubject, IElement target) { if (nullExpressionSubject == null) diff --git a/SysML2.NET/Extend/ObjectiveMembershipExtensions.cs b/SysML2.NET/Extend/ObjectiveMembershipExtensions.cs index e99e225bb..b7988f4f7 100644 --- a/SysML2.NET/Extend/ObjectiveMembershipExtensions.cs +++ b/SysML2.NET/Extend/ObjectiveMembershipExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Systems.Cases { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Systems.Requirements; using SysML2.NET.Extensions; @@ -40,6 +42,7 @@ internal static class ObjectiveMembershipExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IObjectiveMembership.ownedObjectiveRequirement))] internal static IRequirementUsage ComputeOwnedObjectiveRequirement(this IObjectiveMembership objectiveMembershipSubject) { if (objectiveMembershipSubject == null) diff --git a/SysML2.NET/Extend/OccurrenceUsageExtensions.cs b/SysML2.NET/Extend/OccurrenceUsageExtensions.cs index b48c97580..2f68476b4 100644 --- a/SysML2.NET/Extend/OccurrenceUsageExtensions.cs +++ b/SysML2.NET/Extend/OccurrenceUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Occurrences using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -83,6 +85,7 @@ internal static class OccurrenceUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IOccurrenceUsage.individualDefinition))] internal static IOccurrenceDefinition ComputeIndividualDefinition(this IOccurrenceUsage occurrenceUsageSubject) { return occurrenceUsageSubject == null @@ -101,6 +104,7 @@ internal static IOccurrenceDefinition ComputeIndividualDefinition(this IOccurren /// /// the computed result /// + [DerivedProperty(name: nameof(IOccurrenceUsage.occurrenceDefinition))] internal static List ComputeOccurrenceDefinition(this IOccurrenceUsage occurrenceUsageSubject) { // occurrenceDefinition redefines Usage::definition -> Feature::type: reading subject.type diff --git a/SysML2.NET/Extend/OperatorExpressionExtensions.cs b/SysML2.NET/Extend/OperatorExpressionExtensions.cs index 7f09f5242..0f5604d55 100644 --- a/SysML2.NET/Extend/OperatorExpressionExtensions.cs +++ b/SysML2.NET/Extend/OperatorExpressionExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Expressions using System; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Types; /// @@ -53,6 +55,7 @@ internal static class OperatorExpressionExtensions /// /// The expected /// + [Operation(name: nameof(IOperatorExpression.InstantiatedType))] internal static IType ComputeRedefinedInstantiatedTypeOperation(this IOperatorExpression operatorExpressionSubject) { if (operatorExpressionSubject == null) diff --git a/SysML2.NET/Extend/OwningMembershipExtensions.cs b/SysML2.NET/Extend/OwningMembershipExtensions.cs index b6ca2960e..2b3cb486c 100644 --- a/SysML2.NET/Extend/OwningMembershipExtensions.cs +++ b/SysML2.NET/Extend/OwningMembershipExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Root.Namespaces using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Elements; @@ -43,6 +45,7 @@ internal static class OwningMembershipExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IOwningMembership.ownedMemberElement))] internal static IElement ComputeOwnedMemberElement(this IOwningMembership owningMembershipSubject) { if (owningMembershipSubject == null) @@ -62,6 +65,7 @@ internal static IElement ComputeOwnedMemberElement(this IOwningMembership owning /// /// the computed result /// + [DerivedProperty(name: nameof(IOwningMembership.ownedMemberElementId))] internal static string ComputeOwnedMemberElementId(this IOwningMembership owningMembershipSubject) { return owningMembershipSubject == null ? throw new ArgumentNullException(nameof(owningMembershipSubject)) : owningMembershipSubject.ownedMemberElement.ElementId; @@ -82,6 +86,7 @@ internal static string ComputeOwnedMemberElementId(this IOwningMembership owning /// /// the computed result /// + [DerivedProperty(name: nameof(IOwningMembership.ownedMemberName))] internal static string ComputeOwnedMemberName(this IOwningMembership owningMembershipSubject) { return owningMembershipSubject == null ? throw new ArgumentNullException(nameof(owningMembershipSubject)) : owningMembershipSubject.ownedMemberElement.name; @@ -102,6 +107,7 @@ internal static string ComputeOwnedMemberName(this IOwningMembership owningMembe /// /// the computed result /// + [DerivedProperty(name: nameof(IOwningMembership.ownedMemberShortName))] internal static string ComputeOwnedMemberShortName(this IOwningMembership owningMembershipSubject) { return owningMembershipSubject == null ? throw new ArgumentNullException(nameof(owningMembershipSubject)) : owningMembershipSubject.ownedMemberElement.shortName; @@ -118,6 +124,7 @@ internal static string ComputeOwnedMemberShortName(this IOwningMembership owning /// /// The expected /// + [Operation(name: nameof(IOwningMembership.Path))] internal static string ComputeRedefinedPathOperation(this IOwningMembership owningMembershipSubject) { if (owningMembershipSubject == null) diff --git a/SysML2.NET/Extend/PackageExtensions.cs b/SysML2.NET/Extend/PackageExtensions.cs index d7c1dd911..49fae100c 100644 --- a/SysML2.NET/Extend/PackageExtensions.cs +++ b/SysML2.NET/Extend/PackageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Packages using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Kernel.Functions; using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Elements; @@ -50,6 +52,7 @@ internal static class PackageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IPackage.filterCondition))] internal static List ComputeFilterCondition(this IPackage packageSubject) { return packageSubject == null ? throw new ArgumentNullException(nameof(packageSubject)) : [..packageSubject.ownedMembership.OfType().Select(x => x.condition)]; @@ -73,6 +76,7 @@ internal static List ComputeFilterCondition(this IPackage packageSu /// /// The expected collection of /// + [Operation(name: nameof(IPackage.ImportedMemberships))] internal static List ComputeRedefinedImportedMembershipsOperation(this IPackage packageSubject, List excluded) { if (packageSubject == null) @@ -113,6 +117,7 @@ internal static List ComputeRedefinedImportedMembershipsOperation(t /// /// The expected /// + [Operation(name: nameof(IPackage.IncludeAsMember))] internal static bool ComputeIncludeAsMemberOperation(this IPackage packageSubject, IElement element) { if (packageSubject == null) diff --git a/SysML2.NET/Extend/ParameterMembershipExtensions.cs b/SysML2.NET/Extend/ParameterMembershipExtensions.cs index 6c2b60f3e..37d61c651 100644 --- a/SysML2.NET/Extend/ParameterMembershipExtensions.cs +++ b/SysML2.NET/Extend/ParameterMembershipExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Behaviors using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Features; @@ -47,6 +49,7 @@ internal static class ParameterMembershipExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IParameterMembership.ownedMemberParameter))] internal static IFeature ComputeOwnedMemberParameter(this IParameterMembership parameterMembershipSubject) { if (parameterMembershipSubject == null) @@ -72,6 +75,7 @@ internal static IFeature ComputeOwnedMemberParameter(this IParameterMembership p /// /// The expected /// + [Operation(name: nameof(IParameterMembership.ParameterDirection))] internal static FeatureDirectionKind ComputeParameterDirectionOperation(this IParameterMembership parameterMembershipSubject) { if (parameterMembershipSubject == null) diff --git a/SysML2.NET/Extend/PartUsageExtensions.cs b/SysML2.NET/Extend/PartUsageExtensions.cs index 707f0a290..86babfe2e 100644 --- a/SysML2.NET/Extend/PartUsageExtensions.cs +++ b/SysML2.NET/Extend/PartUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Parts using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -78,6 +80,7 @@ internal static class PartUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IPartUsage.partDefinition))] internal static List ComputePartDefinition(this IPartUsage partUsageSubject) { return partUsageSubject == null diff --git a/SysML2.NET/Extend/PerformActionUsageExtensions.cs b/SysML2.NET/Extend/PerformActionUsageExtensions.cs index 93508cf0c..0d2ec1687 100644 --- a/SysML2.NET/Extend/PerformActionUsageExtensions.cs +++ b/SysML2.NET/Extend/PerformActionUsageExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Systems.Actions using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -72,6 +74,7 @@ internal static class PerformActionUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IPerformActionUsage.performedAction))] internal static IActionUsage ComputePerformedAction(this IPerformActionUsage performActionUsageSubject) { if (performActionUsageSubject == null) @@ -105,6 +108,7 @@ internal static IActionUsage ComputePerformedAction(this IPerformActionUsage per /// /// The expected /// + [Operation(name: nameof(IPerformActionUsage.NamingFeature))] internal static IFeature ComputeRedefinedNamingFeatureOperation(this IPerformActionUsage performActionUsageSubject) { if (performActionUsageSubject == null) diff --git a/SysML2.NET/Extend/PortConjugationExtensions.cs b/SysML2.NET/Extend/PortConjugationExtensions.cs index 1482a78a3..12fc419f3 100644 --- a/SysML2.NET/Extend/PortConjugationExtensions.cs +++ b/SysML2.NET/Extend/PortConjugationExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Systems.Ports { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Exceptions; /// @@ -39,6 +41,7 @@ internal static class PortConjugationExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IPortConjugation.conjugatedPortDefinition))] internal static IConjugatedPortDefinition ComputeConjugatedPortDefinition(this IPortConjugation portConjugationSubject) { if (portConjugationSubject == null) diff --git a/SysML2.NET/Extend/PortDefinitionExtensions.cs b/SysML2.NET/Extend/PortDefinitionExtensions.cs index 281ec09d5..15572a9a2 100644 --- a/SysML2.NET/Extend/PortDefinitionExtensions.cs +++ b/SysML2.NET/Extend/PortDefinitionExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Systems.Ports using System; using System.Linq; + using SysML2.NET.Decorators; + /// /// The class provides extensions methods for /// the interface @@ -49,6 +51,7 @@ internal static class PortDefinitionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IPortDefinition.conjugatedPortDefinition))] internal static IConjugatedPortDefinition ComputeConjugatedPortDefinition(this IPortDefinition portDefinitionSubject) { return portDefinitionSubject == null diff --git a/SysML2.NET/Extend/PortUsageExtensions.cs b/SysML2.NET/Extend/PortUsageExtensions.cs index 3e26b85ff..f9dfae559 100644 --- a/SysML2.NET/Extend/PortUsageExtensions.cs +++ b/SysML2.NET/Extend/PortUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Ports using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; /// @@ -41,6 +43,7 @@ internal static class PortUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IPortUsage.portDefinition))] internal static List ComputePortDefinition(this IPortUsage portUsageSubject) { return portUsageSubject == null diff --git a/SysML2.NET/Extend/ReferenceSubsettingExtensions.cs b/SysML2.NET/Extend/ReferenceSubsettingExtensions.cs index 444cd2b6f..07951ab81 100644 --- a/SysML2.NET/Extend/ReferenceSubsettingExtensions.cs +++ b/SysML2.NET/Extend/ReferenceSubsettingExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Core.Features { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Exceptions; /// @@ -46,6 +48,7 @@ internal static class ReferenceSubsettingExtensions /// /// Thrown when the owning related element is null or is not an . /// + [DerivedProperty(name: nameof(IReferenceSubsetting.referencingFeature))] internal static IFeature ComputeReferencingFeature(this IReferenceSubsetting referenceSubsettingSubject) { if (referenceSubsettingSubject == null) diff --git a/SysML2.NET/Extend/ReferenceUsageExtensions.cs b/SysML2.NET/Extend/ReferenceUsageExtensions.cs index 4026cfec7..a178e377d 100644 --- a/SysML2.NET/Extend/ReferenceUsageExtensions.cs +++ b/SysML2.NET/Extend/ReferenceUsageExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Systems.DefinitionAndUsage { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Systems.States; @@ -40,6 +42,7 @@ internal static class ReferenceUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IReferenceUsage.isReference))] internal static bool ComputeIsReference(this IReferenceUsage referenceUsageSubject) { if (referenceUsageSubject == null) @@ -70,6 +73,7 @@ internal static bool ComputeIsReference(this IReferenceUsage referenceUsageSubje /// /// The expected /// + [Operation(name: nameof(IReferenceUsage.NamingFeature))] internal static IFeature ComputeRedefinedNamingFeatureOperation(this IReferenceUsage referenceUsageSubject) { if (referenceUsageSubject == null) diff --git a/SysML2.NET/Extend/RelationshipExtensions.cs b/SysML2.NET/Extend/RelationshipExtensions.cs index 5ff6d0f34..bd8a010e6 100644 --- a/SysML2.NET/Extend/RelationshipExtensions.cs +++ b/SysML2.NET/Extend/RelationshipExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Root.Elements using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Root.Namespaces; @@ -49,6 +51,7 @@ internal static class RelationshipExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IRelationship.relatedElement))] internal static List ComputeRelatedElement(this IRelationship relationshipSubject) { return relationshipSubject == null @@ -75,6 +78,7 @@ internal static List ComputeRelatedElement(this IRelationship relation /// /// The expected /// + [Operation(name: nameof(IRelationship.LibraryNamespace))] internal static INamespace ComputeRedefinedLibraryNamespaceOperation(this IRelationship relationshipSubject) { if (relationshipSubject == null) @@ -108,6 +112,7 @@ internal static INamespace ComputeRedefinedLibraryNamespaceOperation(this IRelat /// /// The expected /// + [Operation(name: nameof(IRelationship.Path))] internal static string ComputeRedefinedPathOperation(this IRelationship relationshipSubject) { if (relationshipSubject == null) diff --git a/SysML2.NET/Extend/RenderingDefinitionExtensions.cs b/SysML2.NET/Extend/RenderingDefinitionExtensions.cs index b45ba7632..0f459c893 100644 --- a/SysML2.NET/Extend/RenderingDefinitionExtensions.cs +++ b/SysML2.NET/Extend/RenderingDefinitionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Views using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Classifiers; @@ -75,6 +77,7 @@ internal static class RenderingDefinitionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IRenderingDefinition.rendering))] internal static List ComputeRendering(this IRenderingDefinition renderingDefinitionSubject) { return renderingDefinitionSubject == null diff --git a/SysML2.NET/Extend/RenderingUsageExtensions.cs b/SysML2.NET/Extend/RenderingUsageExtensions.cs index 581c532b5..6c8e239d8 100644 --- a/SysML2.NET/Extend/RenderingUsageExtensions.cs +++ b/SysML2.NET/Extend/RenderingUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Views using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -84,6 +86,7 @@ internal static class RenderingUsageExtensions /// (upper-bound violation against the derived /// [0..1] property). /// + [DerivedProperty(name: nameof(IRenderingUsage.renderingDefinition))] internal static IRenderingDefinition ComputeRenderingDefinition(this IRenderingUsage renderingUsageSubject) { return renderingUsageSubject == null diff --git a/SysML2.NET/Extend/RequirementConstraintMembershipExtensions.cs b/SysML2.NET/Extend/RequirementConstraintMembershipExtensions.cs index 985e469ac..a5cfad6f1 100644 --- a/SysML2.NET/Extend/RequirementConstraintMembershipExtensions.cs +++ b/SysML2.NET/Extend/RequirementConstraintMembershipExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Systems.Requirements { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Systems.Constraints; using SysML2.NET.Extensions; @@ -40,6 +42,7 @@ internal static class RequirementConstraintMembershipExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IRequirementConstraintMembership.ownedConstraint))] internal static IConstraintUsage ComputeOwnedConstraint(this IRequirementConstraintMembership requirementConstraintMembershipSubject) { if (requirementConstraintMembershipSubject == null) @@ -72,6 +75,7 @@ internal static IConstraintUsage ComputeOwnedConstraint(this IRequirementConstra /// /// the computed result /// + [DerivedProperty(name: nameof(IRequirementConstraintMembership.referencedConstraint))] internal static IConstraintUsage ComputeReferencedConstraint(this IRequirementConstraintMembership requirementConstraintMembershipSubject) { if (requirementConstraintMembershipSubject == null) diff --git a/SysML2.NET/Extend/RequirementDefinitionExtensions.cs b/SysML2.NET/Extend/RequirementDefinitionExtensions.cs index 49dcd615b..a470a56a8 100644 --- a/SysML2.NET/Extend/RequirementDefinitionExtensions.cs +++ b/SysML2.NET/Extend/RequirementDefinitionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Requirements using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Systems.Requirements; using SysML2.NET.Core.POCO.Root.Annotations; using SysML2.NET.Core.POCO.Systems.Constraints; @@ -53,6 +55,7 @@ internal static class RequirementDefinitionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IRequirementDefinition.actorParameter))] internal static List ComputeActorParameter(this IRequirementDefinition requirementDefinitionSubject) { return requirementDefinitionSubject == null @@ -78,6 +81,7 @@ internal static List ComputeActorParameter(this IRequirementDefiniti /// /// the computed result /// + [DerivedProperty(name: nameof(IRequirementDefinition.assumedConstraint))] internal static List ComputeAssumedConstraint(this IRequirementDefinition requirementDefinitionSubject) { return requirementDefinitionSubject == null @@ -107,6 +111,7 @@ internal static List ComputeAssumedConstraint(this IRequiremen /// /// the computed result /// + [DerivedProperty(name: nameof(IRequirementDefinition.framedConcern))] internal static List ComputeFramedConcern(this IRequirementDefinition requirementDefinitionSubject) { return requirementDefinitionSubject == null @@ -132,6 +137,7 @@ internal static List ComputeFramedConcern(this IRequirementDefini /// /// the computed result /// + [DerivedProperty(name: nameof(IRequirementDefinition.requiredConstraint))] internal static List ComputeRequiredConstraint(this IRequirementDefinition requirementDefinitionSubject) { return requirementDefinitionSubject == null @@ -161,6 +167,7 @@ internal static List ComputeRequiredConstraint(this IRequireme /// /// the computed result /// + [DerivedProperty(name: nameof(IRequirementDefinition.stakeholderParameter))] internal static List ComputeStakeholderParameter(this IRequirementDefinition requirementDefinitionSubject) { // The OCL uses "StakholderMembership" which is a typo in the XMI source; the correct C# type is IStakeholderMembership. @@ -189,6 +196,7 @@ internal static List ComputeStakeholderParameter(this IRequirementDe /// /// the computed result /// + [DerivedProperty(name: nameof(IRequirementDefinition.subjectParameter))] internal static IUsage ComputeSubjectParameter(this IRequirementDefinition requirementDefinitionSubject) { if (requirementDefinitionSubject == null) @@ -218,6 +226,7 @@ internal static IUsage ComputeSubjectParameter(this IRequirementDefinition requi /// /// the computed result /// + [DerivedProperty(name: nameof(IRequirementDefinition.text))] internal static List ComputeText(this IRequirementDefinition requirementDefinitionSubject) { return requirementDefinitionSubject == null diff --git a/SysML2.NET/Extend/RequirementUsageExtensions.cs b/SysML2.NET/Extend/RequirementUsageExtensions.cs index 6a59c1664..1092ae07a 100644 --- a/SysML2.NET/Extend/RequirementUsageExtensions.cs +++ b/SysML2.NET/Extend/RequirementUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Requirements using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Systems.Requirements; using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Core.Types; @@ -57,6 +59,7 @@ internal static class RequirementUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IRequirementUsage.actorParameter))] internal static List ComputeActorParameter(this IRequirementUsage requirementUsageSubject) { return requirementUsageSubject == null @@ -82,6 +85,7 @@ internal static List ComputeActorParameter(this IRequirementUsage re /// /// the computed result /// + [DerivedProperty(name: nameof(IRequirementUsage.assumedConstraint))] internal static List ComputeAssumedConstraint(this IRequirementUsage requirementUsageSubject) { return requirementUsageSubject == null @@ -109,6 +113,7 @@ internal static List ComputeAssumedConstraint(this IRequiremen /// /// the computed result /// + [DerivedProperty(name: nameof(IRequirementUsage.framedConcern))] internal static List ComputeFramedConcern(this IRequirementUsage requirementUsageSubject) { return requirementUsageSubject == null @@ -134,6 +139,7 @@ internal static List ComputeFramedConcern(this IRequirementUsage /// /// the computed result /// + [DerivedProperty(name: nameof(IRequirementUsage.requiredConstraint))] internal static List ComputeRequiredConstraint(this IRequirementUsage requirementUsageSubject) { return requirementUsageSubject == null @@ -163,6 +169,7 @@ internal static List ComputeRequiredConstraint(this IRequireme /// (upper-bound violation against the derived /// [0..1] property). /// + [DerivedProperty(name: nameof(IRequirementUsage.requirementDefinition))] internal static IRequirementDefinition ComputeRequirementDefinition(this IRequirementUsage requirementUsageSubject) { return requirementUsageSubject == null @@ -187,6 +194,7 @@ internal static IRequirementDefinition ComputeRequirementDefinition(this IRequir /// /// the computed result /// + [DerivedProperty(name: nameof(IRequirementUsage.stakeholderParameter))] internal static List ComputeStakeholderParameter(this IRequirementUsage requirementUsageSubject) { // The OCL uses "AStakholderMembership" which is a typo in the XMI source; the correct C# type is IStakeholderMembership. @@ -215,6 +223,7 @@ internal static List ComputeStakeholderParameter(this IRequirementUs /// /// the computed result /// + [DerivedProperty(name: nameof(IRequirementUsage.subjectParameter))] internal static IUsage ComputeSubjectParameter(this IRequirementUsage requirementUsageSubject) { if (requirementUsageSubject == null) @@ -244,6 +253,7 @@ internal static IUsage ComputeSubjectParameter(this IRequirementUsage requiremen /// /// the computed result /// + [DerivedProperty(name: nameof(IRequirementUsage.text))] internal static List ComputeText(this IRequirementUsage requirementUsageSubject) { return requirementUsageSubject == null diff --git a/SysML2.NET/Extend/RequirementVerificationMembershipExtensions.cs b/SysML2.NET/Extend/RequirementVerificationMembershipExtensions.cs index d6f16116f..a605630d7 100644 --- a/SysML2.NET/Extend/RequirementVerificationMembershipExtensions.cs +++ b/SysML2.NET/Extend/RequirementVerificationMembershipExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Systems.VerificationCases using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Requirements; using SysML2.NET.Core.POCO.Core.Features; @@ -49,6 +51,7 @@ internal static class RequirementVerificationMembershipExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IRequirementVerificationMembership.ownedRequirement))] internal static IRequirementUsage ComputeOwnedRequirement(this IRequirementVerificationMembership requirementVerificationMembershipSubject) { if (requirementVerificationMembershipSubject == null) @@ -68,6 +71,7 @@ internal static IRequirementUsage ComputeOwnedRequirement(this IRequirementVerif /// /// the computed result /// + [DerivedProperty(name: nameof(IRequirementVerificationMembership.verifiedRequirement))] internal static IRequirementUsage ComputeVerifiedRequirement(this IRequirementVerificationMembership requirementVerificationMembershipSubject) { if (requirementVerificationMembershipSubject == null) diff --git a/SysML2.NET/Extend/ResultExpressionMembershipExtensions.cs b/SysML2.NET/Extend/ResultExpressionMembershipExtensions.cs index 437f8e6be..259d295d0 100644 --- a/SysML2.NET/Extend/ResultExpressionMembershipExtensions.cs +++ b/SysML2.NET/Extend/ResultExpressionMembershipExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Functions { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Extensions; /// @@ -39,6 +41,7 @@ internal static class ResultExpressionMembershipExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IResultExpressionMembership.ownedResultExpression))] internal static IExpression ComputeOwnedResultExpression(this IResultExpressionMembership resultExpressionMembershipSubject) { if (resultExpressionMembershipSubject == null) diff --git a/SysML2.NET/Extend/ReturnParameterMembershipExtensions.cs b/SysML2.NET/Extend/ReturnParameterMembershipExtensions.cs index 3f283a64b..b0430bd90 100644 --- a/SysML2.NET/Extend/ReturnParameterMembershipExtensions.cs +++ b/SysML2.NET/Extend/ReturnParameterMembershipExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Functions using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Features; @@ -54,6 +56,7 @@ internal static class ReturnParameterMembershipExtensions /// /// The expected /// + [Operation(name: nameof(IReturnParameterMembership.ParameterDirection))] internal static FeatureDirectionKind ComputeRedefinedParameterDirectionOperation(this IReturnParameterMembership returnParameterMembershipSubject) { return returnParameterMembershipSubject == null diff --git a/SysML2.NET/Extend/SatisfyRequirementUsageExtensions.cs b/SysML2.NET/Extend/SatisfyRequirementUsageExtensions.cs index 6b9e0aeeb..e69cca30e 100644 --- a/SysML2.NET/Extend/SatisfyRequirementUsageExtensions.cs +++ b/SysML2.NET/Extend/SatisfyRequirementUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Requirements using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -74,6 +76,7 @@ internal static class SatisfyRequirementUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(ISatisfyRequirementUsage.satisfiedRequirement))] internal static IRequirementUsage ComputeSatisfiedRequirement(this ISatisfyRequirementUsage satisfyRequirementUsageSubject) { if (satisfyRequirementUsageSubject == null) @@ -117,6 +120,7 @@ internal static IRequirementUsage ComputeSatisfiedRequirement(this ISatisfyRequi /// /// the computed result /// + [DerivedProperty(name: nameof(ISatisfyRequirementUsage.satisfyingFeature))] internal static IFeature ComputeSatisfyingFeature(this ISatisfyRequirementUsage satisfyRequirementUsageSubject) { if (satisfyRequirementUsageSubject == null) diff --git a/SysML2.NET/Extend/SendActionUsageExtensions.cs b/SysML2.NET/Extend/SendActionUsageExtensions.cs index 6c7e933ca..6f6425076 100644 --- a/SysML2.NET/Extend/SendActionUsageExtensions.cs +++ b/SysML2.NET/Extend/SendActionUsageExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Systems.Actions { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Kernel.Functions; /// @@ -45,6 +47,7 @@ internal static class SendActionUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(ISendActionUsage.payloadArgument))] internal static IExpression ComputePayloadArgument(this ISendActionUsage sendActionUsageSubject) { return sendActionUsageSubject == null @@ -67,6 +70,7 @@ internal static IExpression ComputePayloadArgument(this ISendActionUsage sendAct /// /// the computed result /// + [DerivedProperty(name: nameof(ISendActionUsage.receiverArgument))] internal static IExpression ComputeReceiverArgument(this ISendActionUsage sendActionUsageSubject) { return sendActionUsageSubject == null @@ -89,6 +93,7 @@ internal static IExpression ComputeReceiverArgument(this ISendActionUsage sendAc /// /// the computed result /// + [DerivedProperty(name: nameof(ISendActionUsage.senderArgument))] internal static IExpression ComputeSenderArgument(this ISendActionUsage sendActionUsageSubject) { return sendActionUsageSubject == null diff --git a/SysML2.NET/Extend/SpecializationExtensions.cs b/SysML2.NET/Extend/SpecializationExtensions.cs index c6284003c..5b461c5bc 100644 --- a/SysML2.NET/Extend/SpecializationExtensions.cs +++ b/SysML2.NET/Extend/SpecializationExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Core.Types { using System; + using SysML2.NET.Decorators; + /// /// The class provides extensions methods for /// the interface @@ -37,6 +39,7 @@ internal static class SpecializationExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(ISpecialization.owningType))] internal static IType ComputeOwningType(this ISpecialization specializationSubject) { return specializationSubject == null diff --git a/SysML2.NET/Extend/StakeholderMembershipExtensions.cs b/SysML2.NET/Extend/StakeholderMembershipExtensions.cs index c4462a316..4564d5c1e 100644 --- a/SysML2.NET/Extend/StakeholderMembershipExtensions.cs +++ b/SysML2.NET/Extend/StakeholderMembershipExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Systems.Requirements { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Systems.Parts; using SysML2.NET.Extensions; @@ -40,6 +42,7 @@ internal static class StakeholderMembershipExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IStakeholderMembership.ownedStakeholderParameter))] internal static IPartUsage ComputeOwnedStakeholderParameter(this IStakeholderMembership stakeholderMembershipSubject) { if (stakeholderMembershipSubject == null) diff --git a/SysML2.NET/Extend/StateDefinitionExtensions.cs b/SysML2.NET/Extend/StateDefinitionExtensions.cs index 47412edbe..05ab995f6 100644 --- a/SysML2.NET/Extend/StateDefinitionExtensions.cs +++ b/SysML2.NET/Extend/StateDefinitionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.States using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Classifiers; @@ -84,6 +86,7 @@ internal static class StateDefinitionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IStateDefinition.doAction))] internal static IActionUsage ComputeDoAction(this IStateDefinition stateDefinitionSubject) { if (stateDefinitionSubject == null) @@ -119,6 +122,7 @@ internal static IActionUsage ComputeDoAction(this IStateDefinition stateDefiniti /// /// the computed result /// + [DerivedProperty(name: nameof(IStateDefinition.entryAction))] internal static IActionUsage ComputeEntryAction(this IStateDefinition stateDefinitionSubject) { if (stateDefinitionSubject == null) @@ -154,6 +158,7 @@ internal static IActionUsage ComputeEntryAction(this IStateDefinition stateDefin /// /// the computed result /// + [DerivedProperty(name: nameof(IStateDefinition.exitAction))] internal static IActionUsage ComputeExitAction(this IStateDefinition stateDefinitionSubject) { if (stateDefinitionSubject == null) @@ -182,6 +187,7 @@ internal static IActionUsage ComputeExitAction(this IStateDefinition stateDefini /// /// the computed result /// + [DerivedProperty(name: nameof(IStateDefinition.state))] internal static List ComputeState(this IStateDefinition stateDefinitionSubject) { return stateDefinitionSubject == null diff --git a/SysML2.NET/Extend/StateSubactionMembershipExtensions.cs b/SysML2.NET/Extend/StateSubactionMembershipExtensions.cs index 5484d4fcc..126f6d04b 100644 --- a/SysML2.NET/Extend/StateSubactionMembershipExtensions.cs +++ b/SysML2.NET/Extend/StateSubactionMembershipExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Systems.States { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Systems.Actions; using SysML2.NET.Extensions; @@ -40,6 +42,7 @@ internal static class StateSubactionMembershipExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IStateSubactionMembership.action))] internal static IActionUsage ComputeAction(this IStateSubactionMembership stateSubactionMembershipSubject) { if (stateSubactionMembershipSubject == null) diff --git a/SysML2.NET/Extend/StateUsageExtensions.cs b/SysML2.NET/Extend/StateUsageExtensions.cs index b2d2ced18..bf4a23a8e 100644 --- a/SysML2.NET/Extend/StateUsageExtensions.cs +++ b/SysML2.NET/Extend/StateUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.States using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Kernel.Behaviors; using SysML2.NET.Core.POCO.Systems.Actions; @@ -57,6 +59,7 @@ internal static class StateUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IStateUsage.doAction))] internal static IActionUsage ComputeDoAction(this IStateUsage stateUsageSubject) { if (stateUsageSubject == null) @@ -92,6 +95,7 @@ internal static IActionUsage ComputeDoAction(this IStateUsage stateUsageSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IStateUsage.entryAction))] internal static IActionUsage ComputeEntryAction(this IStateUsage stateUsageSubject) { if (stateUsageSubject == null) @@ -127,6 +131,7 @@ internal static IActionUsage ComputeEntryAction(this IStateUsage stateUsageSubje /// /// the computed result /// + [DerivedProperty(name: nameof(IStateUsage.exitAction))] internal static IActionUsage ComputeExitAction(this IStateUsage stateUsageSubject) { if (stateUsageSubject == null) @@ -149,6 +154,7 @@ internal static IActionUsage ComputeExitAction(this IStateUsage stateUsageSubjec /// /// the computed result /// + [DerivedProperty(name: nameof(IStateUsage.stateDefinition))] internal static List ComputeStateDefinition(this IStateUsage stateUsageSubject) { return stateUsageSubject == null @@ -182,6 +188,7 @@ internal static List ComputeStateDefinition(this IStateUsage stateUsa /// /// The expected /// + [Operation(name: nameof(IStateUsage.IsSubstateUsage))] internal static bool ComputeIsSubstateUsageOperation(this IStateUsage stateUsageSubject, bool isParallel) { if (stateUsageSubject == null) diff --git a/SysML2.NET/Extend/StepExtensions.cs b/SysML2.NET/Extend/StepExtensions.cs index 121f36310..f0ba89096 100644 --- a/SysML2.NET/Extend/StepExtensions.cs +++ b/SysML2.NET/Extend/StepExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Kernel.Behaviors using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Features; @@ -53,6 +55,7 @@ internal static class StepExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IStep.behavior))] internal static List ComputeBehavior(this IStep stepSubject) { return stepSubject == null @@ -69,6 +72,7 @@ internal static List ComputeBehavior(this IStep stepSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IStep.parameter))] internal static List ComputeParameter(this IStep stepSubject) { return stepSubject == null diff --git a/SysML2.NET/Extend/SubclassificationExtensions.cs b/SysML2.NET/Extend/SubclassificationExtensions.cs index 2a6b9d6d6..581f7a15a 100644 --- a/SysML2.NET/Extend/SubclassificationExtensions.cs +++ b/SysML2.NET/Extend/SubclassificationExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Core.Classifiers { using System; + using SysML2.NET.Decorators; + /// /// The class provides extensions methods for /// the interface @@ -37,6 +39,7 @@ internal static class SubclassificationExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(ISubclassification.owningClassifier))] internal static IClassifier ComputeOwningClassifier(this ISubclassification subclassificationSubject) { return subclassificationSubject == null diff --git a/SysML2.NET/Extend/SubjectMembershipExtensions.cs b/SysML2.NET/Extend/SubjectMembershipExtensions.cs index ef6a5303a..0f8812d4b 100644 --- a/SysML2.NET/Extend/SubjectMembershipExtensions.cs +++ b/SysML2.NET/Extend/SubjectMembershipExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Systems.Requirements using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Systems.DefinitionAndUsage; using SysML2.NET.Extensions; @@ -41,6 +43,7 @@ internal static class SubjectMembershipExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(ISubjectMembership.ownedSubjectParameter))] internal static IUsage ComputeOwnedSubjectParameter(this ISubjectMembership subjectMembershipSubject) { if (subjectMembershipSubject == null) diff --git a/SysML2.NET/Extend/SubsettingExtensions.cs b/SysML2.NET/Extend/SubsettingExtensions.cs index 4e095e81c..d12c2b8ac 100644 --- a/SysML2.NET/Extend/SubsettingExtensions.cs +++ b/SysML2.NET/Extend/SubsettingExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Core.Features { using System; + using SysML2.NET.Decorators; + /// /// The class provides extensions methods for /// the interface @@ -37,6 +39,7 @@ internal static class SubsettingExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(ISubsetting.owningFeature))] internal static IFeature ComputeOwningFeature(this ISubsetting subsettingSubject) { return subsettingSubject == null diff --git a/SysML2.NET/Extend/TerminateActionUsageExtensions.cs b/SysML2.NET/Extend/TerminateActionUsageExtensions.cs index 0a9beb2d9..7aafa53f3 100644 --- a/SysML2.NET/Extend/TerminateActionUsageExtensions.cs +++ b/SysML2.NET/Extend/TerminateActionUsageExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Systems.Actions { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Kernel.Functions; /// @@ -45,6 +47,7 @@ internal static class TerminateActionUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(ITerminateActionUsage.terminatedOccurrenceArgument))] internal static IExpression ComputeTerminatedOccurrenceArgument(this ITerminateActionUsage terminateActionUsageSubject) { return terminateActionUsageSubject == null diff --git a/SysML2.NET/Extend/TextualRepresentationExtensions.cs b/SysML2.NET/Extend/TextualRepresentationExtensions.cs index 786f41212..23f5b0a94 100644 --- a/SysML2.NET/Extend/TextualRepresentationExtensions.cs +++ b/SysML2.NET/Extend/TextualRepresentationExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Root.Annotations { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Root.Elements; using SysML2.NET.Exceptions; @@ -51,6 +53,7 @@ internal static class TextualRepresentationExtensions /// /// Thrown when the has no owner. /// + [DerivedProperty(name: nameof(ITextualRepresentation.representedElement))] internal static IElement ComputeRepresentedElement(this ITextualRepresentation textualRepresentationSubject) { if (textualRepresentationSubject == null) diff --git a/SysML2.NET/Extend/TransitionFeatureMembershipExtensions.cs b/SysML2.NET/Extend/TransitionFeatureMembershipExtensions.cs index b7c08bae5..c826b4135 100644 --- a/SysML2.NET/Extend/TransitionFeatureMembershipExtensions.cs +++ b/SysML2.NET/Extend/TransitionFeatureMembershipExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Systems.States using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.States; using SysML2.NET.Core.POCO.Core.Features; @@ -48,6 +50,7 @@ internal static class TransitionFeatureMembershipExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(ITransitionFeatureMembership.transitionFeature))] internal static IStep ComputeTransitionFeature(this ITransitionFeatureMembership transitionFeatureMembershipSubject) { if (transitionFeatureMembershipSubject == null) diff --git a/SysML2.NET/Extend/TransitionUsageExtensions.cs b/SysML2.NET/Extend/TransitionUsageExtensions.cs index e5a3ae4fb..c41f8b284 100644 --- a/SysML2.NET/Extend/TransitionUsageExtensions.cs +++ b/SysML2.NET/Extend/TransitionUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.States using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -84,6 +86,7 @@ internal static class TransitionUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(ITransitionUsage.effectAction))] internal static List ComputeEffectAction(this ITransitionUsage transitionUsageSubject) { if (transitionUsageSubject == null) @@ -116,6 +119,7 @@ internal static List ComputeEffectAction(this ITransitionUsage tra /// /// the computed result /// + [DerivedProperty(name: nameof(ITransitionUsage.guardExpression))] internal static List ComputeGuardExpression(this ITransitionUsage transitionUsageSubject) { if (transitionUsageSubject == null) @@ -148,6 +152,7 @@ internal static List ComputeGuardExpression(this ITransitionUsage t /// /// the computed result /// + [DerivedProperty(name: nameof(ITransitionUsage.source))] internal static IActionUsage ComputeSource(this ITransitionUsage transitionUsageSubject) { if (transitionUsageSubject == null) @@ -175,6 +180,7 @@ internal static IActionUsage ComputeSource(this ITransitionUsage transitionUsage /// /// the computed result /// + [DerivedProperty(name: nameof(ITransitionUsage.succession))] internal static ISuccession ComputeSuccession(this ITransitionUsage transitionUsageSubject) { if (transitionUsageSubject == null) @@ -208,6 +214,7 @@ internal static ISuccession ComputeSuccession(this ITransitionUsage transitionUs /// /// the computed result /// + [DerivedProperty(name: nameof(ITransitionUsage.target))] internal static IActionUsage ComputeTarget(this ITransitionUsage transitionUsageSubject) { if (transitionUsageSubject == null) @@ -247,6 +254,7 @@ internal static IActionUsage ComputeTarget(this ITransitionUsage transitionUsage /// /// the computed result /// + [DerivedProperty(name: nameof(ITransitionUsage.triggerAction))] internal static List ComputeTriggerAction(this ITransitionUsage transitionUsageSubject) { if (transitionUsageSubject == null) @@ -278,6 +286,7 @@ internal static List ComputeTriggerAction(this ITransitionUs /// /// The expected /// + [Operation(name: nameof(ITransitionUsage.TriggerPayloadParameter))] internal static IReferenceUsage ComputeTriggerPayloadParameterOperation(this ITransitionUsage transitionUsageSubject) { if (transitionUsageSubject == null) @@ -315,6 +324,7 @@ internal static IReferenceUsage ComputeTriggerPayloadParameterOperation(this ITr /// /// The expected /// + [Operation(name: nameof(ITransitionUsage.SourceFeature))] internal static IFeature ComputeSourceFeatureOperation(this ITransitionUsage transitionUsageSubject) { if (transitionUsageSubject == null) diff --git a/SysML2.NET/Extend/TriggerInvocationExpressionExtensions.cs b/SysML2.NET/Extend/TriggerInvocationExpressionExtensions.cs index 460273212..10eff492d 100644 --- a/SysML2.NET/Extend/TriggerInvocationExpressionExtensions.cs +++ b/SysML2.NET/Extend/TriggerInvocationExpressionExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Systems.Actions { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.Systems.Actions; @@ -56,6 +58,7 @@ internal static class TriggerInvocationExpressionExtensions /// /// The expected /// + [Operation(name: nameof(ITriggerInvocationExpression.InstantiatedType))] internal static IType ComputeRedefinedInstantiatedTypeOperation(this ITriggerInvocationExpression triggerInvocationExpressionSubject) { if (triggerInvocationExpressionSubject == null) diff --git a/SysML2.NET/Extend/TypeExtensions.cs b/SysML2.NET/Extend/TypeExtensions.cs index 49a02a499..1a0cc858d 100644 --- a/SysML2.NET/Extend/TypeExtensions.cs +++ b/SysML2.NET/Extend/TypeExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Core.Types using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Features; @@ -53,6 +55,7 @@ internal static class TypeExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IType.differencingType))] internal static List ComputeDifferencingType(this IType typeSubject) { return typeSubject == null @@ -75,6 +78,7 @@ internal static List ComputeDifferencingType(this IType typeSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IType.directedFeature))] internal static List ComputeDirectedFeature(this IType typeSubject) { return typeSubject == null @@ -97,6 +101,7 @@ internal static List ComputeDirectedFeature(this IType typeSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IType.endFeature))] internal static List ComputeEndFeature(this IType typeSubject) { return typeSubject == null @@ -119,6 +124,7 @@ internal static List ComputeEndFeature(this IType typeSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IType.feature))] internal static List ComputeFeature(this IType typeSubject) { return typeSubject == null @@ -142,6 +148,7 @@ internal static List ComputeFeature(this IType typeSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IType.featureMembership))] internal static List ComputeFeatureMembership(this IType typeSubject) { return typeSubject == null @@ -165,6 +172,7 @@ internal static List ComputeFeatureMembership(this IType typ /// /// the computed result /// + [DerivedProperty(name: nameof(IType.inheritedFeature))] internal static List ComputeInheritedFeature(this IType typeSubject) { return typeSubject == null @@ -187,6 +195,7 @@ internal static List ComputeInheritedFeature(this IType typeSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IType.inheritedMembership))] internal static List ComputeInheritedMembership(this IType typeSubject) { return typeSubject == null @@ -212,6 +221,7 @@ internal static List ComputeInheritedMembership(this IType typeSubj /// /// the computed result /// + [DerivedProperty(name: nameof(IType.input))] internal static List ComputeInput(this IType typeSubject) { return typeSubject == null @@ -234,6 +244,7 @@ internal static List ComputeInput(this IType typeSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IType.intersectingType))] internal static List ComputeIntersectingType(this IType typeSubject) { return typeSubject == null @@ -250,6 +261,7 @@ internal static List ComputeIntersectingType(this IType typeSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IType.isConjugated))] internal static bool ComputeIsConjugated(this IType typeSubject) { return typeSubject == null @@ -277,6 +289,7 @@ internal static bool ComputeIsConjugated(this IType typeSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IType.multiplicity))] internal static IMultiplicity ComputeMultiplicity(this IType typeSubject) { return typeSubject == null @@ -302,6 +315,7 @@ internal static IMultiplicity ComputeMultiplicity(this IType typeSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IType.output))] internal static List ComputeOutput(this IType typeSubject) { return typeSubject == null @@ -328,6 +342,7 @@ internal static List ComputeOutput(this IType typeSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IType.ownedConjugator))] internal static IConjugation ComputeOwnedConjugator(this IType typeSubject) { return typeSubject == null @@ -351,6 +366,7 @@ internal static IConjugation ComputeOwnedConjugator(this IType typeSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IType.ownedDifferencing))] internal static List ComputeOwnedDifferencing(this IType typeSubject) { return typeSubject == null @@ -374,6 +390,7 @@ internal static List ComputeOwnedDifferencing(this IType typeSubj /// /// the computed result /// + [DerivedProperty(name: nameof(IType.ownedDisjoining))] internal static List ComputeOwnedDisjoining(this IType typeSubject) { return typeSubject == null @@ -396,6 +413,7 @@ internal static List ComputeOwnedDisjoining(this IType typeSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IType.ownedEndFeature))] internal static List ComputeOwnedEndFeature(this IType typeSubject) { return typeSubject == null @@ -418,6 +436,7 @@ internal static List ComputeOwnedEndFeature(this IType typeSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IType.ownedFeature))] internal static List ComputeOwnedFeature(this IType typeSubject) { return typeSubject == null @@ -440,6 +459,7 @@ internal static List ComputeOwnedFeature(this IType typeSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IType.ownedFeatureMembership))] internal static List ComputeOwnedFeatureMembership(this IType typeSubject) { return typeSubject == null @@ -462,6 +482,7 @@ internal static List ComputeOwnedFeatureMembership(this ITyp /// /// the computed result /// + [DerivedProperty(name: nameof(IType.ownedIntersecting))] internal static List ComputeOwnedIntersecting(this IType typeSubject) { return typeSubject == null @@ -485,6 +506,7 @@ internal static List ComputeOwnedIntersecting(this IType typeSubj /// /// the computed result /// + [DerivedProperty(name: nameof(IType.ownedSpecialization))] internal static List ComputeOwnedSpecialization(this IType typeSubject) { return typeSubject == null @@ -508,6 +530,7 @@ internal static List ComputeOwnedSpecialization(this IType type /// /// the computed result /// + [DerivedProperty(name: nameof(IType.ownedUnioning))] internal static List ComputeOwnedUnioning(this IType typeSubject) { return typeSubject == null @@ -530,6 +553,7 @@ internal static List ComputeOwnedUnioning(this IType typeSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IType.unioningType))] internal static List ComputeUnioningType(this IType typeSubject) { return typeSubject == null @@ -567,6 +591,7 @@ internal static List ComputeUnioningType(this IType typeSubject) /// /// The expected collection of /// + [Operation(name: nameof(IType.VisibleMemberships))] internal static List ComputeRedefinedVisibleMembershipsOperation(this IType typeSubject, List excluded, bool isRecursive, bool includeAll) { if (typeSubject == null) @@ -615,6 +640,7 @@ internal static List ComputeRedefinedVisibleMembershipsOperation(th /// /// The expected collection of /// + [Operation(name: nameof(IType.InheritedMemberships))] internal static List ComputeInheritedMembershipsOperation(this IType typeSubject, List excludedNamespaces, List excludedTypes, bool excludeImplied) { if (typeSubject == null) @@ -867,6 +893,7 @@ private static void AppendDistinct(List target, HashSet /// The expected collection of /// + [Operation(name: nameof(IType.InheritableMemberships))] internal static List ComputeInheritableMembershipsOperation(this IType typeSubject, List excludedNamespaces, List excludedTypes, bool excludeImplied) { if (typeSubject == null) @@ -916,6 +943,7 @@ internal static List ComputeInheritableMembershipsOperation(this IT /// /// The expected collection of /// + [Operation(name: nameof(IType.NonPrivateMemberships))] internal static List ComputeNonPrivateMembershipsOperation(this IType typeSubject, List excludedNamespaces, List excludedTypes, bool excludeImplied) { if (typeSubject == null) @@ -959,6 +987,7 @@ internal static List ComputeNonPrivateMembershipsOperation(this ITy /// /// The expected collection of /// + [Operation(name: nameof(IType.RemoveRedefinedFeatures))] internal static List ComputeRemoveRedefinedFeaturesOperation(this IType typeSubject, List memberships) { if (typeSubject == null) @@ -1030,6 +1059,7 @@ internal static List ComputeRemoveRedefinedFeaturesOperation(this I /// /// The expected collection of /// + [Operation(name: nameof(IType.AllRedefinedFeaturesOf))] internal static List ComputeAllRedefinedFeaturesOfOperation(this IType typeSubject, IMembership membership) { if (typeSubject == null) @@ -1070,6 +1100,7 @@ internal static List ComputeAllRedefinedFeaturesOfOperation(this IType /// /// The expected /// + [Operation(name: nameof(IType.DirectionOf))] internal static FeatureDirectionKind? ComputeDirectionOfOperation(this IType typeSubject, IFeature feature) { if (typeSubject == null) @@ -1122,6 +1153,7 @@ internal static List ComputeAllRedefinedFeaturesOfOperation(this IType /// /// The expected /// + [Operation(name: nameof(IType.DirectionOfExcluding))] internal static FeatureDirectionKind? ComputeDirectionOfExcludingOperation(this IType typeSubject, IFeature feature, List excluded) { if (typeSubject == null) @@ -1198,6 +1230,7 @@ internal static List ComputeAllRedefinedFeaturesOfOperation(this IType /// /// The expected collection of /// + [Operation(name: nameof(IType.Supertypes))] internal static List ComputeSupertypesOperation(this IType typeSubject, bool excludeImplied) { if (typeSubject == null) @@ -1235,6 +1268,7 @@ internal static List ComputeSupertypesOperation(this IType typeSubject, b /// /// The expected collection of /// + [Operation(name: nameof(IType.AllSupertypes))] internal static List ComputeAllSupertypesOperation(this IType typeSubject) { if (typeSubject == null) @@ -1283,6 +1317,7 @@ internal static List ComputeAllSupertypesOperation(this IType typeSubject /// /// The expected /// + [Operation(name: nameof(IType.Specializes))] internal static bool ComputeSpecializesOperation(this IType typeSubject, IType supertype) { if (typeSubject == null) @@ -1327,6 +1362,7 @@ internal static bool ComputeSpecializesOperation(this IType typeSubject, IType s /// /// The expected /// + [Operation(name: nameof(IType.SpecializesFromLibrary))] internal static bool ComputeSpecializesFromLibraryOperation(this IType typeSubject, string libraryTypeName) { if (typeSubject == null) @@ -1363,6 +1399,7 @@ internal static bool ComputeSpecializesFromLibraryOperation(this IType typeSubje /// /// The expected /// + [Operation(name: nameof(IType.IsCompatibleWith))] internal static bool ComputeIsCompatibleWithOperation(this IType typeSubject, IType otherType) { if (typeSubject == null) @@ -1399,6 +1436,7 @@ internal static bool ComputeIsCompatibleWithOperation(this IType typeSubject, IT /// /// The expected collection of /// + [Operation(name: nameof(IType.Multiplicities))] internal static List ComputeMultiplicitiesOperation(this IType typeSubject) { if (typeSubject == null) diff --git a/SysML2.NET/Extend/TypeFeaturingExtensions.cs b/SysML2.NET/Extend/TypeFeaturingExtensions.cs index c24de54a5..195a5defb 100644 --- a/SysML2.NET/Extend/TypeFeaturingExtensions.cs +++ b/SysML2.NET/Extend/TypeFeaturingExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Core.Features { using System; + using SysML2.NET.Decorators; + /// /// The class provides extensions methods for /// the interface @@ -37,6 +39,7 @@ internal static class TypeFeaturingExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(ITypeFeaturing.owningFeatureOfType))] internal static IFeature ComputeOwningFeatureOfType(this ITypeFeaturing typeFeaturingSubject) { return typeFeaturingSubject == null diff --git a/SysML2.NET/Extend/UnioningExtensions.cs b/SysML2.NET/Extend/UnioningExtensions.cs index fde283b28..6cd77e184 100644 --- a/SysML2.NET/Extend/UnioningExtensions.cs +++ b/SysML2.NET/Extend/UnioningExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Core.Types { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Exceptions; /// @@ -39,6 +41,7 @@ internal static class UnioningExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IUnioning.typeUnioned))] internal static IType ComputeTypeUnioned(this IUnioning unioningSubject) { if (unioningSubject == null) diff --git a/SysML2.NET/Extend/UsageExtensions.cs b/SysML2.NET/Extend/UsageExtensions.cs index e694d7ebb..039dc9b4c 100644 --- a/SysML2.NET/Extend/UsageExtensions.cs +++ b/SysML2.NET/Extend/UsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.DefinitionAndUsage using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Classifiers; using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Systems.Actions; @@ -63,6 +65,7 @@ internal static class UsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.definition))] internal static List ComputeDefinition(this IUsage usageSubject) { // Route through the shared static ComputeType (Pilot-style shared computation). @@ -89,6 +92,7 @@ internal static List ComputeDefinition(this IUsage usageSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.directedUsage))] internal static List ComputeDirectedUsage(this IUsage usageSubject) { return usageSubject == null @@ -111,6 +115,7 @@ internal static List ComputeDirectedUsage(this IUsage usageSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.isReference))] internal static bool ComputeIsReference(this IUsage usageSubject) { return !usageSubject?.IsComposite ?? throw new ArgumentNullException(nameof(usageSubject)); @@ -139,6 +144,7 @@ internal static bool ComputeIsReference(this IUsage usageSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.mayTimeVary))] internal static bool ComputeMayTimeVary(this IUsage usageSubject) { if (usageSubject == null) @@ -191,6 +197,7 @@ internal static bool ComputeMayTimeVary(this IUsage usageSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedAction))] internal static List ComputeNestedAction(this IUsage usageSubject) { return usageSubject == null @@ -213,6 +220,7 @@ internal static List ComputeNestedAction(this IUsage usageSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedAllocation))] internal static List ComputeNestedAllocation(this IUsage usageSubject) { return usageSubject == null @@ -235,6 +243,7 @@ internal static List ComputeNestedAllocation(this IUsage usage /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedAnalysisCase))] internal static List ComputeNestedAnalysisCase(this IUsage usageSubject) { return usageSubject == null @@ -257,6 +266,7 @@ internal static List ComputeNestedAnalysisCase(this IUsage u /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedAttribute))] internal static List ComputeNestedAttribute(this IUsage usageSubject) { return usageSubject == null @@ -279,6 +289,7 @@ internal static List ComputeNestedAttribute(this IUsage usageSu /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedCalculation))] internal static List ComputeNestedCalculation(this IUsage usageSubject) { return usageSubject == null @@ -301,6 +312,7 @@ internal static List ComputeNestedCalculation(this IUsage usa /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedCase))] internal static List ComputeNestedCase(this IUsage usageSubject) { return usageSubject == null @@ -323,6 +335,7 @@ internal static List ComputeNestedCase(this IUsage usageSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedConcern))] internal static List ComputeNestedConcern(this IUsage usageSubject) { return usageSubject == null @@ -345,6 +358,7 @@ internal static List ComputeNestedConcern(this IUsage usageSubjec /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedConnection))] internal static List ComputeNestedConnection(this IUsage usageSubject) { return usageSubject == null @@ -367,6 +381,7 @@ internal static List ComputeNestedConnection(this IUsage usag /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedConstraint))] internal static List ComputeNestedConstraint(this IUsage usageSubject) { return usageSubject == null @@ -389,6 +404,7 @@ internal static List ComputeNestedConstraint(this IUsage usage /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedEnumeration))] internal static List ComputeNestedEnumeration(this IUsage usageSubject) { return usageSubject == null @@ -411,6 +427,7 @@ internal static List ComputeNestedEnumeration(this IUsage usa /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedFlow))] internal static List ComputeNestedFlow(this IUsage usageSubject) { return usageSubject == null @@ -433,6 +450,7 @@ internal static List ComputeNestedFlow(this IUsage usageSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedInterface))] internal static List ComputeNestedInterface(this IUsage usageSubject) { return usageSubject == null @@ -455,6 +473,7 @@ internal static List ComputeNestedInterface(this IUsage usageSu /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedItem))] internal static List ComputeNestedItem(this IUsage usageSubject) { return usageSubject == null @@ -477,6 +496,7 @@ internal static List ComputeNestedItem(this IUsage usageSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedMetadata))] internal static List ComputeNestedMetadata(this IUsage usageSubject) { return usageSubject == null @@ -499,6 +519,7 @@ internal static List ComputeNestedMetadata(this IUsage usageSubj /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedOccurrence))] internal static List ComputeNestedOccurrence(this IUsage usageSubject) { return usageSubject == null @@ -521,6 +542,7 @@ internal static List ComputeNestedOccurrence(this IUsage usage /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedPart))] internal static List ComputeNestedPart(this IUsage usageSubject) { return usageSubject == null @@ -543,6 +565,7 @@ internal static List ComputeNestedPart(this IUsage usageSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedPort))] internal static List ComputeNestedPort(this IUsage usageSubject) { return usageSubject == null @@ -565,6 +588,7 @@ internal static List ComputeNestedPort(this IUsage usageSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedReference))] internal static List ComputeNestedReference(this IUsage usageSubject) { return usageSubject == null @@ -587,6 +611,7 @@ internal static List ComputeNestedReference(this IUsage usageSu /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedRendering))] internal static List ComputeNestedRendering(this IUsage usageSubject) { return usageSubject == null @@ -609,6 +634,7 @@ internal static List ComputeNestedRendering(this IUsage usageSu /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedRequirement))] internal static List ComputeNestedRequirement(this IUsage usageSubject) { return usageSubject == null @@ -631,6 +657,7 @@ internal static List ComputeNestedRequirement(this IUsage usa /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedState))] internal static List ComputeNestedState(this IUsage usageSubject) { return usageSubject == null @@ -653,6 +680,7 @@ internal static List ComputeNestedState(this IUsage usageSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedTransition))] internal static List ComputeNestedTransition(this IUsage usageSubject) { return usageSubject == null @@ -675,6 +703,7 @@ internal static List ComputeNestedTransition(this IUsage usage /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedUsage))] internal static List ComputeNestedUsage(this IUsage usageSubject) { return usageSubject == null @@ -697,6 +726,7 @@ internal static List ComputeNestedUsage(this IUsage usageSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedUseCase))] internal static List ComputeNestedUseCase(this IUsage usageSubject) { return usageSubject == null @@ -719,6 +749,7 @@ internal static List ComputeNestedUseCase(this IUsage usageSubjec /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedVerificationCase))] internal static List ComputeNestedVerificationCase(this IUsage usageSubject) { return usageSubject == null @@ -741,6 +772,7 @@ internal static List ComputeNestedVerificationCase(this /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedView))] internal static List ComputeNestedView(this IUsage usageSubject) { return usageSubject == null @@ -763,6 +795,7 @@ internal static List ComputeNestedView(this IUsage usageSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.nestedViewpoint))] internal static List ComputeNestedViewpoint(this IUsage usageSubject) { return usageSubject == null @@ -779,6 +812,7 @@ internal static List ComputeNestedViewpoint(this IUsage usageSu /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.owningDefinition))] internal static IDefinition ComputeOwningDefinition(this IUsage usageSubject) { return usageSubject == null @@ -795,6 +829,7 @@ internal static IDefinition ComputeOwningDefinition(this IUsage usageSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.owningUsage))] internal static IUsage ComputeOwningUsage(this IUsage usageSubject) { return usageSubject == null @@ -817,6 +852,7 @@ internal static IUsage ComputeOwningUsage(this IUsage usageSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.usage))] internal static List ComputeUsage(this IUsage usageSubject) { return usageSubject == null @@ -839,6 +875,7 @@ internal static List ComputeUsage(this IUsage usageSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.variant))] internal static List ComputeVariant(this IUsage usageSubject) { return usageSubject == null @@ -866,6 +903,7 @@ internal static List ComputeVariant(this IUsage usageSubject) /// /// the computed result /// + [DerivedProperty(name: nameof(IUsage.variantMembership))] internal static List ComputeVariantMembership(this IUsage usageSubject) { return usageSubject == null @@ -893,6 +931,7 @@ internal static List ComputeVariantMembership(this IUsage us /// /// The expected /// + [Operation(name: nameof(IUsage.NamingFeature))] internal static IFeature ComputeRedefinedNamingFeatureOperation(this IUsage usageSubject) { if (usageSubject == null) @@ -929,6 +968,7 @@ internal static IFeature ComputeRedefinedNamingFeatureOperation(this IUsage usag /// /// The expected /// + [Operation(name: nameof(IUsage.ReferencedFeatureTarget))] internal static IFeature ComputeReferencedFeatureTargetOperation(this IUsage usageSubject) { return usageSubject == null diff --git a/SysML2.NET/Extend/UseCaseDefinitionExtensions.cs b/SysML2.NET/Extend/UseCaseDefinitionExtensions.cs index ceb5102c9..6d04689c5 100644 --- a/SysML2.NET/Extend/UseCaseDefinitionExtensions.cs +++ b/SysML2.NET/Extend/UseCaseDefinitionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.UseCases using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Classifiers; @@ -79,6 +81,7 @@ internal static class UseCaseDefinitionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IUseCaseDefinition.includedUseCase))] internal static List ComputeIncludedUseCase(this IUseCaseDefinition useCaseDefinitionSubject) { return useCaseDefinitionSubject == null diff --git a/SysML2.NET/Extend/UseCaseUsageExtensions.cs b/SysML2.NET/Extend/UseCaseUsageExtensions.cs index 716ac37c4..19e5667b3 100644 --- a/SysML2.NET/Extend/UseCaseUsageExtensions.cs +++ b/SysML2.NET/Extend/UseCaseUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.UseCases using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -82,6 +84,7 @@ internal static class UseCaseUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IUseCaseUsage.includedUseCase))] internal static List ComputeIncludedUseCase(this IUseCaseUsage useCaseUsageSubject) { return useCaseUsageSubject == null @@ -100,6 +103,7 @@ internal static List ComputeIncludedUseCase(this IUseCaseUsage us /// /// the computed result /// + [DerivedProperty(name: nameof(IUseCaseUsage.useCaseDefinition))] internal static IUseCaseDefinition ComputeUseCaseDefinition(this IUseCaseUsage useCaseUsageSubject) { return useCaseUsageSubject == null diff --git a/SysML2.NET/Extend/VariantMembershipExtensions.cs b/SysML2.NET/Extend/VariantMembershipExtensions.cs index 2a665eae3..85b672672 100644 --- a/SysML2.NET/Extend/VariantMembershipExtensions.cs +++ b/SysML2.NET/Extend/VariantMembershipExtensions.cs @@ -22,6 +22,8 @@ namespace SysML2.NET.Core.POCO.Systems.DefinitionAndUsage { using System; + using SysML2.NET.Decorators; + using SysML2.NET.Extensions; /// @@ -39,6 +41,7 @@ internal static class VariantMembershipExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IVariantMembership.ownedVariantUsage))] internal static IUsage ComputeOwnedVariantUsage(this IVariantMembership variantMembershipSubject) { if (variantMembershipSubject == null) diff --git a/SysML2.NET/Extend/VerificationCaseDefinitionExtensions.cs b/SysML2.NET/Extend/VerificationCaseDefinitionExtensions.cs index b1d117835..c33d33032 100644 --- a/SysML2.NET/Extend/VerificationCaseDefinitionExtensions.cs +++ b/SysML2.NET/Extend/VerificationCaseDefinitionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.VerificationCases using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Classifiers; @@ -83,6 +85,7 @@ internal static class VerificationCaseDefinitionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IVerificationCaseDefinition.verifiedRequirement))] internal static List ComputeVerifiedRequirement(this IVerificationCaseDefinition verificationCaseDefinitionSubject) { if (verificationCaseDefinitionSubject == null) diff --git a/SysML2.NET/Extend/VerificationCaseUsageExtensions.cs b/SysML2.NET/Extend/VerificationCaseUsageExtensions.cs index e6308d693..756bbcd2b 100644 --- a/SysML2.NET/Extend/VerificationCaseUsageExtensions.cs +++ b/SysML2.NET/Extend/VerificationCaseUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.VerificationCases using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -85,6 +87,7 @@ internal static class VerificationCaseUsageExtensions /// (upper-bound violation against the derived /// [0..1] property). /// + [DerivedProperty(name: nameof(IVerificationCaseUsage.verificationCaseDefinition))] internal static IVerificationCaseDefinition ComputeVerificationCaseDefinition(this IVerificationCaseUsage verificationCaseUsageSubject) { return verificationCaseUsageSubject == null @@ -113,6 +116,7 @@ internal static IVerificationCaseDefinition ComputeVerificationCaseDefinition(th /// /// the computed result /// + [DerivedProperty(name: nameof(IVerificationCaseUsage.verifiedRequirement))] internal static List ComputeVerifiedRequirement(this IVerificationCaseUsage verificationCaseUsageSubject) { if (verificationCaseUsageSubject == null) diff --git a/SysML2.NET/Extend/ViewDefinitionExtensions.cs b/SysML2.NET/Extend/ViewDefinitionExtensions.cs index 733d91446..e233659b7 100644 --- a/SysML2.NET/Extend/ViewDefinitionExtensions.cs +++ b/SysML2.NET/Extend/ViewDefinitionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Views using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Classifiers; @@ -79,6 +81,7 @@ internal static class ViewDefinitionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IViewDefinition.satisfiedViewpoint))] internal static List ComputeSatisfiedViewpoint(this IViewDefinition viewDefinitionSubject) { return viewDefinitionSubject == null @@ -101,6 +104,7 @@ internal static List ComputeSatisfiedViewpoint(this IViewDefini /// /// the computed result /// + [DerivedProperty(name: nameof(IViewDefinition.view))] internal static List ComputeView(this IViewDefinition viewDefinitionSubject) { return viewDefinitionSubject == null @@ -125,6 +129,7 @@ internal static List ComputeView(this IViewDefinition viewDefinition /// /// the computed result /// + [DerivedProperty(name: nameof(IViewDefinition.viewCondition))] internal static List ComputeViewCondition(this IViewDefinition viewDefinitionSubject) { return viewDefinitionSubject == null @@ -157,6 +162,7 @@ internal static List ComputeViewCondition(this IViewDefinition view /// /// the computed result /// + [DerivedProperty(name: nameof(IViewDefinition.viewRendering))] internal static IRenderingUsage ComputeViewRendering(this IViewDefinition viewDefinitionSubject) { if (viewDefinitionSubject == null) diff --git a/SysML2.NET/Extend/ViewRenderingMembershipExtensions.cs b/SysML2.NET/Extend/ViewRenderingMembershipExtensions.cs index 7df536e6e..6083a0863 100644 --- a/SysML2.NET/Extend/ViewRenderingMembershipExtensions.cs +++ b/SysML2.NET/Extend/ViewRenderingMembershipExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Views using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Extensions; using SysML2.NET.Core.POCO.Core.Features; @@ -47,6 +49,7 @@ internal static class ViewRenderingMembershipExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IViewRenderingMembership.ownedRendering))] internal static IRenderingUsage ComputeOwnedRendering(this IViewRenderingMembership viewRenderingMembershipSubject) { if (viewRenderingMembershipSubject == null) @@ -79,6 +82,7 @@ internal static IRenderingUsage ComputeOwnedRendering(this IViewRenderingMembers /// /// the computed result /// + [DerivedProperty(name: nameof(IViewRenderingMembership.referencedRendering))] internal static IRenderingUsage ComputeReferencedRendering(this IViewRenderingMembership viewRenderingMembershipSubject) { if (viewRenderingMembershipSubject == null) diff --git a/SysML2.NET/Extend/ViewUsageExtensions.cs b/SysML2.NET/Extend/ViewUsageExtensions.cs index 2abaa6f7d..c6623accb 100644 --- a/SysML2.NET/Extend/ViewUsageExtensions.cs +++ b/SysML2.NET/Extend/ViewUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Views using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Core.Types; using SysML2.NET.Core.POCO.Kernel.Functions; @@ -59,6 +61,7 @@ internal static class ViewUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IViewUsage.exposedElement))] internal static List ComputeExposedElement(this IViewUsage viewUsageSubject) { return viewUsageSubject == null @@ -91,6 +94,7 @@ internal static List ComputeExposedElement(this IViewUsage viewUsageSu /// /// the computed result /// + [DerivedProperty(name: nameof(IViewUsage.satisfiedViewpoint))] internal static List ComputeSatisfiedViewpoint(this IViewUsage viewUsageSubject) { return viewUsageSubject == null @@ -115,6 +119,7 @@ internal static List ComputeSatisfiedViewpoint(this IViewUsage /// /// the computed result /// + [DerivedProperty(name: nameof(IViewUsage.viewCondition))] internal static List ComputeViewCondition(this IViewUsage viewUsageSubject) { return viewUsageSubject == null @@ -146,6 +151,7 @@ internal static List ComputeViewCondition(this IViewUsage viewUsage /// (upper-bound violation against the derived /// [0..1] property). /// + [DerivedProperty(name: nameof(IViewUsage.viewDefinition))] internal static IViewDefinition ComputeViewDefinition(this IViewUsage viewUsageSubject) { return viewUsageSubject is null ? throw new ArgumentNullException(nameof(viewUsageSubject)) : FeatureExtensions.ComputeType(viewUsageSubject).SingleOrDefaultStrict(nameof(viewUsageSubject)); @@ -171,6 +177,7 @@ internal static IViewDefinition ComputeViewDefinition(this IViewUsage viewUsageS /// /// the computed result /// + [DerivedProperty(name: nameof(IViewUsage.viewRendering))] internal static IRenderingUsage ComputeViewRendering(this IViewUsage viewUsageSubject) { if (viewUsageSubject == null) @@ -207,6 +214,7 @@ internal static IRenderingUsage ComputeViewRendering(this IViewUsage viewUsageSu /// /// The expected /// + [Operation(name: nameof(IViewUsage.IncludeAsExposed))] internal static bool ComputeIncludeAsExposedOperation(this IViewUsage viewUsageSubject, IElement element) { if (viewUsageSubject == null) diff --git a/SysML2.NET/Extend/ViewpointDefinitionExtensions.cs b/SysML2.NET/Extend/ViewpointDefinitionExtensions.cs index 127a26b10..911cb0674 100644 --- a/SysML2.NET/Extend/ViewpointDefinitionExtensions.cs +++ b/SysML2.NET/Extend/ViewpointDefinitionExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Views using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.POCO.Core.Classifiers; @@ -79,6 +81,7 @@ internal static class ViewpointDefinitionExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IViewpointDefinition.viewpointStakeholder))] internal static List ComputeViewpointStakeholder(this IViewpointDefinition viewpointDefinitionSubject) { // The OCL uses "featureMemberhsip" which is a typo in the XMI source; the correct C# property is featureMembership. diff --git a/SysML2.NET/Extend/ViewpointUsageExtensions.cs b/SysML2.NET/Extend/ViewpointUsageExtensions.cs index 68c3cf728..06652ebbd 100644 --- a/SysML2.NET/Extend/ViewpointUsageExtensions.cs +++ b/SysML2.NET/Extend/ViewpointUsageExtensions.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.Core.POCO.Systems.Views using System.Collections.Generic; using System.Linq; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -85,6 +87,7 @@ internal static class ViewpointUsageExtensions /// (upper-bound violation against the derived /// [0..1] property). /// + [DerivedProperty(name: nameof(IViewpointUsage.viewpointDefinition))] internal static IViewpointDefinition ComputeViewpointDefinition(this IViewpointUsage viewpointUsageSubject) { return viewpointUsageSubject == null @@ -109,6 +112,7 @@ internal static IViewpointDefinition ComputeViewpointDefinition(this IViewpointU /// /// the computed result /// + [DerivedProperty(name: nameof(IViewpointUsage.viewpointStakeholder))] internal static List ComputeViewpointStakeholder(this IViewpointUsage viewpointUsageSubject) { // The OCL uses "featureMemberhsip" which is a typo in the XMI source; the correct C# property is featureMembership. diff --git a/SysML2.NET/Extend/WhileLoopActionUsageExtensions.cs b/SysML2.NET/Extend/WhileLoopActionUsageExtensions.cs index 7ad13bd7b..233aeb1ed 100644 --- a/SysML2.NET/Extend/WhileLoopActionUsageExtensions.cs +++ b/SysML2.NET/Extend/WhileLoopActionUsageExtensions.cs @@ -23,6 +23,8 @@ namespace SysML2.NET.Core.POCO.Systems.Actions using System; using System.Collections.Generic; + using SysML2.NET.Decorators; + using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.Root.Namespaces; using SysML2.NET.Core.Systems.Occurrences; @@ -84,6 +86,7 @@ internal static class WhileLoopActionUsageExtensions /// /// the computed result /// + [DerivedProperty(name: nameof(IWhileLoopActionUsage.untilArgument))] internal static IExpression ComputeUntilArgument(this IWhileLoopActionUsage whileLoopActionUsageSubject) { return whileLoopActionUsageSubject == null @@ -112,6 +115,7 @@ internal static IExpression ComputeUntilArgument(this IWhileLoopActionUsage whil /// /// the computed result /// + [DerivedProperty(name: nameof(IWhileLoopActionUsage.whileArgument))] internal static IExpression ComputeWhileArgument(this IWhileLoopActionUsage whileLoopActionUsageSubject) { return whileLoopActionUsageSubject == null