From f4231c2487d045563b760f8b649f8c2e161b4092 Mon Sep 17 00:00:00 2001 From: Alexander van Delft <56023674+lxatrhea@users.noreply.github.com> Date: Fri, 8 Dec 2023 14:18:23 +0100 Subject: [PATCH] [ADD] Instance version checks for Annex.C3 file export; fixes #281 * [ADD] Instance version checks for Annex.C3 file export * Add reference to github ticket * Version bump --- CDP4Common/AutoGenDto/ActionItem.cs | 139 ++++++++- CDP4Common/AutoGenDto/ActualFiniteState.cs | 74 ++++- .../AutoGenDto/ActualFiniteStateList.cs | 88 +++++- CDP4Common/AutoGenDto/Alias.cs | 64 +++- CDP4Common/AutoGenDto/AndExpression.cs | 74 ++++- CDP4Common/AutoGenDto/Approval.cs | 88 +++++- CDP4Common/AutoGenDto/ArrayParameterType.cs | 88 +++++- CDP4Common/AutoGenDto/BinaryNote.cs | 94 +++++- CDP4Common/AutoGenDto/BinaryRelationship.cs | 112 ++++++- .../AutoGenDto/BinaryRelationshipRule.cs | 118 +++++++- CDP4Common/AutoGenDto/Book.cs | 82 ++++- CDP4Common/AutoGenDto/BooleanExpression.cs | 64 +++- CDP4Common/AutoGenDto/BooleanParameterType.cs | 88 +++++- CDP4Common/AutoGenDto/Bounds.cs | 64 +++- .../AutoGenDto/BuiltInRuleVerification.cs | 64 +++- CDP4Common/AutoGenDto/Category.cs | 88 +++++- CDP4Common/AutoGenDto/ChangeProposal.cs | 139 ++++++++- CDP4Common/AutoGenDto/ChangeRequest.cs | 127 +++++++- CDP4Common/AutoGenDto/Citation.cs | 76 ++++- CDP4Common/AutoGenDto/Color.cs | 64 +++- CDP4Common/AutoGenDto/CommonFileStore.cs | 88 +++++- .../AutoGenDto/CompoundParameterType.cs | 88 +++++- CDP4Common/AutoGenDto/Constant.cs | 109 ++++++- CDP4Common/AutoGenDto/ContractChangeNotice.cs | 139 ++++++++- CDP4Common/AutoGenDto/ContractDeviation.cs | 127 +++++++- CDP4Common/AutoGenDto/ConversionBasedUnit.cs | 94 +++++- CDP4Common/AutoGenDto/CyclicRatioScale.cs | 106 ++++++- CDP4Common/AutoGenDto/DateParameterType.cs | 88 +++++- .../AutoGenDto/DateTimeParameterType.cs | 88 +++++- CDP4Common/AutoGenDto/DecompositionRule.cs | 104 ++++++- CDP4Common/AutoGenDto/DefinedThing.cs | 82 ++++- CDP4Common/AutoGenDto/Definition.cs | 70 ++++- .../DependentParameterTypeAssignment.cs | 85 +++++- CDP4Common/AutoGenDto/DerivedQuantityKind.cs | 106 ++++++- CDP4Common/AutoGenDto/DerivedUnit.cs | 82 ++++- CDP4Common/AutoGenDto/DiagramCanvas.cs | 76 ++++- CDP4Common/AutoGenDto/DiagramEdge.cs | 124 +++++++- .../AutoGenDto/DiagramElementContainer.cs | 76 ++++- CDP4Common/AutoGenDto/DiagramElementThing.cs | 100 ++++++- CDP4Common/AutoGenDto/DiagramObject.cs | 100 ++++++- CDP4Common/AutoGenDto/DiagramShape.cs | 100 ++++++- CDP4Common/AutoGenDto/DiagramThingBase.cs | 64 +++- CDP4Common/AutoGenDto/DiagrammingStyle.cs | 97 +++++- CDP4Common/AutoGenDto/DiscussionItem.cs | 73 ++++- CDP4Common/AutoGenDto/DomainFileStore.cs | 88 +++++- CDP4Common/AutoGenDto/DomainOfExpertise.cs | 88 +++++- .../AutoGenDto/DomainOfExpertiseGroup.cs | 88 +++++- CDP4Common/AutoGenDto/ElementBase.cs | 100 ++++++- CDP4Common/AutoGenDto/ElementDefinition.cs | 130 +++++++- CDP4Common/AutoGenDto/ElementUsage.cs | 124 +++++++- CDP4Common/AutoGenDto/EmailAddress.cs | 64 +++- CDP4Common/AutoGenDto/EngineeringModel.cs | 110 ++++++- .../EngineeringModelDataAnnotation.cs | 97 +++++- .../EngineeringModelDataDiscussionItem.cs | 85 +++++- .../AutoGenDto/EngineeringModelDataNote.cs | 97 +++++- .../AutoGenDto/EngineeringModelSetup.cs | 137 ++++++++- .../AutoGenDto/EnumerationParameterType.cs | 88 +++++- .../AutoGenDto/EnumerationValueDefinition.cs | 82 ++++- .../AutoGenDto/ExclusiveOrExpression.cs | 74 ++++- .../AutoGenDto/ExternalIdentifierMap.cs | 91 +++++- CDP4Common/AutoGenDto/File.cs | 101 ++++++- CDP4Common/AutoGenDto/FileRevision.cs | 85 +++++- CDP4Common/AutoGenDto/FileStore.cs | 88 +++++- CDP4Common/AutoGenDto/FileType.cs | 88 +++++- CDP4Common/AutoGenDto/Folder.cs | 97 +++++- CDP4Common/AutoGenDto/GenericAnnotation.cs | 64 +++- CDP4Common/AutoGenDto/Glossary.cs | 94 +++++- CDP4Common/AutoGenDto/Goal.cs | 88 +++++- CDP4Common/AutoGenDto/HyperLink.cs | 64 +++- CDP4Common/AutoGenDto/IAnnotation.cs | 19 +- CDP4Common/AutoGenDto/ICategorizableThing.cs | 19 +- CDP4Common/AutoGenDto/IDeprecatableThing.cs | 19 +- CDP4Common/AutoGenDto/ILogEntry.cs | 19 +- CDP4Common/AutoGenDto/INamedThing.cs | 19 +- .../AutoGenDto/IOptionDependentThing.cs | 19 +- CDP4Common/AutoGenDto/IOwnedThing.cs | 19 +- .../AutoGenDto/IParameterTypeAssignment.cs | 19 +- .../IParticipantAffectedAccessThing.cs | 19 +- CDP4Common/AutoGenDto/IShortNamedThing.cs | 19 +- CDP4Common/AutoGenDto/ITimeStampedThing.cs | 19 +- CDP4Common/AutoGenDto/IVolatileThing.cs | 19 +- CDP4Common/AutoGenDto/IdCorrespondence.cs | 64 +++- .../IndependentParameterTypeAssignment.cs | 85 +++++- CDP4Common/AutoGenDto/IntervalScale.cs | 106 ++++++- CDP4Common/AutoGenDto/Iteration.cs | 190 +++++++++++- CDP4Common/AutoGenDto/IterationSetup.cs | 73 ++++- CDP4Common/AutoGenDto/LinearConversionUnit.cs | 94 +++++- .../AutoGenDto/LogEntryChangelogItem.cs | 64 +++- CDP4Common/AutoGenDto/LogarithmicScale.cs | 124 +++++++- .../AutoGenDto/MappingToReferenceScale.cs | 88 +++++- CDP4Common/AutoGenDto/MeasurementScale.cs | 106 ++++++- CDP4Common/AutoGenDto/MeasurementUnit.cs | 82 ++++- CDP4Common/AutoGenDto/ModelLogEntry.cs | 85 +++++- .../AutoGenDto/ModelReferenceDataLibrary.cs | 157 +++++++++- .../AutoGenDto/ModellingAnnotationItem.cs | 127 +++++++- .../AutoGenDto/ModellingThingReference.cs | 76 ++++- CDP4Common/AutoGenDto/MultiRelationship.cs | 94 +++++- .../AutoGenDto/MultiRelationshipRule.cs | 104 ++++++- CDP4Common/AutoGenDto/NaturalLanguage.cs | 64 +++- CDP4Common/AutoGenDto/NestedElement.cs | 82 ++++- CDP4Common/AutoGenDto/NestedParameter.cs | 97 +++++- CDP4Common/AutoGenDto/NotExpression.cs | 76 ++++- CDP4Common/AutoGenDto/Note.cs | 82 ++++- CDP4Common/AutoGenDto/Option.cs | 94 +++++- CDP4Common/AutoGenDto/OrExpression.cs | 74 ++++- CDP4Common/AutoGenDto/OrdinalScale.cs | 106 ++++++- CDP4Common/AutoGenDto/Organization.cs | 64 +++- .../AutoGenDto/OrganizationalParticipant.cs | 76 ++++- CDP4Common/AutoGenDto/OwnedStyle.cs | 97 +++++- CDP4Common/AutoGenDto/Page.cs | 82 ++++- CDP4Common/AutoGenDto/Parameter.cs | 140 ++++++++- CDP4Common/AutoGenDto/ParameterBase.cs | 115 ++++++- CDP4Common/AutoGenDto/ParameterGroup.cs | 73 ++++- .../AutoGenDto/ParameterOrOverrideBase.cs | 121 +++++++- CDP4Common/AutoGenDto/ParameterOverride.cs | 104 ++++++- .../AutoGenDto/ParameterOverrideValueSet.cs | 76 ++++- .../AutoGenDto/ParameterSubscription.cs | 86 +++++- .../ParameterSubscriptionValueSet.cs | 76 ++++- CDP4Common/AutoGenDto/ParameterType.cs | 88 +++++- .../AutoGenDto/ParameterTypeComponent.cs | 85 +++++- CDP4Common/AutoGenDto/ParameterValue.cs | 85 +++++- CDP4Common/AutoGenDto/ParameterValueSet.cs | 82 ++++- .../AutoGenDto/ParameterValueSetBase.cs | 82 ++++- .../AutoGenDto/ParameterizedCategoryRule.cs | 104 ++++++- CDP4Common/AutoGenDto/ParametricConstraint.cs | 83 +++++- CDP4Common/AutoGenDto/Participant.cs | 110 ++++++- .../AutoGenDto/ParticipantPermission.cs | 64 +++- CDP4Common/AutoGenDto/ParticipantRole.cs | 88 +++++- CDP4Common/AutoGenDto/Person.cs | 127 +++++++- CDP4Common/AutoGenDto/PersonPermission.cs | 64 +++- CDP4Common/AutoGenDto/PersonRole.cs | 88 +++++- CDP4Common/AutoGenDto/Point.cs | 64 +++- CDP4Common/AutoGenDto/PossibleFiniteState.cs | 82 ++++- .../AutoGenDto/PossibleFiniteStateList.cs | 109 ++++++- CDP4Common/AutoGenDto/PrefixedUnit.cs | 106 ++++++- CDP4Common/AutoGenDto/Publication.cs | 76 ++++- CDP4Common/AutoGenDto/QuantityKind.cs | 106 ++++++- CDP4Common/AutoGenDto/QuantityKindFactor.cs | 76 ++++- CDP4Common/AutoGenDto/RatioScale.cs | 106 ++++++- CDP4Common/AutoGenDto/ReferenceDataLibrary.cs | 157 +++++++++- CDP4Common/AutoGenDto/ReferenceSource.cs | 106 ++++++- CDP4Common/AutoGenDto/ReferencerRule.cs | 104 ++++++- CDP4Common/AutoGenDto/RelationalExpression.cs | 85 +++++- CDP4Common/AutoGenDto/Relationship.cs | 88 +++++- .../AutoGenDto/RelationshipParameterValue.cs | 85 +++++- CDP4Common/AutoGenDto/RequestForDeviation.cs | 127 +++++++- CDP4Common/AutoGenDto/RequestForWaiver.cs | 127 +++++++- CDP4Common/AutoGenDto/Requirement.cs | 115 ++++++- .../AutoGenDto/RequirementsContainer.cs | 112 ++++++- .../RequirementsContainerParameterValue.cs | 85 +++++- CDP4Common/AutoGenDto/RequirementsGroup.cs | 112 ++++++- .../AutoGenDto/RequirementsSpecification.cs | 118 +++++++- .../AutoGenDto/ReviewItemDiscrepancy.cs | 133 ++++++++- CDP4Common/AutoGenDto/Rule.cs | 82 ++++- CDP4Common/AutoGenDto/RuleVerification.cs | 64 +++- CDP4Common/AutoGenDto/RuleVerificationList.cs | 94 +++++- CDP4Common/AutoGenDto/RuleViolation.cs | 64 +++- .../SampledFunctionParameterType.cs | 88 +++++- CDP4Common/AutoGenDto/ScalarParameterType.cs | 88 +++++- .../AutoGenDto/ScaleReferenceQuantityValue.cs | 76 ++++- CDP4Common/AutoGenDto/ScaleValueDefinition.cs | 82 ++++- CDP4Common/AutoGenDto/Section.cs | 82 ++++- CDP4Common/AutoGenDto/SharedStyle.cs | 97 +++++- CDP4Common/AutoGenDto/SimpleParameterValue.cs | 85 +++++- .../AutoGenDto/SimpleParameterizableThing.cs | 100 ++++++- CDP4Common/AutoGenDto/SimpleQuantityKind.cs | 106 ++++++- CDP4Common/AutoGenDto/SimpleUnit.cs | 82 ++++- CDP4Common/AutoGenDto/SiteDirectory.cs | 148 ++++++++- .../AutoGenDto/SiteDirectoryDataAnnotation.cs | 104 ++++++- .../SiteDirectoryDataDiscussionItem.cs | 85 +++++- .../AutoGenDto/SiteDirectoryThingReference.cs | 76 ++++- CDP4Common/AutoGenDto/SiteLogEntry.cs | 85 +++++- .../AutoGenDto/SiteReferenceDataLibrary.cs | 157 +++++++++- CDP4Common/AutoGenDto/Solution.cs | 88 +++++- .../AutoGenDto/SpecializedQuantityKind.cs | 118 +++++++- CDP4Common/AutoGenDto/StakeHolderValueMap.cs | 122 +++++++- .../AutoGenDto/StakeHolderValueMapSettings.cs | 91 +++++- CDP4Common/AutoGenDto/Stakeholder.cs | 94 +++++- CDP4Common/AutoGenDto/StakeholderValue.cs | 88 +++++- CDP4Common/AutoGenDto/TelephoneNumber.cs | 64 +++- CDP4Common/AutoGenDto/Term.cs | 82 ++++- CDP4Common/AutoGenDto/TextParameterType.cs | 88 +++++- CDP4Common/AutoGenDto/TextualNote.cs | 82 ++++- CDP4Common/AutoGenDto/ThingReference.cs | 76 ++++- .../AutoGenDto/TimeOfDayParameterType.cs | 88 +++++- CDP4Common/AutoGenDto/TopContainer.cs | 64 +++- CDP4Common/AutoGenDto/UnitFactor.cs | 76 ++++- CDP4Common/AutoGenDto/UnitPrefix.cs | 82 ++++- CDP4Common/AutoGenDto/UserPreference.cs | 64 +++- CDP4Common/AutoGenDto/UserRuleVerification.cs | 76 ++++- CDP4Common/AutoGenDto/ValueGroup.cs | 88 +++++- CDP4Common/AutoGenPoco/ActionItem.cs | 100 ++++++- CDP4Common/AutoGenPoco/ActualFiniteState.cs | 52 +++- .../AutoGenPoco/ActualFiniteStateKind.cs | 11 +- .../AutoGenPoco/ActualFiniteStateList.cs | 67 ++++- CDP4Common/AutoGenPoco/Alias.cs | 50 +++- CDP4Common/AutoGenPoco/AndExpression.cs | 52 +++- .../AutoGenPoco/AnnotationApprovalKind.cs | 11 +- .../AnnotationClassificationKind.cs | 11 +- .../AutoGenPoco/AnnotationStatusKind.cs | 11 +- CDP4Common/AutoGenPoco/Approval.cs | 73 ++++- CDP4Common/AutoGenPoco/ArrayParameterType.cs | 60 +++- CDP4Common/AutoGenPoco/BinaryNote.cs | 75 ++++- CDP4Common/AutoGenPoco/BinaryRelationship.cs | 89 +++++- .../AutoGenPoco/BinaryRelationshipRule.cs | 91 +++++- CDP4Common/AutoGenPoco/Book.cs | 65 +++- CDP4Common/AutoGenPoco/BooleanExpression.cs | 50 +++- CDP4Common/AutoGenPoco/BooleanOperatorKind.cs | 11 +- .../AutoGenPoco/BooleanParameterType.cs | 58 +++- CDP4Common/AutoGenPoco/Bounds.cs | 50 +++- .../AutoGenPoco/BuiltInRuleVerification.cs | 50 +++- CDP4Common/AutoGenPoco/Category.cs | 58 +++- CDP4Common/AutoGenPoco/ChangeProposal.cs | 100 ++++++- CDP4Common/AutoGenPoco/ChangeRequest.cs | 88 +++++- CDP4Common/AutoGenPoco/Citation.cs | 61 +++- CDP4Common/AutoGenPoco/ClassKind.cs | 11 +- CDP4Common/AutoGenPoco/Color.cs | 50 +++- CDP4Common/AutoGenPoco/CommonFileStore.cs | 65 +++- .../AutoGenPoco/CompoundParameterType.cs | 60 +++- CDP4Common/AutoGenPoco/Constant.cs | 74 ++++- .../AutoGenPoco/ContractChangeNotice.cs | 100 ++++++- CDP4Common/AutoGenPoco/ContractDeviation.cs | 88 +++++- CDP4Common/AutoGenPoco/ConversionBasedUnit.cs | 67 ++++- CDP4Common/AutoGenPoco/CyclicRatioScale.cs | 71 ++++- CDP4Common/AutoGenPoco/DateParameterType.cs | 58 +++- .../AutoGenPoco/DateTimeParameterType.cs | 58 +++- CDP4Common/AutoGenPoco/DecompositionRule.cs | 69 ++++- CDP4Common/AutoGenPoco/DefinedThing.cs | 56 +++- CDP4Common/AutoGenPoco/Definition.cs | 52 +++- .../DependentParameterTypeAssignment.cs | 66 ++++- CDP4Common/AutoGenPoco/DerivedQuantityKind.cs | 73 ++++- CDP4Common/AutoGenPoco/DerivedUnit.cs | 58 +++- CDP4Common/AutoGenPoco/DiagramCanvas.cs | 54 +++- CDP4Common/AutoGenPoco/DiagramEdge.cs | 91 +++++- .../AutoGenPoco/DiagramElementContainer.cs | 54 +++- CDP4Common/AutoGenPoco/DiagramElementThing.cs | 66 ++++- CDP4Common/AutoGenPoco/DiagramObject.cs | 66 ++++- CDP4Common/AutoGenPoco/DiagramShape.cs | 66 ++++- CDP4Common/AutoGenPoco/DiagramThingBase.cs | 50 +++- CDP4Common/AutoGenPoco/DiagrammingStyle.cs | 67 ++++- CDP4Common/AutoGenPoco/DiscussionItem.cs | 55 +++- CDP4Common/AutoGenPoco/DomainFileStore.cs | 65 +++- CDP4Common/AutoGenPoco/DomainOfExpertise.cs | 58 +++- .../AutoGenPoco/DomainOfExpertiseGroup.cs | 58 +++- CDP4Common/AutoGenPoco/ElementBase.cs | 69 ++++- CDP4Common/AutoGenPoco/ElementDefinition.cs | 79 ++++- CDP4Common/AutoGenPoco/ElementUsage.cs | 85 +++++- CDP4Common/AutoGenPoco/EmailAddress.cs | 50 +++- CDP4Common/AutoGenPoco/EngineeringModel.cs | 73 ++++- .../EngineeringModelDataAnnotation.cs | 70 ++++- .../EngineeringModelDataDiscussionItem.cs | 66 ++++- .../AutoGenPoco/EngineeringModelDataNote.cs | 70 ++++- .../AutoGenPoco/EngineeringModelKind.cs | 11 +- .../AutoGenPoco/EngineeringModelSetup.cs | 77 ++++- .../AutoGenPoco/EnumerationParameterType.cs | 60 +++- .../AutoGenPoco/EnumerationValueDefinition.cs | 56 +++- .../AutoGenPoco/ExclusiveOrExpression.cs | 52 +++- .../AutoGenPoco/ExternalIdentifierMap.cs | 68 ++++- CDP4Common/AutoGenPoco/File.cs | 70 ++++- CDP4Common/AutoGenPoco/FileRevision.cs | 68 ++++- CDP4Common/AutoGenPoco/FileStore.cs | 65 +++- CDP4Common/AutoGenPoco/FileType.cs | 58 +++- CDP4Common/AutoGenPoco/Folder.cs | 78 ++++- CDP4Common/AutoGenPoco/GenericAnnotation.cs | 50 +++- CDP4Common/AutoGenPoco/Glossary.cs | 60 +++- CDP4Common/AutoGenPoco/Goal.cs | 58 +++- CDP4Common/AutoGenPoco/HyperLink.cs | 50 +++- CDP4Common/AutoGenPoco/IAnnotation.cs | 11 +- CDP4Common/AutoGenPoco/ICategorizableThing.cs | 11 +- CDP4Common/AutoGenPoco/IDeprecatableThing.cs | 11 +- CDP4Common/AutoGenPoco/ILogEntry.cs | 11 +- CDP4Common/AutoGenPoco/INamedThing.cs | 11 +- .../AutoGenPoco/IOptionDependentThing.cs | 11 +- CDP4Common/AutoGenPoco/IOwnedThing.cs | 11 +- .../AutoGenPoco/IParameterTypeAssignment.cs | 11 +- .../IParticipantAffectedAccessThing.cs | 11 +- CDP4Common/AutoGenPoco/IShortNamedThing.cs | 11 +- CDP4Common/AutoGenPoco/ITimeStampedThing.cs | 11 +- CDP4Common/AutoGenPoco/IVolatileThing.cs | 11 +- CDP4Common/AutoGenPoco/IdCorrespondence.cs | 50 +++- .../IndependentParameterTypeAssignment.cs | 66 ++++- CDP4Common/AutoGenPoco/InterfaceEndKind.cs | 11 +- CDP4Common/AutoGenPoco/IntervalScale.cs | 71 ++++- CDP4Common/AutoGenPoco/Iteration.cs | 105 ++++++- CDP4Common/AutoGenPoco/IterationSetup.cs | 55 +++- .../AutoGenPoco/LinearConversionUnit.cs | 67 ++++- .../AutoGenPoco/LogEntryChangelogItem.cs | 50 +++- .../AutoGenPoco/LogEntryChangelogItemKind.cs | 11 +- CDP4Common/AutoGenPoco/LogLevelKind.cs | 11 +- CDP4Common/AutoGenPoco/LogarithmBaseKind.cs | 11 +- CDP4Common/AutoGenPoco/LogarithmicScale.cs | 85 +++++- .../AutoGenPoco/MappingToReferenceScale.cs | 73 ++++- CDP4Common/AutoGenPoco/MeasurementScale.cs | 71 ++++- CDP4Common/AutoGenPoco/MeasurementUnit.cs | 56 +++- CDP4Common/AutoGenPoco/ModelLogEntry.cs | 59 +++- .../AutoGenPoco/ModelReferenceDataLibrary.cs | 85 +++++- .../AutoGenPoco/ModellingAnnotationItem.cs | 88 +++++- .../AutoGenPoco/ModellingThingReference.cs | 61 +++- CDP4Common/AutoGenPoco/MultiRelationship.cs | 67 ++++- .../AutoGenPoco/MultiRelationshipRule.cs | 69 ++++- CDP4Common/AutoGenPoco/NaturalLanguage.cs | 50 +++- CDP4Common/AutoGenPoco/NestedElement.cs | 65 +++- CDP4Common/AutoGenPoco/NestedParameter.cs | 78 ++++- CDP4Common/AutoGenPoco/NotExpression.cs | 61 +++- CDP4Common/AutoGenPoco/Note.cs | 63 +++- CDP4Common/AutoGenPoco/NumberSetKind.cs | 11 +- CDP4Common/AutoGenPoco/Option.cs | 60 +++- CDP4Common/AutoGenPoco/OrExpression.cs | 52 +++- CDP4Common/AutoGenPoco/OrdinalScale.cs | 71 ++++- CDP4Common/AutoGenPoco/Organization.cs | 50 +++- .../AutoGenPoco/OrganizationalParticipant.cs | 61 +++- CDP4Common/AutoGenPoco/OwnedStyle.cs | 67 ++++- CDP4Common/AutoGenPoco/Page.cs | 65 +++- CDP4Common/AutoGenPoco/Parameter.cs | 97 +++++- CDP4Common/AutoGenPoco/ParameterBase.cs | 88 +++++- CDP4Common/AutoGenPoco/ParameterGroup.cs | 55 +++- .../AutoGenPoco/ParameterOrOverrideBase.cs | 90 +++++- CDP4Common/AutoGenPoco/ParameterOverride.cs | 77 ++++- .../AutoGenPoco/ParameterOverrideValueSet.cs | 61 +++- .../AutoGenPoco/ParameterSubscription.cs | 63 +++- .../ParameterSubscriptionValueSet.cs | 61 +++- CDP4Common/AutoGenPoco/ParameterSwitchKind.cs | 11 +- CDP4Common/AutoGenPoco/ParameterType.cs | 58 +++- .../AutoGenPoco/ParameterTypeComponent.cs | 66 ++++- CDP4Common/AutoGenPoco/ParameterValue.cs | 66 ++++- CDP4Common/AutoGenPoco/ParameterValueSet.cs | 60 +++- .../AutoGenPoco/ParameterValueSetBase.cs | 60 +++- .../AutoGenPoco/ParameterizedCategoryRule.cs | 69 ++++- .../AutoGenPoco/ParametricConstraint.cs | 57 +++- CDP4Common/AutoGenPoco/Participant.cs | 87 +++++- .../AutoGenPoco/ParticipantAccessRightKind.cs | 11 +- .../AutoGenPoco/ParticipantPermission.cs | 50 +++- CDP4Common/AutoGenPoco/ParticipantRole.cs | 58 +++- CDP4Common/AutoGenPoco/Person.cs | 81 ++++- .../AutoGenPoco/PersonAccessRightKind.cs | 11 +- CDP4Common/AutoGenPoco/PersonPermission.cs | 50 +++- CDP4Common/AutoGenPoco/PersonRole.cs | 58 +++- CDP4Common/AutoGenPoco/Point.cs | 50 +++- CDP4Common/AutoGenPoco/PossibleFiniteState.cs | 56 +++- .../AutoGenPoco/PossibleFiniteStateList.cs | 76 ++++- CDP4Common/AutoGenPoco/PrefixedUnit.cs | 79 ++++- CDP4Common/AutoGenPoco/Publication.cs | 54 +++- CDP4Common/AutoGenPoco/QuantityKind.cs | 71 ++++- CDP4Common/AutoGenPoco/QuantityKindFactor.cs | 61 +++- CDP4Common/AutoGenPoco/RatioScale.cs | 71 ++++- .../AutoGenPoco/ReferenceDataLibrary.cs | 85 +++++- CDP4Common/AutoGenPoco/ReferenceSource.cs | 68 ++++- CDP4Common/AutoGenPoco/ReferencerRule.cs | 69 ++++- .../AutoGenPoco/RelationalExpression.cs | 66 ++++- .../AutoGenPoco/RelationalOperatorKind.cs | 11 +- CDP4Common/AutoGenPoco/Relationship.cs | 65 +++- .../AutoGenPoco/RelationshipParameterValue.cs | 66 ++++- CDP4Common/AutoGenPoco/RequestForDeviation.cs | 88 +++++- CDP4Common/AutoGenPoco/RequestForWaiver.cs | 88 +++++- CDP4Common/AutoGenPoco/Requirement.cs | 78 ++++- .../AutoGenPoco/RequirementsContainer.cs | 73 ++++- .../RequirementsContainerParameterValue.cs | 66 ++++- CDP4Common/AutoGenPoco/RequirementsGroup.cs | 73 ++++- .../AutoGenPoco/RequirementsSpecification.cs | 75 ++++- .../AutoGenPoco/ReviewItemDiscrepancy.cs | 90 +++++- CDP4Common/AutoGenPoco/Rule.cs | 56 +++- CDP4Common/AutoGenPoco/RuleVerification.cs | 50 +++- .../AutoGenPoco/RuleVerificationList.cs | 69 ++++- .../AutoGenPoco/RuleVerificationStatusKind.cs | 11 +- CDP4Common/AutoGenPoco/RuleViolation.cs | 50 +++- .../SampledFunctionParameterType.cs | 62 +++- CDP4Common/AutoGenPoco/ScalarParameterType.cs | 58 +++- .../ScaleReferenceQuantityValue.cs | 61 +++- .../AutoGenPoco/ScaleValueDefinition.cs | 56 +++- CDP4Common/AutoGenPoco/Section.cs | 65 +++- CDP4Common/AutoGenPoco/SharedStyle.cs | 67 ++++- .../AutoGenPoco/SimpleParameterValue.cs | 66 ++++- .../AutoGenPoco/SimpleParameterizableThing.cs | 69 ++++- CDP4Common/AutoGenPoco/SimpleQuantityKind.cs | 71 ++++- CDP4Common/AutoGenPoco/SimpleUnit.cs | 56 +++- CDP4Common/AutoGenPoco/SiteDirectory.cs | 82 ++++- .../SiteDirectoryDataAnnotation.cs | 77 ++++- .../SiteDirectoryDataDiscussionItem.cs | 66 ++++- .../SiteDirectoryThingReference.cs | 61 +++- CDP4Common/AutoGenPoco/SiteLogEntry.cs | 59 +++- .../AutoGenPoco/SiteReferenceDataLibrary.cs | 85 +++++- CDP4Common/AutoGenPoco/Solution.cs | 73 ++++- .../AutoGenPoco/SpecializedQuantityKind.cs | 83 +++++- CDP4Common/AutoGenPoco/StakeHolderValueMap.cs | 74 ++++- .../StakeHolderValueMapSettings.cs | 65 +++- CDP4Common/AutoGenPoco/Stakeholder.cs | 60 +++- CDP4Common/AutoGenPoco/StakeholderValue.cs | 58 +++- CDP4Common/AutoGenPoco/StudyPhaseKind.cs | 11 +- CDP4Common/AutoGenPoco/TelephoneNumber.cs | 50 +++- CDP4Common/AutoGenPoco/Term.cs | 56 +++- CDP4Common/AutoGenPoco/TextParameterType.cs | 58 +++- CDP4Common/AutoGenPoco/TextualNote.cs | 63 +++- CDP4Common/AutoGenPoco/ThingReference.cs | 61 +++- .../AutoGenPoco/TimeOfDayParameterType.cs | 58 +++- CDP4Common/AutoGenPoco/TopContainer.cs | 50 +++- CDP4Common/AutoGenPoco/UnitFactor.cs | 61 +++- CDP4Common/AutoGenPoco/UnitPrefix.cs | 56 +++- CDP4Common/AutoGenPoco/UserPreference.cs | 50 +++- .../AutoGenPoco/UserRuleVerification.cs | 61 +++- CDP4Common/AutoGenPoco/ValueGroup.cs | 58 +++- .../AutoGenPoco/VcardEmailAddressKind.cs | 11 +- .../AutoGenPoco/VcardTelephoneNumberKind.cs | 11 +- CDP4Common/CDP4Common.csproj | 4 +- CDP4Common/Dto/Thing.cs | 39 ++- CDP4Common/Poco/Thing.cs | 19 ++ CDP4Dal/CDP4Dal.csproj | 4 +- .../JsonFileDalTestFixture.cs | 280 ++++++++++++++---- .../JsonFileDalTestFixture.cs | 219 ++++++++++++-- CDP4JsonFileDal/CDP4JsonFileDal.csproj | 4 +- CDP4JsonFileDal/JsonFileDal.cs | 237 +++++++++++---- CDP4JsonSerializer/CDP4JsonSerializer.csproj | 4 +- .../CDP4MessagePackSerializer.csproj | 4 +- CDP4Reporting/CDP4Reporting.csproj | 4 +- .../CDP4RequirementsVerification.csproj | 4 +- CDP4Rules/CDP4Rules.csproj | 2 +- CDP4ServicesDal/CDP4ServicesDal.csproj | 4 +- CDP4WspDal/CDP4WspDal.csproj | 4 +- 417 files changed, 27743 insertions(+), 2169 deletions(-) diff --git a/CDP4Common/AutoGenDto/ActionItem.cs b/CDP4Common/AutoGenDto/ActionItem.cs index 846a4f981..89ddee6f9 100644 --- a/CDP4Common/AutoGenDto/ActionItem.cs +++ b/CDP4Common/AutoGenDto/ActionItem.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -107,6 +108,134 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.Actionee != default) + { + dictionary.Add("Actionee", new [] { this.Actionee }); + } + + dictionary.Add("ApprovedBy", this.ApprovedBy); + + if (this.Author != default) + { + dictionary.Add("Author", new [] { this.Author }); + } + + dictionary.Add("Category", this.Category); + + dictionary.Add("Discussion", this.Discussion); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + if (this.PrimaryAnnotatedThing != default) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Value }); + } + + dictionary.Add("RelatedThing", this.RelatedThing); + + dictionary.Add("SourceAnnotation", this.SourceAnnotation); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Actionee": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Actionee property is not allowed."); + } + break; + + case "ApprovedBy": + this.ApprovedBy.Remove(id); + break; + + case "Author": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Author property is not allowed."); + } + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Discussion": + this.Discussion.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "PrimaryAnnotatedThing": + this.PrimaryAnnotatedThing = null; + break; + + case "RelatedThing": + this.RelatedThing.Remove(id); + break; + + case "SourceAnnotation": + this.SourceAnnotation.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ActualFiniteState.cs b/CDP4Common/AutoGenDto/ActualFiniteState.cs index 0dfcb068e..cab5e7a92 100644 --- a/CDP4Common/AutoGenDto/ActualFiniteState.cs +++ b/CDP4Common/AutoGenDto/ActualFiniteState.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -136,6 +137,69 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("PossibleState", this.PossibleState); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "PossibleState": + if (addModelErrors && this.PossibleState.Count == 1) + { + errors.Add($"Remove reference '{id}' from PossibleState property is not allowed."); + } + this.PossibleState.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ActualFiniteStateList.cs b/CDP4Common/AutoGenDto/ActualFiniteStateList.cs index 1442ca0de..6d966dc11 100644 --- a/CDP4Common/AutoGenDto/ActualFiniteStateList.cs +++ b/CDP4Common/AutoGenDto/ActualFiniteStateList.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -153,6 +154,83 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ActualState", this.ActualState); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("ExcludeOption", this.ExcludeOption); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ActualState": + this.ActualState.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "ExcludeOption": + this.ExcludeOption.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Alias.cs b/CDP4Common/AutoGenDto/Alias.cs index f46a2479d..c3f7f010b 100644 --- a/CDP4Common/AutoGenDto/Alias.cs +++ b/CDP4Common/AutoGenDto/Alias.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -99,6 +100,59 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/AndExpression.cs b/CDP4Common/AutoGenDto/AndExpression.cs index 121108e59..310e0021f 100644 --- a/CDP4Common/AutoGenDto/AndExpression.cs +++ b/CDP4Common/AutoGenDto/AndExpression.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -87,6 +88,69 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("Term", this.Term); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Term": + if (addModelErrors && this.Term.Count == 1) + { + errors.Add($"Remove reference '{id}' from Term property is not allowed."); + } + this.Term.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Approval.cs b/CDP4Common/AutoGenDto/Approval.cs index a47f4a0c5..35a9210e5 100644 --- a/CDP4Common/AutoGenDto/Approval.cs +++ b/CDP4Common/AutoGenDto/Approval.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -100,6 +101,83 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.Author != default) + { + dictionary.Add("Author", new [] { this.Author }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Author": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Author property is not allowed."); + } + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ArrayParameterType.cs b/CDP4Common/AutoGenDto/ArrayParameterType.cs index 97d889bb6..35807ad74 100644 --- a/CDP4Common/AutoGenDto/ArrayParameterType.cs +++ b/CDP4Common/AutoGenDto/ArrayParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -122,6 +123,83 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/BinaryNote.cs b/CDP4Common/AutoGenDto/BinaryNote.cs index 3ea9c9af0..9eeb82332 100644 --- a/CDP4Common/AutoGenDto/BinaryNote.cs +++ b/CDP4Common/AutoGenDto/BinaryNote.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -93,6 +94,89 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Category", this.Category); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.FileType != default) + { + dictionary.Add("FileType", new [] { this.FileType }); + } + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Category": + this.Category.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "FileType": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from FileType property is not allowed."); + } + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/BinaryRelationship.cs b/CDP4Common/AutoGenDto/BinaryRelationship.cs index a76ac4cb8..00d715764 100644 --- a/CDP4Common/AutoGenDto/BinaryRelationship.cs +++ b/CDP4Common/AutoGenDto/BinaryRelationship.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -92,6 +93,107 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Category", this.Category); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + dictionary.Add("ParameterValue", this.ParameterValue); + + if (this.Source != default) + { + dictionary.Add("Source", new [] { this.Source }); + } + + if (this.Target != default) + { + dictionary.Add("Target", new [] { this.Target }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Category": + this.Category.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "ParameterValue": + this.ParameterValue.Remove(id); + break; + + case "Source": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Source property is not allowed."); + } + break; + + case "Target": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Target property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/BinaryRelationshipRule.cs b/CDP4Common/AutoGenDto/BinaryRelationshipRule.cs index 6d8833b09..7f67b2f0a 100644 --- a/CDP4Common/AutoGenDto/BinaryRelationshipRule.cs +++ b/CDP4Common/AutoGenDto/BinaryRelationshipRule.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -113,6 +114,113 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + if (this.RelationshipCategory != default) + { + dictionary.Add("RelationshipCategory", new [] { this.RelationshipCategory }); + } + + if (this.SourceCategory != default) + { + dictionary.Add("SourceCategory", new [] { this.SourceCategory }); + } + + if (this.TargetCategory != default) + { + dictionary.Add("TargetCategory", new [] { this.TargetCategory }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "RelationshipCategory": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from RelationshipCategory property is not allowed."); + } + break; + + case "SourceCategory": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from SourceCategory property is not allowed."); + } + break; + + case "TargetCategory": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from TargetCategory property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Book.cs b/CDP4Common/AutoGenDto/Book.cs index 59b0c1111..ea2c5435a 100644 --- a/CDP4Common/AutoGenDto/Book.cs +++ b/CDP4Common/AutoGenDto/Book.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -138,6 +139,77 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Category", this.Category); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Category": + this.Category.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/BooleanExpression.cs b/CDP4Common/AutoGenDto/BooleanExpression.cs index 317ca1ccd..943debde8 100644 --- a/CDP4Common/AutoGenDto/BooleanExpression.cs +++ b/CDP4Common/AutoGenDto/BooleanExpression.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -77,6 +78,59 @@ public override string Route { get { return this.ComputedRoute(); } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/BooleanParameterType.cs b/CDP4Common/AutoGenDto/BooleanParameterType.cs index 46e6cfce3..aa50d6cb5 100644 --- a/CDP4Common/AutoGenDto/BooleanParameterType.cs +++ b/CDP4Common/AutoGenDto/BooleanParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -78,6 +79,83 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Bounds.cs b/CDP4Common/AutoGenDto/Bounds.cs index 63f94877a..736d8540a 100644 --- a/CDP4Common/AutoGenDto/Bounds.cs +++ b/CDP4Common/AutoGenDto/Bounds.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -107,6 +108,59 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/BuiltInRuleVerification.cs b/CDP4Common/AutoGenDto/BuiltInRuleVerification.cs index 31c7ead69..10762ef11 100644 --- a/CDP4Common/AutoGenDto/BuiltInRuleVerification.cs +++ b/CDP4Common/AutoGenDto/BuiltInRuleVerification.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -78,6 +79,59 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Category.cs b/CDP4Common/AutoGenDto/Category.cs index ed34a7d6b..4a85ef311 100644 --- a/CDP4Common/AutoGenDto/Category.cs +++ b/CDP4Common/AutoGenDto/Category.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -110,6 +111,83 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("SuperCategory", this.SuperCategory); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "SuperCategory": + this.SuperCategory.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ChangeProposal.cs b/CDP4Common/AutoGenDto/ChangeProposal.cs index e78dffd69..c1de99c7b 100644 --- a/CDP4Common/AutoGenDto/ChangeProposal.cs +++ b/CDP4Common/AutoGenDto/ChangeProposal.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -86,6 +87,134 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ApprovedBy", this.ApprovedBy); + + if (this.Author != default) + { + dictionary.Add("Author", new [] { this.Author }); + } + + dictionary.Add("Category", this.Category); + + if (this.ChangeRequest != default) + { + dictionary.Add("ChangeRequest", new [] { this.ChangeRequest }); + } + + dictionary.Add("Discussion", this.Discussion); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + if (this.PrimaryAnnotatedThing != default) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Value }); + } + + dictionary.Add("RelatedThing", this.RelatedThing); + + dictionary.Add("SourceAnnotation", this.SourceAnnotation); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ApprovedBy": + this.ApprovedBy.Remove(id); + break; + + case "Author": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Author property is not allowed."); + } + break; + + case "Category": + this.Category.Remove(id); + break; + + case "ChangeRequest": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ChangeRequest property is not allowed."); + } + break; + + case "Discussion": + this.Discussion.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "PrimaryAnnotatedThing": + this.PrimaryAnnotatedThing = null; + break; + + case "RelatedThing": + this.RelatedThing.Remove(id); + break; + + case "SourceAnnotation": + this.SourceAnnotation.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ChangeRequest.cs b/CDP4Common/AutoGenDto/ChangeRequest.cs index f01f81a43..9bee165e2 100644 --- a/CDP4Common/AutoGenDto/ChangeRequest.cs +++ b/CDP4Common/AutoGenDto/ChangeRequest.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -79,6 +80,122 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ApprovedBy", this.ApprovedBy); + + if (this.Author != default) + { + dictionary.Add("Author", new [] { this.Author }); + } + + dictionary.Add("Category", this.Category); + + dictionary.Add("Discussion", this.Discussion); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + if (this.PrimaryAnnotatedThing != default) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Value }); + } + + dictionary.Add("RelatedThing", this.RelatedThing); + + dictionary.Add("SourceAnnotation", this.SourceAnnotation); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ApprovedBy": + this.ApprovedBy.Remove(id); + break; + + case "Author": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Author property is not allowed."); + } + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Discussion": + this.Discussion.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "PrimaryAnnotatedThing": + this.PrimaryAnnotatedThing = null; + break; + + case "RelatedThing": + this.RelatedThing.Remove(id); + break; + + case "SourceAnnotation": + this.SourceAnnotation.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Citation.cs b/CDP4Common/AutoGenDto/Citation.cs index 1fddc44cf..3f67ddcf1 100644 --- a/CDP4Common/AutoGenDto/Citation.cs +++ b/CDP4Common/AutoGenDto/Citation.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -113,6 +114,71 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Source != default) + { + dictionary.Add("Source", new [] { this.Source }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Source": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Source property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Color.cs b/CDP4Common/AutoGenDto/Color.cs index 521518eac..afb74f5ad 100644 --- a/CDP4Common/AutoGenDto/Color.cs +++ b/CDP4Common/AutoGenDto/Color.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -99,6 +100,59 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/CommonFileStore.cs b/CDP4Common/AutoGenDto/CommonFileStore.cs index 9b8819fa9..1c7da4bb2 100644 --- a/CDP4Common/AutoGenDto/CommonFileStore.cs +++ b/CDP4Common/AutoGenDto/CommonFileStore.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -78,6 +79,83 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("File", this.File); + + dictionary.Add("Folder", this.Folder); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "File": + this.File.Remove(id); + break; + + case "Folder": + this.Folder.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/CompoundParameterType.cs b/CDP4Common/AutoGenDto/CompoundParameterType.cs index 58403c389..d62eecd22 100644 --- a/CDP4Common/AutoGenDto/CompoundParameterType.cs +++ b/CDP4Common/AutoGenDto/CompoundParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -107,6 +108,83 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Constant.cs b/CDP4Common/AutoGenDto/Constant.cs index e18e447e7..431d7138a 100644 --- a/CDP4Common/AutoGenDto/Constant.cs +++ b/CDP4Common/AutoGenDto/Constant.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -117,6 +118,104 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + if (this.ParameterType != default) + { + dictionary.Add("ParameterType", new [] { this.ParameterType }); + } + + if (this.Scale != default) + { + dictionary.Add("Scale", new [] { this.Scale.Value }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "ParameterType": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ParameterType property is not allowed."); + } + break; + + case "Scale": + this.Scale = null; + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ContractChangeNotice.cs b/CDP4Common/AutoGenDto/ContractChangeNotice.cs index 25fa9096d..fcce31574 100644 --- a/CDP4Common/AutoGenDto/ContractChangeNotice.cs +++ b/CDP4Common/AutoGenDto/ContractChangeNotice.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -86,6 +87,134 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ApprovedBy", this.ApprovedBy); + + if (this.Author != default) + { + dictionary.Add("Author", new [] { this.Author }); + } + + dictionary.Add("Category", this.Category); + + if (this.ChangeProposal != default) + { + dictionary.Add("ChangeProposal", new [] { this.ChangeProposal }); + } + + dictionary.Add("Discussion", this.Discussion); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + if (this.PrimaryAnnotatedThing != default) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Value }); + } + + dictionary.Add("RelatedThing", this.RelatedThing); + + dictionary.Add("SourceAnnotation", this.SourceAnnotation); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ApprovedBy": + this.ApprovedBy.Remove(id); + break; + + case "Author": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Author property is not allowed."); + } + break; + + case "Category": + this.Category.Remove(id); + break; + + case "ChangeProposal": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ChangeProposal property is not allowed."); + } + break; + + case "Discussion": + this.Discussion.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "PrimaryAnnotatedThing": + this.PrimaryAnnotatedThing = null; + break; + + case "RelatedThing": + this.RelatedThing.Remove(id); + break; + + case "SourceAnnotation": + this.SourceAnnotation.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ContractDeviation.cs b/CDP4Common/AutoGenDto/ContractDeviation.cs index 3f38d2a72..1eee24e8f 100644 --- a/CDP4Common/AutoGenDto/ContractDeviation.cs +++ b/CDP4Common/AutoGenDto/ContractDeviation.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -78,6 +79,122 @@ public override string Route { get { return this.ComputedRoute(); } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ApprovedBy", this.ApprovedBy); + + if (this.Author != default) + { + dictionary.Add("Author", new [] { this.Author }); + } + + dictionary.Add("Category", this.Category); + + dictionary.Add("Discussion", this.Discussion); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + if (this.PrimaryAnnotatedThing != default) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Value }); + } + + dictionary.Add("RelatedThing", this.RelatedThing); + + dictionary.Add("SourceAnnotation", this.SourceAnnotation); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ApprovedBy": + this.ApprovedBy.Remove(id); + break; + + case "Author": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Author property is not allowed."); + } + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Discussion": + this.Discussion.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "PrimaryAnnotatedThing": + this.PrimaryAnnotatedThing = null; + break; + + case "RelatedThing": + this.RelatedThing.Remove(id); + break; + + case "SourceAnnotation": + this.SourceAnnotation.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/ConversionBasedUnit.cs b/CDP4Common/AutoGenDto/ConversionBasedUnit.cs index 311e8a485..e7c76f7d0 100644 --- a/CDP4Common/AutoGenDto/ConversionBasedUnit.cs +++ b/CDP4Common/AutoGenDto/ConversionBasedUnit.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -91,6 +92,89 @@ public override string Route { get { return this.ComputedRoute(); } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + if (this.ReferenceUnit != default) + { + dictionary.Add("ReferenceUnit", new [] { this.ReferenceUnit }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "ReferenceUnit": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ReferenceUnit property is not allowed."); + } + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/CyclicRatioScale.cs b/CDP4Common/AutoGenDto/CyclicRatioScale.cs index 7c1ddae56..059cee36a 100644 --- a/CDP4Common/AutoGenDto/CyclicRatioScale.cs +++ b/CDP4Common/AutoGenDto/CyclicRatioScale.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -85,6 +86,101 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("MappingToReferenceScale", this.MappingToReferenceScale); + + if (this.Unit != default) + { + dictionary.Add("Unit", new [] { this.Unit }); + } + + dictionary.Add("ValueDefinition", this.ValueDefinition); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "MappingToReferenceScale": + this.MappingToReferenceScale.Remove(id); + break; + + case "Unit": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Unit property is not allowed."); + } + break; + + case "ValueDefinition": + this.ValueDefinition.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/DateParameterType.cs b/CDP4Common/AutoGenDto/DateParameterType.cs index fd2f10958..947261bce 100644 --- a/CDP4Common/AutoGenDto/DateParameterType.cs +++ b/CDP4Common/AutoGenDto/DateParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -78,6 +79,83 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/DateTimeParameterType.cs b/CDP4Common/AutoGenDto/DateTimeParameterType.cs index 896207125..c18a2ae03 100644 --- a/CDP4Common/AutoGenDto/DateTimeParameterType.cs +++ b/CDP4Common/AutoGenDto/DateTimeParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -78,6 +79,83 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/DecompositionRule.cs b/CDP4Common/AutoGenDto/DecompositionRule.cs index 7f03acda0..2c574438a 100644 --- a/CDP4Common/AutoGenDto/DecompositionRule.cs +++ b/CDP4Common/AutoGenDto/DecompositionRule.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -108,6 +109,99 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("ContainedCategory", this.ContainedCategory); + + if (this.ContainingCategory != default) + { + dictionary.Add("ContainingCategory", new [] { this.ContainingCategory }); + } + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "ContainedCategory": + if (addModelErrors && this.ContainedCategory.Count == 1) + { + errors.Add($"Remove reference '{id}' from ContainedCategory property is not allowed."); + } + this.ContainedCategory.Remove(id); + break; + + case "ContainingCategory": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ContainingCategory property is not allowed."); + } + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/DefinedThing.cs b/CDP4Common/AutoGenDto/DefinedThing.cs index 90c49b9a1..3bb676f35 100644 --- a/CDP4Common/AutoGenDto/DefinedThing.cs +++ b/CDP4Common/AutoGenDto/DefinedThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -124,6 +125,77 @@ public override IEnumerable ContainerLists return containers; } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/Definition.cs b/CDP4Common/AutoGenDto/Definition.cs index 7702d42d8..f593be913 100644 --- a/CDP4Common/AutoGenDto/Definition.cs +++ b/CDP4Common/AutoGenDto/Definition.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -132,6 +133,65 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Citation", this.Citation); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Citation": + this.Citation.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/DependentParameterTypeAssignment.cs b/CDP4Common/AutoGenDto/DependentParameterTypeAssignment.cs index e3910cf84..246e524b3 100644 --- a/CDP4Common/AutoGenDto/DependentParameterTypeAssignment.cs +++ b/CDP4Common/AutoGenDto/DependentParameterTypeAssignment.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -93,6 +94,80 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.MeasurementScale != default) + { + dictionary.Add("MeasurementScale", new [] { this.MeasurementScale.Value }); + } + + if (this.ParameterType != default) + { + dictionary.Add("ParameterType", new [] { this.ParameterType }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "MeasurementScale": + this.MeasurementScale = null; + break; + + case "ParameterType": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ParameterType property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/DerivedQuantityKind.cs b/CDP4Common/AutoGenDto/DerivedQuantityKind.cs index bcc438a0d..40752bb2e 100644 --- a/CDP4Common/AutoGenDto/DerivedQuantityKind.cs +++ b/CDP4Common/AutoGenDto/DerivedQuantityKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -100,6 +101,101 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + if (this.DefaultScale != default) + { + dictionary.Add("DefaultScale", new [] { this.DefaultScale }); + } + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("PossibleScale", this.PossibleScale); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "DefaultScale": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from DefaultScale property is not allowed."); + } + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "PossibleScale": + this.PossibleScale.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/DerivedUnit.cs b/CDP4Common/AutoGenDto/DerivedUnit.cs index d204e517b..df1122684 100644 --- a/CDP4Common/AutoGenDto/DerivedUnit.cs +++ b/CDP4Common/AutoGenDto/DerivedUnit.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -100,6 +101,77 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/DiagramCanvas.cs b/CDP4Common/AutoGenDto/DiagramCanvas.cs index a99005fb8..b1c2467fb 100644 --- a/CDP4Common/AutoGenDto/DiagramCanvas.cs +++ b/CDP4Common/AutoGenDto/DiagramCanvas.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -86,6 +87,71 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Bounds", this.Bounds); + + dictionary.Add("DiagramElement", this.DiagramElement); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Bounds": + this.Bounds.Remove(id); + break; + + case "DiagramElement": + this.DiagramElement.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/DiagramEdge.cs b/CDP4Common/AutoGenDto/DiagramEdge.cs index e947b1616..b88adea44 100644 --- a/CDP4Common/AutoGenDto/DiagramEdge.cs +++ b/CDP4Common/AutoGenDto/DiagramEdge.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -115,6 +116,119 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Bounds", this.Bounds); + + if (this.DepictedThing != default) + { + dictionary.Add("DepictedThing", new [] { this.DepictedThing.Value }); + } + + dictionary.Add("DiagramElement", this.DiagramElement); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("LocalStyle", this.LocalStyle); + + if (this.SharedStyle != default) + { + dictionary.Add("SharedStyle", new [] { this.SharedStyle.Value }); + } + + if (this.Source != default) + { + dictionary.Add("Source", new [] { this.Source }); + } + + if (this.Target != default) + { + dictionary.Add("Target", new [] { this.Target }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Bounds": + this.Bounds.Remove(id); + break; + + case "DepictedThing": + this.DepictedThing = null; + break; + + case "DiagramElement": + this.DiagramElement.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "LocalStyle": + this.LocalStyle.Remove(id); + break; + + case "SharedStyle": + this.SharedStyle = null; + break; + + case "Source": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Source property is not allowed."); + } + break; + + case "Target": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Target property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/DiagramElementContainer.cs b/CDP4Common/AutoGenDto/DiagramElementContainer.cs index 54203a887..0de25aebc 100644 --- a/CDP4Common/AutoGenDto/DiagramElementContainer.cs +++ b/CDP4Common/AutoGenDto/DiagramElementContainer.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -101,6 +102,71 @@ public override IEnumerable ContainerLists return containers; } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Bounds", this.Bounds); + + dictionary.Add("DiagramElement", this.DiagramElement); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Bounds": + this.Bounds.Remove(id); + break; + + case "DiagramElement": + this.DiagramElement.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/DiagramElementThing.cs b/CDP4Common/AutoGenDto/DiagramElementThing.cs index 6db0bb0fc..d84d09329 100644 --- a/CDP4Common/AutoGenDto/DiagramElementThing.cs +++ b/CDP4Common/AutoGenDto/DiagramElementThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -114,6 +115,95 @@ public override IEnumerable ContainerLists return containers; } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Bounds", this.Bounds); + + if (this.DepictedThing != default) + { + dictionary.Add("DepictedThing", new [] { this.DepictedThing.Value }); + } + + dictionary.Add("DiagramElement", this.DiagramElement); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("LocalStyle", this.LocalStyle); + + if (this.SharedStyle != default) + { + dictionary.Add("SharedStyle", new [] { this.SharedStyle.Value }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Bounds": + this.Bounds.Remove(id); + break; + + case "DepictedThing": + this.DepictedThing = null; + break; + + case "DiagramElement": + this.DiagramElement.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "LocalStyle": + this.LocalStyle.Remove(id); + break; + + case "SharedStyle": + this.SharedStyle = null; + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/DiagramObject.cs b/CDP4Common/AutoGenDto/DiagramObject.cs index db2f9893d..274802747 100644 --- a/CDP4Common/AutoGenDto/DiagramObject.cs +++ b/CDP4Common/AutoGenDto/DiagramObject.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -93,6 +94,95 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Bounds", this.Bounds); + + if (this.DepictedThing != default) + { + dictionary.Add("DepictedThing", new [] { this.DepictedThing.Value }); + } + + dictionary.Add("DiagramElement", this.DiagramElement); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("LocalStyle", this.LocalStyle); + + if (this.SharedStyle != default) + { + dictionary.Add("SharedStyle", new [] { this.SharedStyle.Value }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Bounds": + this.Bounds.Remove(id); + break; + + case "DepictedThing": + this.DepictedThing = null; + break; + + case "DiagramElement": + this.DiagramElement.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "LocalStyle": + this.LocalStyle.Remove(id); + break; + + case "SharedStyle": + this.SharedStyle = null; + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/DiagramShape.cs b/CDP4Common/AutoGenDto/DiagramShape.cs index 65a6941ea..fbf6a1a6d 100644 --- a/CDP4Common/AutoGenDto/DiagramShape.cs +++ b/CDP4Common/AutoGenDto/DiagramShape.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -78,6 +79,95 @@ public override string Route { get { return this.ComputedRoute(); } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Bounds", this.Bounds); + + if (this.DepictedThing != default) + { + dictionary.Add("DepictedThing", new [] { this.DepictedThing.Value }); + } + + dictionary.Add("DiagramElement", this.DiagramElement); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("LocalStyle", this.LocalStyle); + + if (this.SharedStyle != default) + { + dictionary.Add("SharedStyle", new [] { this.SharedStyle.Value }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Bounds": + this.Bounds.Remove(id); + break; + + case "DepictedThing": + this.DepictedThing = null; + break; + + case "DiagramElement": + this.DiagramElement.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "LocalStyle": + this.LocalStyle.Remove(id); + break; + + case "SharedStyle": + this.SharedStyle = null; + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/DiagramThingBase.cs b/CDP4Common/AutoGenDto/DiagramThingBase.cs index 581b71619..6896b9d47 100644 --- a/CDP4Common/AutoGenDto/DiagramThingBase.cs +++ b/CDP4Common/AutoGenDto/DiagramThingBase.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -76,6 +77,59 @@ protected DiagramThingBase(Guid iid, int rev) : base(iid: iid, rev: rev) [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] [DataMember] public virtual string Name { get; set; } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/DiagrammingStyle.cs b/CDP4Common/AutoGenDto/DiagrammingStyle.cs index d0021fc82..01eb74874 100644 --- a/CDP4Common/AutoGenDto/DiagrammingStyle.cs +++ b/CDP4Common/AutoGenDto/DiagrammingStyle.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -175,6 +176,92 @@ public override IEnumerable ContainerLists return containers; } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.FillColor != default) + { + dictionary.Add("FillColor", new [] { this.FillColor.Value }); + } + + if (this.FontColor != default) + { + dictionary.Add("FontColor", new [] { this.FontColor.Value }); + } + + if (this.StrokeColor != default) + { + dictionary.Add("StrokeColor", new [] { this.StrokeColor.Value }); + } + + dictionary.Add("UsedColor", this.UsedColor); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "FillColor": + this.FillColor = null; + break; + + case "FontColor": + this.FontColor = null; + break; + + case "StrokeColor": + this.StrokeColor = null; + break; + + case "UsedColor": + this.UsedColor.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/DiscussionItem.cs b/CDP4Common/AutoGenDto/DiscussionItem.cs index 687034c6c..7214d2c32 100644 --- a/CDP4Common/AutoGenDto/DiscussionItem.cs +++ b/CDP4Common/AutoGenDto/DiscussionItem.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -76,6 +77,68 @@ protected DiscussionItem(Guid iid, int rev) : base(iid: iid, rev: rev) [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: true, isPersistent: true)] [DataMember] public virtual Guid? ReplyTo { get; set; } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.ReplyTo != default) + { + dictionary.Add("ReplyTo", new [] { this.ReplyTo.Value }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "ReplyTo": + this.ReplyTo = null; + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/DomainFileStore.cs b/CDP4Common/AutoGenDto/DomainFileStore.cs index 2b53888b4..6c70af55b 100644 --- a/CDP4Common/AutoGenDto/DomainFileStore.cs +++ b/CDP4Common/AutoGenDto/DomainFileStore.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -85,6 +86,83 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("File", this.File); + + dictionary.Add("Folder", this.Folder); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "File": + this.File.Remove(id); + break; + + case "Folder": + this.Folder.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/DomainOfExpertise.cs b/CDP4Common/AutoGenDto/DomainOfExpertise.cs index 5949c5c20..8a1cb6813 100644 --- a/CDP4Common/AutoGenDto/DomainOfExpertise.cs +++ b/CDP4Common/AutoGenDto/DomainOfExpertise.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -94,6 +95,83 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/DomainOfExpertiseGroup.cs b/CDP4Common/AutoGenDto/DomainOfExpertiseGroup.cs index ce161ca17..cb7e05a3a 100644 --- a/CDP4Common/AutoGenDto/DomainOfExpertiseGroup.cs +++ b/CDP4Common/AutoGenDto/DomainOfExpertiseGroup.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -94,6 +95,83 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("Domain", this.Domain); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "Domain": + this.Domain.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ElementBase.cs b/CDP4Common/AutoGenDto/ElementBase.cs index c6122e80c..6d2296dea 100644 --- a/CDP4Common/AutoGenDto/ElementBase.cs +++ b/CDP4Common/AutoGenDto/ElementBase.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -84,6 +85,95 @@ protected ElementBase(Guid iid, int rev) : base(iid: iid, rev: rev) [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] [DataMember] public virtual Guid Owner { get; set; } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/ElementDefinition.cs b/CDP4Common/AutoGenDto/ElementDefinition.cs index e39c61745..f3050550c 100644 --- a/CDP4Common/AutoGenDto/ElementDefinition.cs +++ b/CDP4Common/AutoGenDto/ElementDefinition.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -139,6 +140,125 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("ContainedElement", this.ContainedElement); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("OrganizationalParticipant", this.OrganizationalParticipant); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + dictionary.Add("Parameter", this.Parameter); + + dictionary.Add("ParameterGroup", this.ParameterGroup); + + dictionary.Add("ReferencedElement", this.ReferencedElement); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "ContainedElement": + this.ContainedElement.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "OrganizationalParticipant": + this.OrganizationalParticipant.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "Parameter": + this.Parameter.Remove(id); + break; + + case "ParameterGroup": + this.ParameterGroup.Remove(id); + break; + + case "ReferencedElement": + this.ReferencedElement.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ElementUsage.cs b/CDP4Common/AutoGenDto/ElementUsage.cs index 15c9c5984..e68c4a075 100644 --- a/CDP4Common/AutoGenDto/ElementUsage.cs +++ b/CDP4Common/AutoGenDto/ElementUsage.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -123,6 +124,119 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + if (this.ElementDefinition != default) + { + dictionary.Add("ElementDefinition", new [] { this.ElementDefinition }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("ExcludeOption", this.ExcludeOption); + + dictionary.Add("HyperLink", this.HyperLink); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + dictionary.Add("ParameterOverride", this.ParameterOverride); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ElementDefinition": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ElementDefinition property is not allowed."); + } + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "ExcludeOption": + this.ExcludeOption.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "ParameterOverride": + this.ParameterOverride.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/EmailAddress.cs b/CDP4Common/AutoGenDto/EmailAddress.cs index 87d87d6d3..4485cde4d 100644 --- a/CDP4Common/AutoGenDto/EmailAddress.cs +++ b/CDP4Common/AutoGenDto/EmailAddress.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -92,6 +93,59 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/EngineeringModel.cs b/CDP4Common/AutoGenDto/EngineeringModel.cs index b97fa07e5..866e1c9af 100644 --- a/CDP4Common/AutoGenDto/EngineeringModel.cs +++ b/CDP4Common/AutoGenDto/EngineeringModel.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -159,6 +160,105 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("CommonFileStore", this.CommonFileStore); + + if (this.EngineeringModelSetup != default) + { + dictionary.Add("EngineeringModelSetup", new [] { this.EngineeringModelSetup }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("GenericNote", this.GenericNote); + + dictionary.Add("Iteration", this.Iteration); + + dictionary.Add("LogEntry", this.LogEntry); + + dictionary.Add("ModellingAnnotation", this.ModellingAnnotation); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "CommonFileStore": + this.CommonFileStore.Remove(id); + break; + + case "EngineeringModelSetup": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from EngineeringModelSetup property is not allowed."); + } + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "GenericNote": + this.GenericNote.Remove(id); + break; + + case "Iteration": + if (addModelErrors && this.Iteration.Count == 1) + { + errors.Add($"Remove reference '{id}' from Iteration property is not allowed."); + } + this.Iteration.Remove(id); + break; + + case "LogEntry": + this.LogEntry.Remove(id); + break; + + case "ModellingAnnotation": + this.ModellingAnnotation.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/EngineeringModelDataAnnotation.cs b/CDP4Common/AutoGenDto/EngineeringModelDataAnnotation.cs index 4b349d7d6..cbe169996 100644 --- a/CDP4Common/AutoGenDto/EngineeringModelDataAnnotation.cs +++ b/CDP4Common/AutoGenDto/EngineeringModelDataAnnotation.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -115,6 +116,92 @@ public override IEnumerable ContainerLists return containers; } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.Author != default) + { + dictionary.Add("Author", new [] { this.Author }); + } + + dictionary.Add("Discussion", this.Discussion); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.PrimaryAnnotatedThing != default) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Value }); + } + + dictionary.Add("RelatedThing", this.RelatedThing); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Author": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Author property is not allowed."); + } + break; + + case "Discussion": + this.Discussion.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "PrimaryAnnotatedThing": + this.PrimaryAnnotatedThing = null; + break; + + case "RelatedThing": + this.RelatedThing.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/EngineeringModelDataDiscussionItem.cs b/CDP4Common/AutoGenDto/EngineeringModelDataDiscussionItem.cs index eb8ded6dd..daf968238 100644 --- a/CDP4Common/AutoGenDto/EngineeringModelDataDiscussionItem.cs +++ b/CDP4Common/AutoGenDto/EngineeringModelDataDiscussionItem.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -86,6 +87,80 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.Author != default) + { + dictionary.Add("Author", new [] { this.Author }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.ReplyTo != default) + { + dictionary.Add("ReplyTo", new [] { this.ReplyTo.Value }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Author": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Author property is not allowed."); + } + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "ReplyTo": + this.ReplyTo = null; + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/EngineeringModelDataNote.cs b/CDP4Common/AutoGenDto/EngineeringModelDataNote.cs index ef3a23df3..b77d40ddd 100644 --- a/CDP4Common/AutoGenDto/EngineeringModelDataNote.cs +++ b/CDP4Common/AutoGenDto/EngineeringModelDataNote.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -79,6 +80,92 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.Author != default) + { + dictionary.Add("Author", new [] { this.Author }); + } + + dictionary.Add("Discussion", this.Discussion); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.PrimaryAnnotatedThing != default) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Value }); + } + + dictionary.Add("RelatedThing", this.RelatedThing); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Author": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Author property is not allowed."); + } + break; + + case "Discussion": + this.Discussion.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "PrimaryAnnotatedThing": + this.PrimaryAnnotatedThing = null; + break; + + case "RelatedThing": + this.RelatedThing.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/EngineeringModelSetup.cs b/CDP4Common/AutoGenDto/EngineeringModelSetup.cs index 90556993a..04dcdf1f2 100644 --- a/CDP4Common/AutoGenDto/EngineeringModelSetup.cs +++ b/CDP4Common/AutoGenDto/EngineeringModelSetup.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -176,6 +177,132 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ActiveDomain", this.ActiveDomain); + + dictionary.Add("Alias", this.Alias); + + if (this.DefaultOrganizationalParticipant != default) + { + dictionary.Add("DefaultOrganizationalParticipant", new [] { this.DefaultOrganizationalParticipant.Value }); + } + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("IterationSetup", this.IterationSetup); + + dictionary.Add("OrganizationalParticipant", this.OrganizationalParticipant); + + dictionary.Add("Participant", this.Participant); + + dictionary.Add("RequiredRdl", this.RequiredRdl); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ActiveDomain": + if (addModelErrors && this.ActiveDomain.Count == 1) + { + errors.Add($"Remove reference '{id}' from ActiveDomain property is not allowed."); + } + this.ActiveDomain.Remove(id); + break; + + case "Alias": + this.Alias.Remove(id); + break; + + case "DefaultOrganizationalParticipant": + this.DefaultOrganizationalParticipant = null; + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "IterationSetup": + if (addModelErrors && this.IterationSetup.Count == 1) + { + errors.Add($"Remove reference '{id}' from IterationSetup property is not allowed."); + } + this.IterationSetup.Remove(id); + break; + + case "OrganizationalParticipant": + this.OrganizationalParticipant.Remove(id); + break; + + case "Participant": + if (addModelErrors && this.Participant.Count == 1) + { + errors.Add($"Remove reference '{id}' from Participant property is not allowed."); + } + this.Participant.Remove(id); + break; + + case "RequiredRdl": + if (addModelErrors && this.RequiredRdl.Count == 1) + { + errors.Add($"Remove reference '{id}' from RequiredRdl property is not allowed."); + } + this.RequiredRdl.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/EnumerationParameterType.cs b/CDP4Common/AutoGenDto/EnumerationParameterType.cs index 199c17f09..4438dc792 100644 --- a/CDP4Common/AutoGenDto/EnumerationParameterType.cs +++ b/CDP4Common/AutoGenDto/EnumerationParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -107,6 +108,83 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/EnumerationValueDefinition.cs b/CDP4Common/AutoGenDto/EnumerationValueDefinition.cs index b8060f6f0..decde15e4 100644 --- a/CDP4Common/AutoGenDto/EnumerationValueDefinition.cs +++ b/CDP4Common/AutoGenDto/EnumerationValueDefinition.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -78,6 +79,77 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ExclusiveOrExpression.cs b/CDP4Common/AutoGenDto/ExclusiveOrExpression.cs index 7fffebbd9..8948c9cb2 100644 --- a/CDP4Common/AutoGenDto/ExclusiveOrExpression.cs +++ b/CDP4Common/AutoGenDto/ExclusiveOrExpression.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -87,6 +88,69 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("Term", this.Term); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Term": + if (addModelErrors && this.Term.Count == 1) + { + errors.Add($"Remove reference '{id}' from Term property is not allowed."); + } + this.Term.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ExternalIdentifierMap.cs b/CDP4Common/AutoGenDto/ExternalIdentifierMap.cs index 13c9d4323..49cf174e6 100644 --- a/CDP4Common/AutoGenDto/ExternalIdentifierMap.cs +++ b/CDP4Common/AutoGenDto/ExternalIdentifierMap.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -142,6 +143,86 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Correspondence", this.Correspondence); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.ExternalFormat != default) + { + dictionary.Add("ExternalFormat", new [] { this.ExternalFormat.Value }); + } + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Correspondence": + this.Correspondence.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "ExternalFormat": + this.ExternalFormat = null; + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/File.cs b/CDP4Common/AutoGenDto/File.cs index 327c93c11..93fac92ac 100644 --- a/CDP4Common/AutoGenDto/File.cs +++ b/CDP4Common/AutoGenDto/File.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -123,6 +124,96 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Category", this.Category); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("FileRevision", this.FileRevision); + + if (this.LockedBy != default) + { + dictionary.Add("LockedBy", new [] { this.LockedBy.Value }); + } + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Category": + this.Category.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "FileRevision": + if (addModelErrors && this.FileRevision.Count == 1) + { + errors.Add($"Remove reference '{id}' from FileRevision property is not allowed."); + } + this.FileRevision.Remove(id); + break; + + case "LockedBy": + this.LockedBy = null; + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/FileRevision.cs b/CDP4Common/AutoGenDto/FileRevision.cs index f6a5b82f9..1b8c36fad 100644 --- a/CDP4Common/AutoGenDto/FileRevision.cs +++ b/CDP4Common/AutoGenDto/FileRevision.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -136,6 +137,80 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.ContainingFolder != default) + { + dictionary.Add("ContainingFolder", new [] { this.ContainingFolder.Value }); + } + + if (this.Creator != default) + { + dictionary.Add("Creator", new [] { this.Creator }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ContainingFolder": + this.ContainingFolder = null; + break; + + case "Creator": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Creator property is not allowed."); + } + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/FileStore.cs b/CDP4Common/AutoGenDto/FileStore.cs index 8e6f00b7f..07e63277a 100644 --- a/CDP4Common/AutoGenDto/FileStore.cs +++ b/CDP4Common/AutoGenDto/FileStore.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -121,6 +122,83 @@ public override IEnumerable ContainerLists return containers; } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("File", this.File); + + dictionary.Add("Folder", this.Folder); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "File": + this.File.Remove(id); + break; + + case "Folder": + this.Folder.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/FileType.cs b/CDP4Common/AutoGenDto/FileType.cs index dc6689a24..488a931e6 100644 --- a/CDP4Common/AutoGenDto/FileType.cs +++ b/CDP4Common/AutoGenDto/FileType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -101,6 +102,83 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Folder.cs b/CDP4Common/AutoGenDto/Folder.cs index 615b3c4ab..153f4dd02 100644 --- a/CDP4Common/AutoGenDto/Folder.cs +++ b/CDP4Common/AutoGenDto/Folder.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -127,6 +128,92 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.ContainingFolder != default) + { + dictionary.Add("ContainingFolder", new [] { this.ContainingFolder.Value }); + } + + if (this.Creator != default) + { + dictionary.Add("Creator", new [] { this.Creator }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ContainingFolder": + this.ContainingFolder = null; + break; + + case "Creator": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Creator property is not allowed."); + } + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/GenericAnnotation.cs b/CDP4Common/AutoGenDto/GenericAnnotation.cs index 01e556c81..e92d674fd 100644 --- a/CDP4Common/AutoGenDto/GenericAnnotation.cs +++ b/CDP4Common/AutoGenDto/GenericAnnotation.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -90,6 +91,59 @@ protected GenericAnnotation(Guid iid, int rev) : base(iid: iid, rev: rev) [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] [DataMember] public virtual string LanguageCode { get; set; } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/Glossary.cs b/CDP4Common/AutoGenDto/Glossary.cs index afa6a5870..7fe137949 100644 --- a/CDP4Common/AutoGenDto/Glossary.cs +++ b/CDP4Common/AutoGenDto/Glossary.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -116,6 +117,89 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("Term", this.Term); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "Term": + this.Term.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Goal.cs b/CDP4Common/AutoGenDto/Goal.cs index ebf59e99e..7fce550d8 100644 --- a/CDP4Common/AutoGenDto/Goal.cs +++ b/CDP4Common/AutoGenDto/Goal.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -88,6 +89,83 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/HyperLink.cs b/CDP4Common/AutoGenDto/HyperLink.cs index a8267467c..f8c2198f4 100644 --- a/CDP4Common/AutoGenDto/HyperLink.cs +++ b/CDP4Common/AutoGenDto/HyperLink.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -99,6 +100,59 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/IAnnotation.cs b/CDP4Common/AutoGenDto/IAnnotation.cs index d6315d083..3bbfac0de 100644 --- a/CDP4Common/AutoGenDto/IAnnotation.cs +++ b/CDP4Common/AutoGenDto/IAnnotation.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2021 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -22,6 +23,10 @@ // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -------------------------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + namespace CDP4Common.DTO { using System; @@ -52,3 +57,7 @@ public partial interface IAnnotation string LanguageCode { get; set; } } } + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/CDP4Common/AutoGenDto/ICategorizableThing.cs b/CDP4Common/AutoGenDto/ICategorizableThing.cs index d1307a903..64c18456d 100644 --- a/CDP4Common/AutoGenDto/ICategorizableThing.cs +++ b/CDP4Common/AutoGenDto/ICategorizableThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2021 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -22,6 +23,10 @@ // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -------------------------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + namespace CDP4Common.DTO { using System; @@ -45,3 +50,7 @@ public partial interface ICategorizableThing List Category { get; set; } } } + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/CDP4Common/AutoGenDto/IDeprecatableThing.cs b/CDP4Common/AutoGenDto/IDeprecatableThing.cs index 8f718c5c0..61b2ddb8f 100644 --- a/CDP4Common/AutoGenDto/IDeprecatableThing.cs +++ b/CDP4Common/AutoGenDto/IDeprecatableThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2021 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -22,6 +23,10 @@ // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -------------------------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + namespace CDP4Common.DTO { using System; @@ -43,3 +48,7 @@ public partial interface IDeprecatableThing bool IsDeprecated { get; set; } } } + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/CDP4Common/AutoGenDto/ILogEntry.cs b/CDP4Common/AutoGenDto/ILogEntry.cs index 9770cde7f..c6976b38f 100644 --- a/CDP4Common/AutoGenDto/ILogEntry.cs +++ b/CDP4Common/AutoGenDto/ILogEntry.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2021 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -22,6 +23,10 @@ // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -------------------------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + namespace CDP4Common.DTO { using System; @@ -78,3 +83,7 @@ public partial interface ILogEntry List LogEntryChangelogItem { get; set; } } } + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/CDP4Common/AutoGenDto/INamedThing.cs b/CDP4Common/AutoGenDto/INamedThing.cs index 50fa628fe..ede55802c 100644 --- a/CDP4Common/AutoGenDto/INamedThing.cs +++ b/CDP4Common/AutoGenDto/INamedThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2021 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -22,6 +23,10 @@ // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -------------------------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + namespace CDP4Common.DTO { using System; @@ -43,3 +48,7 @@ public partial interface INamedThing string Name { get; set; } } } + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/CDP4Common/AutoGenDto/IOptionDependentThing.cs b/CDP4Common/AutoGenDto/IOptionDependentThing.cs index 4c13d267f..0fa6b6185 100644 --- a/CDP4Common/AutoGenDto/IOptionDependentThing.cs +++ b/CDP4Common/AutoGenDto/IOptionDependentThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2021 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -22,6 +23,10 @@ // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -------------------------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + namespace CDP4Common.DTO { using System; @@ -43,3 +48,7 @@ public partial interface IOptionDependentThing List ExcludeOption { get; set; } } } + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/CDP4Common/AutoGenDto/IOwnedThing.cs b/CDP4Common/AutoGenDto/IOwnedThing.cs index 5dcf8199d..3be8ac67f 100644 --- a/CDP4Common/AutoGenDto/IOwnedThing.cs +++ b/CDP4Common/AutoGenDto/IOwnedThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2021 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -22,6 +23,10 @@ // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -------------------------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + namespace CDP4Common.DTO { using System; @@ -43,3 +48,7 @@ public partial interface IOwnedThing Guid Owner { get; set; } } } + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/CDP4Common/AutoGenDto/IParameterTypeAssignment.cs b/CDP4Common/AutoGenDto/IParameterTypeAssignment.cs index cfd3e1042..09b7eb6db 100644 --- a/CDP4Common/AutoGenDto/IParameterTypeAssignment.cs +++ b/CDP4Common/AutoGenDto/IParameterTypeAssignment.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2021 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -22,6 +23,10 @@ // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -------------------------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + namespace CDP4Common.DTO { using System; @@ -50,3 +55,7 @@ public partial interface IParameterTypeAssignment Guid ParameterType { get; set; } } } + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/CDP4Common/AutoGenDto/IParticipantAffectedAccessThing.cs b/CDP4Common/AutoGenDto/IParticipantAffectedAccessThing.cs index b83cbe1bf..33d681a4c 100644 --- a/CDP4Common/AutoGenDto/IParticipantAffectedAccessThing.cs +++ b/CDP4Common/AutoGenDto/IParticipantAffectedAccessThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2021 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -22,6 +23,10 @@ // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -------------------------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + namespace CDP4Common.DTO { using System; @@ -36,3 +41,7 @@ public partial interface IParticipantAffectedAccessThing { } } + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/CDP4Common/AutoGenDto/IShortNamedThing.cs b/CDP4Common/AutoGenDto/IShortNamedThing.cs index 2008be0aa..97aec1a48 100644 --- a/CDP4Common/AutoGenDto/IShortNamedThing.cs +++ b/CDP4Common/AutoGenDto/IShortNamedThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2021 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -22,6 +23,10 @@ // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -------------------------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + namespace CDP4Common.DTO { using System; @@ -45,3 +50,7 @@ public partial interface IShortNamedThing string ShortName { get; set; } } } + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/CDP4Common/AutoGenDto/ITimeStampedThing.cs b/CDP4Common/AutoGenDto/ITimeStampedThing.cs index 9b7b22e9b..78221f874 100644 --- a/CDP4Common/AutoGenDto/ITimeStampedThing.cs +++ b/CDP4Common/AutoGenDto/ITimeStampedThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2021 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -22,6 +23,10 @@ // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -------------------------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + namespace CDP4Common.DTO { using System; @@ -43,3 +48,7 @@ public partial interface ITimeStampedThing DateTime CreatedOn { get; set; } } } + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/CDP4Common/AutoGenDto/IVolatileThing.cs b/CDP4Common/AutoGenDto/IVolatileThing.cs index 6a5c384db..35a2d7677 100644 --- a/CDP4Common/AutoGenDto/IVolatileThing.cs +++ b/CDP4Common/AutoGenDto/IVolatileThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2021 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -22,6 +23,10 @@ // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -------------------------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + namespace CDP4Common.DTO { using System; @@ -43,3 +48,7 @@ public partial interface IVolatileThing bool IsVolatile { get; set; } } } + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/CDP4Common/AutoGenDto/IdCorrespondence.cs b/CDP4Common/AutoGenDto/IdCorrespondence.cs index 1c8c5d8b4..743a9f313 100644 --- a/CDP4Common/AutoGenDto/IdCorrespondence.cs +++ b/CDP4Common/AutoGenDto/IdCorrespondence.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -106,6 +107,59 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/IndependentParameterTypeAssignment.cs b/CDP4Common/AutoGenDto/IndependentParameterTypeAssignment.cs index dd993b301..907d8e934 100644 --- a/CDP4Common/AutoGenDto/IndependentParameterTypeAssignment.cs +++ b/CDP4Common/AutoGenDto/IndependentParameterTypeAssignment.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -93,6 +94,80 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.MeasurementScale != default) + { + dictionary.Add("MeasurementScale", new [] { this.MeasurementScale.Value }); + } + + if (this.ParameterType != default) + { + dictionary.Add("ParameterType", new [] { this.ParameterType }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "MeasurementScale": + this.MeasurementScale = null; + break; + + case "ParameterType": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ParameterType property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/IntervalScale.cs b/CDP4Common/AutoGenDto/IntervalScale.cs index 4f1ac7c19..81dc5f823 100644 --- a/CDP4Common/AutoGenDto/IntervalScale.cs +++ b/CDP4Common/AutoGenDto/IntervalScale.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -78,6 +79,101 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("MappingToReferenceScale", this.MappingToReferenceScale); + + if (this.Unit != default) + { + dictionary.Add("Unit", new [] { this.Unit }); + } + + dictionary.Add("ValueDefinition", this.ValueDefinition); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "MappingToReferenceScale": + this.MappingToReferenceScale.Remove(id); + break; + + case "Unit": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Unit property is not allowed."); + } + break; + + case "ValueDefinition": + this.ValueDefinition.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Iteration.cs b/CDP4Common/AutoGenDto/Iteration.cs index 54bd0bd55..08d257f02 100644 --- a/CDP4Common/AutoGenDto/Iteration.cs +++ b/CDP4Common/AutoGenDto/Iteration.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -295,6 +296,185 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ActualFiniteStateList", this.ActualFiniteStateList); + + if (this.DefaultOption != default) + { + dictionary.Add("DefaultOption", new [] { this.DefaultOption.Value }); + } + + dictionary.Add("DiagramCanvas", this.DiagramCanvas); + + dictionary.Add("DomainFileStore", this.DomainFileStore); + + dictionary.Add("Element", this.Element); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("ExternalIdentifierMap", this.ExternalIdentifierMap); + + dictionary.Add("Goal", this.Goal); + + if (this.IterationSetup != default) + { + dictionary.Add("IterationSetup", new [] { this.IterationSetup }); + } + + dictionary.Add("PossibleFiniteStateList", this.PossibleFiniteStateList); + + dictionary.Add("Publication", this.Publication); + + dictionary.Add("Relationship", this.Relationship); + + dictionary.Add("RequirementsSpecification", this.RequirementsSpecification); + + dictionary.Add("RuleVerificationList", this.RuleVerificationList); + + dictionary.Add("SharedDiagramStyle", this.SharedDiagramStyle); + + dictionary.Add("Stakeholder", this.Stakeholder); + + dictionary.Add("StakeholderValue", this.StakeholderValue); + + dictionary.Add("StakeholderValueMap", this.StakeholderValueMap); + + if (this.TopElement != default) + { + dictionary.Add("TopElement", new [] { this.TopElement.Value }); + } + + dictionary.Add("ValueGroup", this.ValueGroup); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ActualFiniteStateList": + this.ActualFiniteStateList.Remove(id); + break; + + case "DefaultOption": + this.DefaultOption = null; + break; + + case "DiagramCanvas": + this.DiagramCanvas.Remove(id); + break; + + case "DomainFileStore": + this.DomainFileStore.Remove(id); + break; + + case "Element": + this.Element.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "ExternalIdentifierMap": + this.ExternalIdentifierMap.Remove(id); + break; + + case "Goal": + this.Goal.Remove(id); + break; + + case "IterationSetup": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from IterationSetup property is not allowed."); + } + break; + + case "PossibleFiniteStateList": + this.PossibleFiniteStateList.Remove(id); + break; + + case "Publication": + this.Publication.Remove(id); + break; + + case "Relationship": + this.Relationship.Remove(id); + break; + + case "RequirementsSpecification": + this.RequirementsSpecification.Remove(id); + break; + + case "RuleVerificationList": + this.RuleVerificationList.Remove(id); + break; + + case "SharedDiagramStyle": + this.SharedDiagramStyle.Remove(id); + break; + + case "Stakeholder": + this.Stakeholder.Remove(id); + break; + + case "StakeholderValue": + this.StakeholderValue.Remove(id); + break; + + case "StakeholderValueMap": + this.StakeholderValueMap.Remove(id); + break; + + case "TopElement": + this.TopElement = null; + break; + + case "ValueGroup": + this.ValueGroup.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/IterationSetup.cs b/CDP4Common/AutoGenDto/IterationSetup.cs index 973fa18b7..342573a67 100644 --- a/CDP4Common/AutoGenDto/IterationSetup.cs +++ b/CDP4Common/AutoGenDto/IterationSetup.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -127,6 +128,68 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.SourceIterationSetup != default) + { + dictionary.Add("SourceIterationSetup", new [] { this.SourceIterationSetup.Value }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "SourceIterationSetup": + this.SourceIterationSetup = null; + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/LinearConversionUnit.cs b/CDP4Common/AutoGenDto/LinearConversionUnit.cs index 37a8f672d..26e34ede9 100644 --- a/CDP4Common/AutoGenDto/LinearConversionUnit.cs +++ b/CDP4Common/AutoGenDto/LinearConversionUnit.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -78,6 +79,89 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + if (this.ReferenceUnit != default) + { + dictionary.Add("ReferenceUnit", new [] { this.ReferenceUnit }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "ReferenceUnit": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ReferenceUnit property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/LogEntryChangelogItem.cs b/CDP4Common/AutoGenDto/LogEntryChangelogItem.cs index ce2c52c26..66a160d00 100644 --- a/CDP4Common/AutoGenDto/LogEntryChangelogItem.cs +++ b/CDP4Common/AutoGenDto/LogEntryChangelogItem.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -109,6 +110,59 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/LogarithmicScale.cs b/CDP4Common/AutoGenDto/LogarithmicScale.cs index 8c158df99..cfcb21821 100644 --- a/CDP4Common/AutoGenDto/LogarithmicScale.cs +++ b/CDP4Common/AutoGenDto/LogarithmicScale.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -128,6 +129,119 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("MappingToReferenceScale", this.MappingToReferenceScale); + + if (this.ReferenceQuantityKind != default) + { + dictionary.Add("ReferenceQuantityKind", new [] { this.ReferenceQuantityKind }); + } + + dictionary.Add("ReferenceQuantityValue", this.ReferenceQuantityValue); + + if (this.Unit != default) + { + dictionary.Add("Unit", new [] { this.Unit }); + } + + dictionary.Add("ValueDefinition", this.ValueDefinition); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "MappingToReferenceScale": + this.MappingToReferenceScale.Remove(id); + break; + + case "ReferenceQuantityKind": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ReferenceQuantityKind property is not allowed."); + } + break; + + case "ReferenceQuantityValue": + this.ReferenceQuantityValue.Remove(id); + break; + + case "Unit": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Unit property is not allowed."); + } + break; + + case "ValueDefinition": + this.ValueDefinition.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/MappingToReferenceScale.cs b/CDP4Common/AutoGenDto/MappingToReferenceScale.cs index d7ed9e063..a9ef1e1ec 100644 --- a/CDP4Common/AutoGenDto/MappingToReferenceScale.cs +++ b/CDP4Common/AutoGenDto/MappingToReferenceScale.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -92,6 +93,83 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.DependentScaleValue != default) + { + dictionary.Add("DependentScaleValue", new [] { this.DependentScaleValue }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.ReferenceScaleValue != default) + { + dictionary.Add("ReferenceScaleValue", new [] { this.ReferenceScaleValue }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "DependentScaleValue": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from DependentScaleValue property is not allowed."); + } + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "ReferenceScaleValue": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ReferenceScaleValue property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/MeasurementScale.cs b/CDP4Common/AutoGenDto/MeasurementScale.cs index d1a978259..62e282475 100644 --- a/CDP4Common/AutoGenDto/MeasurementScale.cs +++ b/CDP4Common/AutoGenDto/MeasurementScale.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -172,6 +173,101 @@ public override IEnumerable ContainerLists return containers; } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("MappingToReferenceScale", this.MappingToReferenceScale); + + if (this.Unit != default) + { + dictionary.Add("Unit", new [] { this.Unit }); + } + + dictionary.Add("ValueDefinition", this.ValueDefinition); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "MappingToReferenceScale": + this.MappingToReferenceScale.Remove(id); + break; + + case "Unit": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Unit property is not allowed."); + } + break; + + case "ValueDefinition": + this.ValueDefinition.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/MeasurementUnit.cs b/CDP4Common/AutoGenDto/MeasurementUnit.cs index 96c308284..19c7cd37a 100644 --- a/CDP4Common/AutoGenDto/MeasurementUnit.cs +++ b/CDP4Common/AutoGenDto/MeasurementUnit.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -84,6 +85,77 @@ public override string Route { get { return this.ComputedRoute(); } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/ModelLogEntry.cs b/CDP4Common/AutoGenDto/ModelLogEntry.cs index 5f6bac893..3f3e587ff 100644 --- a/CDP4Common/AutoGenDto/ModelLogEntry.cs +++ b/CDP4Common/AutoGenDto/ModelLogEntry.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -150,6 +151,80 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.Author != default) + { + dictionary.Add("Author", new [] { this.Author.Value }); + } + + dictionary.Add("Category", this.Category); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("LogEntryChangelogItem", this.LogEntryChangelogItem); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Author": + this.Author = null; + break; + + case "Category": + this.Category.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "LogEntryChangelogItem": + this.LogEntryChangelogItem.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ModelReferenceDataLibrary.cs b/CDP4Common/AutoGenDto/ModelReferenceDataLibrary.cs index b692817ed..d970df605 100644 --- a/CDP4Common/AutoGenDto/ModelReferenceDataLibrary.cs +++ b/CDP4Common/AutoGenDto/ModelReferenceDataLibrary.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -78,6 +79,152 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("BaseUnit", this.BaseUnit); + + dictionary.Add("Constant", this.Constant); + + dictionary.Add("DefinedCategory", this.DefinedCategory); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("FileType", this.FileType); + + dictionary.Add("Glossary", this.Glossary); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("ParameterType", this.ParameterType); + + dictionary.Add("ReferenceSource", this.ReferenceSource); + + if (this.RequiredRdl != default) + { + dictionary.Add("RequiredRdl", new [] { this.RequiredRdl.Value }); + } + + dictionary.Add("Rule", this.Rule); + + dictionary.Add("Scale", this.Scale); + + dictionary.Add("Unit", this.Unit); + + dictionary.Add("UnitPrefix", this.UnitPrefix); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "BaseUnit": + this.BaseUnit.Remove(id); + break; + + case "Constant": + this.Constant.Remove(id); + break; + + case "DefinedCategory": + this.DefinedCategory.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "FileType": + this.FileType.Remove(id); + break; + + case "Glossary": + this.Glossary.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "ParameterType": + this.ParameterType.Remove(id); + break; + + case "ReferenceSource": + this.ReferenceSource.Remove(id); + break; + + case "RequiredRdl": + this.RequiredRdl = null; + break; + + case "Rule": + this.Rule.Remove(id); + break; + + case "Scale": + this.Scale.Remove(id); + break; + + case "Unit": + this.Unit.Remove(id); + break; + + case "UnitPrefix": + this.UnitPrefix.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ModellingAnnotationItem.cs b/CDP4Common/AutoGenDto/ModellingAnnotationItem.cs index dc7e6c5df..7bdb842cc 100644 --- a/CDP4Common/AutoGenDto/ModellingAnnotationItem.cs +++ b/CDP4Common/AutoGenDto/ModellingAnnotationItem.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -153,6 +154,122 @@ public override IEnumerable ContainerLists return containers; } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ApprovedBy", this.ApprovedBy); + + if (this.Author != default) + { + dictionary.Add("Author", new [] { this.Author }); + } + + dictionary.Add("Category", this.Category); + + dictionary.Add("Discussion", this.Discussion); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + if (this.PrimaryAnnotatedThing != default) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Value }); + } + + dictionary.Add("RelatedThing", this.RelatedThing); + + dictionary.Add("SourceAnnotation", this.SourceAnnotation); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ApprovedBy": + this.ApprovedBy.Remove(id); + break; + + case "Author": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Author property is not allowed."); + } + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Discussion": + this.Discussion.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "PrimaryAnnotatedThing": + this.PrimaryAnnotatedThing = null; + break; + + case "RelatedThing": + this.RelatedThing.Remove(id); + break; + + case "SourceAnnotation": + this.SourceAnnotation.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/ModellingThingReference.cs b/CDP4Common/AutoGenDto/ModellingThingReference.cs index e313dcb0a..29e72731e 100644 --- a/CDP4Common/AutoGenDto/ModellingThingReference.cs +++ b/CDP4Common/AutoGenDto/ModellingThingReference.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -79,6 +80,71 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.ReferencedThing != default) + { + dictionary.Add("ReferencedThing", new [] { this.ReferencedThing }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "ReferencedThing": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ReferencedThing property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/MultiRelationship.cs b/CDP4Common/AutoGenDto/MultiRelationship.cs index 0a09e9fb3..58b08cfe0 100644 --- a/CDP4Common/AutoGenDto/MultiRelationship.cs +++ b/CDP4Common/AutoGenDto/MultiRelationship.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -87,6 +88,89 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Category", this.Category); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + dictionary.Add("ParameterValue", this.ParameterValue); + + dictionary.Add("RelatedThing", this.RelatedThing); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Category": + this.Category.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "ParameterValue": + this.ParameterValue.Remove(id); + break; + + case "RelatedThing": + this.RelatedThing.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/MultiRelationshipRule.cs b/CDP4Common/AutoGenDto/MultiRelationshipRule.cs index acdd4a2e3..d84f3fcda 100644 --- a/CDP4Common/AutoGenDto/MultiRelationshipRule.cs +++ b/CDP4Common/AutoGenDto/MultiRelationshipRule.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -108,6 +109,99 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("RelatedCategory", this.RelatedCategory); + + if (this.RelationshipCategory != default) + { + dictionary.Add("RelationshipCategory", new [] { this.RelationshipCategory }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "RelatedCategory": + if (addModelErrors && this.RelatedCategory.Count == 1) + { + errors.Add($"Remove reference '{id}' from RelatedCategory property is not allowed."); + } + this.RelatedCategory.Remove(id); + break; + + case "RelationshipCategory": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from RelationshipCategory property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/NaturalLanguage.cs b/CDP4Common/AutoGenDto/NaturalLanguage.cs index d26f2d560..754d9eba4 100644 --- a/CDP4Common/AutoGenDto/NaturalLanguage.cs +++ b/CDP4Common/AutoGenDto/NaturalLanguage.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -99,6 +100,59 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/NestedElement.cs b/CDP4Common/AutoGenDto/NestedElement.cs index 2f3b8664d..73b62d287 100644 --- a/CDP4Common/AutoGenDto/NestedElement.cs +++ b/CDP4Common/AutoGenDto/NestedElement.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -165,6 +166,77 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("NestedParameter", this.NestedParameter); + + if (this.RootElement != default) + { + dictionary.Add("RootElement", new [] { this.RootElement }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "NestedParameter": + this.NestedParameter.Remove(id); + break; + + case "RootElement": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from RootElement property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/NestedParameter.cs b/CDP4Common/AutoGenDto/NestedParameter.cs index 036019d3b..270a994bb 100644 --- a/CDP4Common/AutoGenDto/NestedParameter.cs +++ b/CDP4Common/AutoGenDto/NestedParameter.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -134,6 +135,92 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.ActualState != default) + { + dictionary.Add("ActualState", new [] { this.ActualState.Value }); + } + + if (this.AssociatedParameter != default) + { + dictionary.Add("AssociatedParameter", new [] { this.AssociatedParameter }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ActualState": + this.ActualState = null; + break; + + case "AssociatedParameter": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from AssociatedParameter property is not allowed."); + } + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/NotExpression.cs b/CDP4Common/AutoGenDto/NotExpression.cs index b47704689..b254c4c17 100644 --- a/CDP4Common/AutoGenDto/NotExpression.cs +++ b/CDP4Common/AutoGenDto/NotExpression.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -85,6 +86,71 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Term != default) + { + dictionary.Add("Term", new [] { this.Term }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Term": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Term property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Note.cs b/CDP4Common/AutoGenDto/Note.cs index 127045d2d..65b216347 100644 --- a/CDP4Common/AutoGenDto/Note.cs +++ b/CDP4Common/AutoGenDto/Note.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -115,6 +116,77 @@ public override string Route { get { return this.ComputedRoute(); } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Category", this.Category); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Category": + this.Category.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/Option.cs b/CDP4Common/AutoGenDto/Option.cs index 1cf149899..65f22d77a 100644 --- a/CDP4Common/AutoGenDto/Option.cs +++ b/CDP4Common/AutoGenDto/Option.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -109,6 +110,89 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("NestedElement", this.NestedElement); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "NestedElement": + this.NestedElement.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/OrExpression.cs b/CDP4Common/AutoGenDto/OrExpression.cs index 5c3d3271e..39dfec4bd 100644 --- a/CDP4Common/AutoGenDto/OrExpression.cs +++ b/CDP4Common/AutoGenDto/OrExpression.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -87,6 +88,69 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("Term", this.Term); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Term": + if (addModelErrors && this.Term.Count == 1) + { + errors.Add($"Remove reference '{id}' from Term property is not allowed."); + } + this.Term.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/OrdinalScale.cs b/CDP4Common/AutoGenDto/OrdinalScale.cs index d07340d7f..9f51a9a37 100644 --- a/CDP4Common/AutoGenDto/OrdinalScale.cs +++ b/CDP4Common/AutoGenDto/OrdinalScale.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -85,6 +86,101 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("MappingToReferenceScale", this.MappingToReferenceScale); + + if (this.Unit != default) + { + dictionary.Add("Unit", new [] { this.Unit }); + } + + dictionary.Add("ValueDefinition", this.ValueDefinition); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "MappingToReferenceScale": + this.MappingToReferenceScale.Remove(id); + break; + + case "Unit": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Unit property is not allowed."); + } + break; + + case "ValueDefinition": + this.ValueDefinition.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Organization.cs b/CDP4Common/AutoGenDto/Organization.cs index 2c3eb675b..d60bf2f52 100644 --- a/CDP4Common/AutoGenDto/Organization.cs +++ b/CDP4Common/AutoGenDto/Organization.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -99,6 +100,59 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/OrganizationalParticipant.cs b/CDP4Common/AutoGenDto/OrganizationalParticipant.cs index 8f181adce..2a99287a9 100644 --- a/CDP4Common/AutoGenDto/OrganizationalParticipant.cs +++ b/CDP4Common/AutoGenDto/OrganizationalParticipant.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -86,6 +87,71 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Organization != default) + { + dictionary.Add("Organization", new [] { this.Organization }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Organization": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Organization property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/OwnedStyle.cs b/CDP4Common/AutoGenDto/OwnedStyle.cs index dc2006e95..9b28b6b84 100644 --- a/CDP4Common/AutoGenDto/OwnedStyle.cs +++ b/CDP4Common/AutoGenDto/OwnedStyle.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -79,6 +80,92 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.FillColor != default) + { + dictionary.Add("FillColor", new [] { this.FillColor.Value }); + } + + if (this.FontColor != default) + { + dictionary.Add("FontColor", new [] { this.FontColor.Value }); + } + + if (this.StrokeColor != default) + { + dictionary.Add("StrokeColor", new [] { this.StrokeColor.Value }); + } + + dictionary.Add("UsedColor", this.UsedColor); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "FillColor": + this.FillColor = null; + break; + + case "FontColor": + this.FontColor = null; + break; + + case "StrokeColor": + this.StrokeColor = null; + break; + + case "UsedColor": + this.UsedColor.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Page.cs b/CDP4Common/AutoGenDto/Page.cs index 8dc616369..0cd54d1d0 100644 --- a/CDP4Common/AutoGenDto/Page.cs +++ b/CDP4Common/AutoGenDto/Page.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -138,6 +139,77 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Category", this.Category); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Category": + this.Category.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Parameter.cs b/CDP4Common/AutoGenDto/Parameter.cs index 36d97f8bd..945889842 100644 --- a/CDP4Common/AutoGenDto/Parameter.cs +++ b/CDP4Common/AutoGenDto/Parameter.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -121,6 +122,135 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Group != default) + { + dictionary.Add("Group", new [] { this.Group.Value }); + } + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + dictionary.Add("ParameterSubscription", this.ParameterSubscription); + + if (this.ParameterType != default) + { + dictionary.Add("ParameterType", new [] { this.ParameterType }); + } + + if (this.RequestedBy != default) + { + dictionary.Add("RequestedBy", new [] { this.RequestedBy.Value }); + } + + if (this.Scale != default) + { + dictionary.Add("Scale", new [] { this.Scale.Value }); + } + + if (this.StateDependence != default) + { + dictionary.Add("StateDependence", new [] { this.StateDependence.Value }); + } + + dictionary.Add("ValueSet", this.ValueSet); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Group": + this.Group = null; + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "ParameterSubscription": + this.ParameterSubscription.Remove(id); + break; + + case "ParameterType": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ParameterType property is not allowed."); + } + break; + + case "RequestedBy": + this.RequestedBy = null; + break; + + case "Scale": + this.Scale = null; + break; + + case "StateDependence": + this.StateDependence = null; + break; + + case "ValueSet": + if (addModelErrors && this.ValueSet.Count == 1) + { + errors.Add($"Remove reference '{id}' from ValueSet property is not allowed."); + } + this.ValueSet.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ParameterBase.cs b/CDP4Common/AutoGenDto/ParameterBase.cs index 071256ec1..78e75500f 100644 --- a/CDP4Common/AutoGenDto/ParameterBase.cs +++ b/CDP4Common/AutoGenDto/ParameterBase.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -110,6 +111,110 @@ protected ParameterBase(Guid iid, int rev) : base(iid: iid, rev: rev) [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: true, isPersistent: true)] [DataMember] public virtual Guid? StateDependence { get; set; } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Group != default) + { + dictionary.Add("Group", new [] { this.Group.Value }); + } + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + if (this.ParameterType != default) + { + dictionary.Add("ParameterType", new [] { this.ParameterType }); + } + + if (this.Scale != default) + { + dictionary.Add("Scale", new [] { this.Scale.Value }); + } + + if (this.StateDependence != default) + { + dictionary.Add("StateDependence", new [] { this.StateDependence.Value }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Group": + this.Group = null; + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "ParameterType": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ParameterType property is not allowed."); + } + break; + + case "Scale": + this.Scale = null; + break; + + case "StateDependence": + this.StateDependence = null; + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/ParameterGroup.cs b/CDP4Common/AutoGenDto/ParameterGroup.cs index 3c916d9c6..a6974f46c 100644 --- a/CDP4Common/AutoGenDto/ParameterGroup.cs +++ b/CDP4Common/AutoGenDto/ParameterGroup.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -92,6 +93,68 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.ContainingGroup != default) + { + dictionary.Add("ContainingGroup", new [] { this.ContainingGroup.Value }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ContainingGroup": + this.ContainingGroup = null; + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ParameterOrOverrideBase.cs b/CDP4Common/AutoGenDto/ParameterOrOverrideBase.cs index c9b0aa69e..256b9352b 100644 --- a/CDP4Common/AutoGenDto/ParameterOrOverrideBase.cs +++ b/CDP4Common/AutoGenDto/ParameterOrOverrideBase.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -90,6 +91,116 @@ public override IEnumerable ContainerLists return containers; } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Group != default) + { + dictionary.Add("Group", new [] { this.Group.Value }); + } + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + dictionary.Add("ParameterSubscription", this.ParameterSubscription); + + if (this.ParameterType != default) + { + dictionary.Add("ParameterType", new [] { this.ParameterType }); + } + + if (this.Scale != default) + { + dictionary.Add("Scale", new [] { this.Scale.Value }); + } + + if (this.StateDependence != default) + { + dictionary.Add("StateDependence", new [] { this.StateDependence.Value }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Group": + this.Group = null; + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "ParameterSubscription": + this.ParameterSubscription.Remove(id); + break; + + case "ParameterType": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ParameterType property is not allowed."); + } + break; + + case "Scale": + this.Scale = null; + break; + + case "StateDependence": + this.StateDependence = null; + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/ParameterOverride.cs b/CDP4Common/AutoGenDto/ParameterOverride.cs index bdd3dbc03..a2c391a59 100644 --- a/CDP4Common/AutoGenDto/ParameterOverride.cs +++ b/CDP4Common/AutoGenDto/ParameterOverride.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -177,6 +178,99 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + if (this.Parameter != default) + { + dictionary.Add("Parameter", new [] { this.Parameter }); + } + + dictionary.Add("ParameterSubscription", this.ParameterSubscription); + + dictionary.Add("ValueSet", this.ValueSet); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "Parameter": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Parameter property is not allowed."); + } + break; + + case "ParameterSubscription": + this.ParameterSubscription.Remove(id); + break; + + case "ValueSet": + if (addModelErrors && this.ValueSet.Count == 1) + { + errors.Add($"Remove reference '{id}' from ValueSet property is not allowed."); + } + this.ValueSet.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ParameterOverrideValueSet.cs b/CDP4Common/AutoGenDto/ParameterOverrideValueSet.cs index 0b7118950..7356ec9a3 100644 --- a/CDP4Common/AutoGenDto/ParameterOverrideValueSet.cs +++ b/CDP4Common/AutoGenDto/ParameterOverrideValueSet.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -113,6 +114,71 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.ParameterValueSet != default) + { + dictionary.Add("ParameterValueSet", new [] { this.ParameterValueSet }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "ParameterValueSet": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ParameterValueSet property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ParameterSubscription.cs b/CDP4Common/AutoGenDto/ParameterSubscription.cs index 86b9d2e11..c6ca268cc 100644 --- a/CDP4Common/AutoGenDto/ParameterSubscription.cs +++ b/CDP4Common/AutoGenDto/ParameterSubscription.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -170,6 +171,81 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + dictionary.Add("ValueSet", this.ValueSet); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "ValueSet": + if (addModelErrors && this.ValueSet.Count == 1) + { + errors.Add($"Remove reference '{id}' from ValueSet property is not allowed."); + } + this.ValueSet.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ParameterSubscriptionValueSet.cs b/CDP4Common/AutoGenDto/ParameterSubscriptionValueSet.cs index 5f8963415..0dfbe6826 100644 --- a/CDP4Common/AutoGenDto/ParameterSubscriptionValueSet.cs +++ b/CDP4Common/AutoGenDto/ParameterSubscriptionValueSet.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -185,6 +186,71 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.SubscribedValueSet != default) + { + dictionary.Add("SubscribedValueSet", new [] { this.SubscribedValueSet }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "SubscribedValueSet": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from SubscribedValueSet property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ParameterType.cs b/CDP4Common/AutoGenDto/ParameterType.cs index bc9db5023..aec63adb5 100644 --- a/CDP4Common/AutoGenDto/ParameterType.cs +++ b/CDP4Common/AutoGenDto/ParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -114,6 +115,83 @@ public override string Route { get { return this.ComputedRoute(); } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/ParameterTypeComponent.cs b/CDP4Common/AutoGenDto/ParameterTypeComponent.cs index afbce9526..198f82f71 100644 --- a/CDP4Common/AutoGenDto/ParameterTypeComponent.cs +++ b/CDP4Common/AutoGenDto/ParameterTypeComponent.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -99,6 +100,80 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.ParameterType != default) + { + dictionary.Add("ParameterType", new [] { this.ParameterType }); + } + + if (this.Scale != default) + { + dictionary.Add("Scale", new [] { this.Scale.Value }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "ParameterType": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ParameterType property is not allowed."); + } + break; + + case "Scale": + this.Scale = null; + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ParameterValue.cs b/CDP4Common/AutoGenDto/ParameterValue.cs index 74a8f2c81..e35e0d5df 100644 --- a/CDP4Common/AutoGenDto/ParameterValue.cs +++ b/CDP4Common/AutoGenDto/ParameterValue.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -92,6 +93,80 @@ protected ParameterValue(Guid iid, int rev) : base(iid: iid, rev: rev) [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: true, isNullable: false, isPersistent: true)] [DataMember] public virtual ValueArray Value { get; set; } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.ParameterType != default) + { + dictionary.Add("ParameterType", new [] { this.ParameterType }); + } + + if (this.Scale != default) + { + dictionary.Add("Scale", new [] { this.Scale.Value }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "ParameterType": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ParameterType property is not allowed."); + } + break; + + case "Scale": + this.Scale = null; + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/ParameterValueSet.cs b/CDP4Common/AutoGenDto/ParameterValueSet.cs index 02ca9068e..2a4e875a0 100644 --- a/CDP4Common/AutoGenDto/ParameterValueSet.cs +++ b/CDP4Common/AutoGenDto/ParameterValueSet.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -78,6 +79,77 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.ActualOption != default) + { + dictionary.Add("ActualOption", new [] { this.ActualOption.Value }); + } + + if (this.ActualState != default) + { + dictionary.Add("ActualState", new [] { this.ActualState.Value }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ActualOption": + this.ActualOption = null; + break; + + case "ActualState": + this.ActualState = null; + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ParameterValueSetBase.cs b/CDP4Common/AutoGenDto/ParameterValueSetBase.cs index 57282f527..43a61c199 100644 --- a/CDP4Common/AutoGenDto/ParameterValueSetBase.cs +++ b/CDP4Common/AutoGenDto/ParameterValueSetBase.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -162,6 +163,77 @@ public Guid Owner [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] [DataMember] public virtual ParameterSwitchKind ValueSwitch { get; set; } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.ActualOption != default) + { + dictionary.Add("ActualOption", new [] { this.ActualOption.Value }); + } + + if (this.ActualState != default) + { + dictionary.Add("ActualState", new [] { this.ActualState.Value }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ActualOption": + this.ActualOption = null; + break; + + case "ActualState": + this.ActualState = null; + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/ParameterizedCategoryRule.cs b/CDP4Common/AutoGenDto/ParameterizedCategoryRule.cs index 6c8813a4b..cbc67edcc 100644 --- a/CDP4Common/AutoGenDto/ParameterizedCategoryRule.cs +++ b/CDP4Common/AutoGenDto/ParameterizedCategoryRule.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -94,6 +95,99 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + if (this.Category != default) + { + dictionary.Add("Category", new [] { this.Category }); + } + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("ParameterType", this.ParameterType); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Category property is not allowed."); + } + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "ParameterType": + if (addModelErrors && this.ParameterType.Count == 1) + { + errors.Add($"Remove reference '{id}' from ParameterType property is not allowed."); + } + this.ParameterType.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ParametricConstraint.cs b/CDP4Common/AutoGenDto/ParametricConstraint.cs index bf994f674..cbe770842 100644 --- a/CDP4Common/AutoGenDto/ParametricConstraint.cs +++ b/CDP4Common/AutoGenDto/ParametricConstraint.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -121,6 +122,78 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("Expression", this.Expression); + + if (this.TopExpression != default) + { + dictionary.Add("TopExpression", new [] { this.TopExpression.Value }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Expression": + if (addModelErrors && this.Expression.Count == 1) + { + errors.Add($"Remove reference '{id}' from Expression property is not allowed."); + } + this.Expression.Remove(id); + break; + + case "TopExpression": + this.TopExpression = null; + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Participant.cs b/CDP4Common/AutoGenDto/Participant.cs index 2c2588796..21e15ace5 100644 --- a/CDP4Common/AutoGenDto/Participant.cs +++ b/CDP4Common/AutoGenDto/Participant.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -115,6 +116,105 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Domain", this.Domain); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Person != default) + { + dictionary.Add("Person", new [] { this.Person }); + } + + if (this.Role != default) + { + dictionary.Add("Role", new [] { this.Role }); + } + + if (this.SelectedDomain != default) + { + dictionary.Add("SelectedDomain", new [] { this.SelectedDomain }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Domain": + if (addModelErrors && this.Domain.Count == 1) + { + errors.Add($"Remove reference '{id}' from Domain property is not allowed."); + } + this.Domain.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Person": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Person property is not allowed."); + } + break; + + case "Role": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Role property is not allowed."); + } + break; + + case "SelectedDomain": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from SelectedDomain property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ParticipantPermission.cs b/CDP4Common/AutoGenDto/ParticipantPermission.cs index 5d05f3787..2f6ef1bc8 100644 --- a/CDP4Common/AutoGenDto/ParticipantPermission.cs +++ b/CDP4Common/AutoGenDto/ParticipantPermission.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -99,6 +100,59 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ParticipantRole.cs b/CDP4Common/AutoGenDto/ParticipantRole.cs index b28a817ed..d2fd615ff 100644 --- a/CDP4Common/AutoGenDto/ParticipantRole.cs +++ b/CDP4Common/AutoGenDto/ParticipantRole.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -107,6 +108,83 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("ParticipantPermission", this.ParticipantPermission); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "ParticipantPermission": + this.ParticipantPermission.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Person.cs b/CDP4Common/AutoGenDto/Person.cs index b8052ca2d..6cbe41604 100644 --- a/CDP4Common/AutoGenDto/Person.cs +++ b/CDP4Common/AutoGenDto/Person.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -218,6 +219,122 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.DefaultDomain != default) + { + dictionary.Add("DefaultDomain", new [] { this.DefaultDomain.Value }); + } + + if (this.DefaultEmailAddress != default) + { + dictionary.Add("DefaultEmailAddress", new [] { this.DefaultEmailAddress.Value }); + } + + if (this.DefaultTelephoneNumber != default) + { + dictionary.Add("DefaultTelephoneNumber", new [] { this.DefaultTelephoneNumber.Value }); + } + + dictionary.Add("EmailAddress", this.EmailAddress); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Organization != default) + { + dictionary.Add("Organization", new [] { this.Organization.Value }); + } + + if (this.Role != default) + { + dictionary.Add("Role", new [] { this.Role.Value }); + } + + dictionary.Add("TelephoneNumber", this.TelephoneNumber); + + dictionary.Add("UserPreference", this.UserPreference); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "DefaultDomain": + this.DefaultDomain = null; + break; + + case "DefaultEmailAddress": + this.DefaultEmailAddress = null; + break; + + case "DefaultTelephoneNumber": + this.DefaultTelephoneNumber = null; + break; + + case "EmailAddress": + this.EmailAddress.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Organization": + this.Organization = null; + break; + + case "Role": + this.Role = null; + break; + + case "TelephoneNumber": + this.TelephoneNumber.Remove(id); + break; + + case "UserPreference": + this.UserPreference.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/PersonPermission.cs b/CDP4Common/AutoGenDto/PersonPermission.cs index fd83e9a11..c97d576cf 100644 --- a/CDP4Common/AutoGenDto/PersonPermission.cs +++ b/CDP4Common/AutoGenDto/PersonPermission.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -99,6 +100,59 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/PersonRole.cs b/CDP4Common/AutoGenDto/PersonRole.cs index 6cd3c3112..34c09a455 100644 --- a/CDP4Common/AutoGenDto/PersonRole.cs +++ b/CDP4Common/AutoGenDto/PersonRole.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -107,6 +108,83 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("PersonPermission", this.PersonPermission); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "PersonPermission": + this.PersonPermission.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Point.cs b/CDP4Common/AutoGenDto/Point.cs index 43ce94bb4..9cdf7d9ac 100644 --- a/CDP4Common/AutoGenDto/Point.cs +++ b/CDP4Common/AutoGenDto/Point.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -93,6 +94,59 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/PossibleFiniteState.cs b/CDP4Common/AutoGenDto/PossibleFiniteState.cs index 6ea2d7f21..43a4b5f13 100644 --- a/CDP4Common/AutoGenDto/PossibleFiniteState.cs +++ b/CDP4Common/AutoGenDto/PossibleFiniteState.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -92,6 +93,77 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/PossibleFiniteStateList.cs b/CDP4Common/AutoGenDto/PossibleFiniteStateList.cs index d3ecd807e..4cb280992 100644 --- a/CDP4Common/AutoGenDto/PossibleFiniteStateList.cs +++ b/CDP4Common/AutoGenDto/PossibleFiniteStateList.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -123,6 +124,104 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + if (this.DefaultState != default) + { + dictionary.Add("DefaultState", new [] { this.DefaultState.Value }); + } + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "DefaultState": + this.DefaultState = null; + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/PrefixedUnit.cs b/CDP4Common/AutoGenDto/PrefixedUnit.cs index 7eee736ce..1dfee4d19 100644 --- a/CDP4Common/AutoGenDto/PrefixedUnit.cs +++ b/CDP4Common/AutoGenDto/PrefixedUnit.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -127,6 +128,101 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + if (this.Prefix != default) + { + dictionary.Add("Prefix", new [] { this.Prefix }); + } + + if (this.ReferenceUnit != default) + { + dictionary.Add("ReferenceUnit", new [] { this.ReferenceUnit }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "Prefix": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Prefix property is not allowed."); + } + break; + + case "ReferenceUnit": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ReferenceUnit property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Publication.cs b/CDP4Common/AutoGenDto/Publication.cs index 80609544a..f8df09f5a 100644 --- a/CDP4Common/AutoGenDto/Publication.cs +++ b/CDP4Common/AutoGenDto/Publication.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -103,6 +104,71 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Domain", this.Domain); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("PublishedParameter", this.PublishedParameter); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Domain": + this.Domain.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "PublishedParameter": + this.PublishedParameter.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/QuantityKind.cs b/CDP4Common/AutoGenDto/QuantityKind.cs index 4903650a9..bc74351f6 100644 --- a/CDP4Common/AutoGenDto/QuantityKind.cs +++ b/CDP4Common/AutoGenDto/QuantityKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -142,6 +143,101 @@ public override string Route { get { return this.ComputedRoute(); } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + if (this.DefaultScale != default) + { + dictionary.Add("DefaultScale", new [] { this.DefaultScale }); + } + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("PossibleScale", this.PossibleScale); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "DefaultScale": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from DefaultScale property is not allowed."); + } + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "PossibleScale": + this.PossibleScale.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/QuantityKindFactor.cs b/CDP4Common/AutoGenDto/QuantityKindFactor.cs index 753c59d89..842690522 100644 --- a/CDP4Common/AutoGenDto/QuantityKindFactor.cs +++ b/CDP4Common/AutoGenDto/QuantityKindFactor.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -92,6 +93,71 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.QuantityKind != default) + { + dictionary.Add("QuantityKind", new [] { this.QuantityKind }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "QuantityKind": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from QuantityKind property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/RatioScale.cs b/CDP4Common/AutoGenDto/RatioScale.cs index f03c4837f..403fd95aa 100644 --- a/CDP4Common/AutoGenDto/RatioScale.cs +++ b/CDP4Common/AutoGenDto/RatioScale.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -78,6 +79,101 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("MappingToReferenceScale", this.MappingToReferenceScale); + + if (this.Unit != default) + { + dictionary.Add("Unit", new [] { this.Unit }); + } + + dictionary.Add("ValueDefinition", this.ValueDefinition); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "MappingToReferenceScale": + this.MappingToReferenceScale.Remove(id); + break; + + case "Unit": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Unit property is not allowed."); + } + break; + + case "ValueDefinition": + this.ValueDefinition.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ReferenceDataLibrary.cs b/CDP4Common/AutoGenDto/ReferenceDataLibrary.cs index 4e023f8a5..f81dafb2c 100644 --- a/CDP4Common/AutoGenDto/ReferenceDataLibrary.cs +++ b/CDP4Common/AutoGenDto/ReferenceDataLibrary.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -205,6 +206,152 @@ public override IEnumerable ContainerLists return containers; } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("BaseUnit", this.BaseUnit); + + dictionary.Add("Constant", this.Constant); + + dictionary.Add("DefinedCategory", this.DefinedCategory); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("FileType", this.FileType); + + dictionary.Add("Glossary", this.Glossary); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("ParameterType", this.ParameterType); + + dictionary.Add("ReferenceSource", this.ReferenceSource); + + if (this.RequiredRdl != default) + { + dictionary.Add("RequiredRdl", new [] { this.RequiredRdl.Value }); + } + + dictionary.Add("Rule", this.Rule); + + dictionary.Add("Scale", this.Scale); + + dictionary.Add("Unit", this.Unit); + + dictionary.Add("UnitPrefix", this.UnitPrefix); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "BaseUnit": + this.BaseUnit.Remove(id); + break; + + case "Constant": + this.Constant.Remove(id); + break; + + case "DefinedCategory": + this.DefinedCategory.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "FileType": + this.FileType.Remove(id); + break; + + case "Glossary": + this.Glossary.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "ParameterType": + this.ParameterType.Remove(id); + break; + + case "ReferenceSource": + this.ReferenceSource.Remove(id); + break; + + case "RequiredRdl": + this.RequiredRdl = null; + break; + + case "Rule": + this.Rule.Remove(id); + break; + + case "Scale": + this.Scale.Remove(id); + break; + + case "Unit": + this.Unit.Remove(id); + break; + + case "UnitPrefix": + this.UnitPrefix.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/ReferenceSource.cs b/CDP4Common/AutoGenDto/ReferenceSource.cs index 87e9954c0..7c08e21e7 100644 --- a/CDP4Common/AutoGenDto/ReferenceSource.cs +++ b/CDP4Common/AutoGenDto/ReferenceSource.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -143,6 +144,101 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + if (this.PublishedIn != default) + { + dictionary.Add("PublishedIn", new [] { this.PublishedIn.Value }); + } + + if (this.Publisher != default) + { + dictionary.Add("Publisher", new [] { this.Publisher.Value }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "PublishedIn": + this.PublishedIn = null; + break; + + case "Publisher": + this.Publisher = null; + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ReferencerRule.cs b/CDP4Common/AutoGenDto/ReferencerRule.cs index 0c5e8419b..5eb14108b 100644 --- a/CDP4Common/AutoGenDto/ReferencerRule.cs +++ b/CDP4Common/AutoGenDto/ReferencerRule.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -108,6 +109,99 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("ReferencedCategory", this.ReferencedCategory); + + if (this.ReferencingCategory != default) + { + dictionary.Add("ReferencingCategory", new [] { this.ReferencingCategory }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "ReferencedCategory": + if (addModelErrors && this.ReferencedCategory.Count == 1) + { + errors.Add($"Remove reference '{id}' from ReferencedCategory property is not allowed."); + } + this.ReferencedCategory.Remove(id); + break; + + case "ReferencingCategory": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ReferencingCategory property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/RelationalExpression.cs b/CDP4Common/AutoGenDto/RelationalExpression.cs index 74ec0875f..5c2506d57 100644 --- a/CDP4Common/AutoGenDto/RelationalExpression.cs +++ b/CDP4Common/AutoGenDto/RelationalExpression.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -108,6 +109,80 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.ParameterType != default) + { + dictionary.Add("ParameterType", new [] { this.ParameterType }); + } + + if (this.Scale != default) + { + dictionary.Add("Scale", new [] { this.Scale.Value }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "ParameterType": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ParameterType property is not allowed."); + } + break; + + case "Scale": + this.Scale = null; + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Relationship.cs b/CDP4Common/AutoGenDto/Relationship.cs index df54318cd..83159e8dc 100644 --- a/CDP4Common/AutoGenDto/Relationship.cs +++ b/CDP4Common/AutoGenDto/Relationship.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -124,6 +125,83 @@ public override IEnumerable ContainerLists return containers; } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Category", this.Category); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + dictionary.Add("ParameterValue", this.ParameterValue); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Category": + this.Category.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "ParameterValue": + this.ParameterValue.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/RelationshipParameterValue.cs b/CDP4Common/AutoGenDto/RelationshipParameterValue.cs index 3e34945fd..ae3e57d31 100644 --- a/CDP4Common/AutoGenDto/RelationshipParameterValue.cs +++ b/CDP4Common/AutoGenDto/RelationshipParameterValue.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -79,6 +80,80 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.ParameterType != default) + { + dictionary.Add("ParameterType", new [] { this.ParameterType }); + } + + if (this.Scale != default) + { + dictionary.Add("Scale", new [] { this.Scale.Value }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "ParameterType": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ParameterType property is not allowed."); + } + break; + + case "Scale": + this.Scale = null; + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/RequestForDeviation.cs b/CDP4Common/AutoGenDto/RequestForDeviation.cs index 16547133f..a6cc9f5db 100644 --- a/CDP4Common/AutoGenDto/RequestForDeviation.cs +++ b/CDP4Common/AutoGenDto/RequestForDeviation.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -79,6 +80,122 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ApprovedBy", this.ApprovedBy); + + if (this.Author != default) + { + dictionary.Add("Author", new [] { this.Author }); + } + + dictionary.Add("Category", this.Category); + + dictionary.Add("Discussion", this.Discussion); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + if (this.PrimaryAnnotatedThing != default) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Value }); + } + + dictionary.Add("RelatedThing", this.RelatedThing); + + dictionary.Add("SourceAnnotation", this.SourceAnnotation); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ApprovedBy": + this.ApprovedBy.Remove(id); + break; + + case "Author": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Author property is not allowed."); + } + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Discussion": + this.Discussion.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "PrimaryAnnotatedThing": + this.PrimaryAnnotatedThing = null; + break; + + case "RelatedThing": + this.RelatedThing.Remove(id); + break; + + case "SourceAnnotation": + this.SourceAnnotation.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/RequestForWaiver.cs b/CDP4Common/AutoGenDto/RequestForWaiver.cs index 198710579..ab14940fd 100644 --- a/CDP4Common/AutoGenDto/RequestForWaiver.cs +++ b/CDP4Common/AutoGenDto/RequestForWaiver.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -79,6 +80,122 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ApprovedBy", this.ApprovedBy); + + if (this.Author != default) + { + dictionary.Add("Author", new [] { this.Author }); + } + + dictionary.Add("Category", this.Category); + + dictionary.Add("Discussion", this.Discussion); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + if (this.PrimaryAnnotatedThing != default) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Value }); + } + + dictionary.Add("RelatedThing", this.RelatedThing); + + dictionary.Add("SourceAnnotation", this.SourceAnnotation); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ApprovedBy": + this.ApprovedBy.Remove(id); + break; + + case "Author": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Author property is not allowed."); + } + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Discussion": + this.Discussion.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "PrimaryAnnotatedThing": + this.PrimaryAnnotatedThing = null; + break; + + case "RelatedThing": + this.RelatedThing.Remove(id); + break; + + case "SourceAnnotation": + this.SourceAnnotation.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Requirement.cs b/CDP4Common/AutoGenDto/Requirement.cs index 1c2b8863f..227652e43 100644 --- a/CDP4Common/AutoGenDto/Requirement.cs +++ b/CDP4Common/AutoGenDto/Requirement.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -123,6 +124,110 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Group != default) + { + dictionary.Add("Group", new [] { this.Group.Value }); + } + + dictionary.Add("HyperLink", this.HyperLink); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + dictionary.Add("ParameterValue", this.ParameterValue); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Group": + this.Group = null; + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "ParameterValue": + this.ParameterValue.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/RequirementsContainer.cs b/CDP4Common/AutoGenDto/RequirementsContainer.cs index 53e3c8da2..e8240da28 100644 --- a/CDP4Common/AutoGenDto/RequirementsContainer.cs +++ b/CDP4Common/AutoGenDto/RequirementsContainer.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -118,6 +119,107 @@ public override IEnumerable ContainerLists return containers; } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("Group", this.Group); + + dictionary.Add("HyperLink", this.HyperLink); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + dictionary.Add("ParameterValue", this.ParameterValue); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Group": + this.Group.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "ParameterValue": + this.ParameterValue.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/RequirementsContainerParameterValue.cs b/CDP4Common/AutoGenDto/RequirementsContainerParameterValue.cs index 9290e83fd..e834472d7 100644 --- a/CDP4Common/AutoGenDto/RequirementsContainerParameterValue.cs +++ b/CDP4Common/AutoGenDto/RequirementsContainerParameterValue.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -79,6 +80,80 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.ParameterType != default) + { + dictionary.Add("ParameterType", new [] { this.ParameterType }); + } + + if (this.Scale != default) + { + dictionary.Add("Scale", new [] { this.Scale.Value }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "ParameterType": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ParameterType property is not allowed."); + } + break; + + case "Scale": + this.Scale = null; + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/RequirementsGroup.cs b/CDP4Common/AutoGenDto/RequirementsGroup.cs index 09e4abd8e..9e77ba0e8 100644 --- a/CDP4Common/AutoGenDto/RequirementsGroup.cs +++ b/CDP4Common/AutoGenDto/RequirementsGroup.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -78,6 +79,107 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("Group", this.Group); + + dictionary.Add("HyperLink", this.HyperLink); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + dictionary.Add("ParameterValue", this.ParameterValue); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Group": + this.Group.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "ParameterValue": + this.ParameterValue.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/RequirementsSpecification.cs b/CDP4Common/AutoGenDto/RequirementsSpecification.cs index 1e0be96a6..ecb253c28 100644 --- a/CDP4Common/AutoGenDto/RequirementsSpecification.cs +++ b/CDP4Common/AutoGenDto/RequirementsSpecification.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -107,6 +108,113 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("Group", this.Group); + + dictionary.Add("HyperLink", this.HyperLink); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + dictionary.Add("ParameterValue", this.ParameterValue); + + dictionary.Add("Requirement", this.Requirement); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Group": + this.Group.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "ParameterValue": + this.ParameterValue.Remove(id); + break; + + case "Requirement": + this.Requirement.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ReviewItemDiscrepancy.cs b/CDP4Common/AutoGenDto/ReviewItemDiscrepancy.cs index c6c40aee6..c3955632f 100644 --- a/CDP4Common/AutoGenDto/ReviewItemDiscrepancy.cs +++ b/CDP4Common/AutoGenDto/ReviewItemDiscrepancy.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -101,6 +102,128 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ApprovedBy", this.ApprovedBy); + + if (this.Author != default) + { + dictionary.Add("Author", new [] { this.Author }); + } + + dictionary.Add("Category", this.Category); + + dictionary.Add("Discussion", this.Discussion); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + if (this.PrimaryAnnotatedThing != default) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Value }); + } + + dictionary.Add("RelatedThing", this.RelatedThing); + + dictionary.Add("Solution", this.Solution); + + dictionary.Add("SourceAnnotation", this.SourceAnnotation); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ApprovedBy": + this.ApprovedBy.Remove(id); + break; + + case "Author": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Author property is not allowed."); + } + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Discussion": + this.Discussion.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "PrimaryAnnotatedThing": + this.PrimaryAnnotatedThing = null; + break; + + case "RelatedThing": + this.RelatedThing.Remove(id); + break; + + case "Solution": + this.Solution.Remove(id); + break; + + case "SourceAnnotation": + this.SourceAnnotation.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Rule.cs b/CDP4Common/AutoGenDto/Rule.cs index af3eb1d84..83d1432de 100644 --- a/CDP4Common/AutoGenDto/Rule.cs +++ b/CDP4Common/AutoGenDto/Rule.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -84,6 +85,77 @@ public override string Route { get { return this.ComputedRoute(); } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/RuleVerification.cs b/CDP4Common/AutoGenDto/RuleVerification.cs index 27fb081fa..4062eb90f 100644 --- a/CDP4Common/AutoGenDto/RuleVerification.cs +++ b/CDP4Common/AutoGenDto/RuleVerification.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -140,6 +141,59 @@ public override IEnumerable ContainerLists return containers; } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/RuleVerificationList.cs b/CDP4Common/AutoGenDto/RuleVerificationList.cs index a9e977033..b442188dd 100644 --- a/CDP4Common/AutoGenDto/RuleVerificationList.cs +++ b/CDP4Common/AutoGenDto/RuleVerificationList.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -107,6 +108,89 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/RuleViolation.cs b/CDP4Common/AutoGenDto/RuleViolation.cs index c275d748c..641aad567 100644 --- a/CDP4Common/AutoGenDto/RuleViolation.cs +++ b/CDP4Common/AutoGenDto/RuleViolation.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -94,6 +95,59 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/SampledFunctionParameterType.cs b/CDP4Common/AutoGenDto/SampledFunctionParameterType.cs index bf6eb5cfd..285878a30 100644 --- a/CDP4Common/AutoGenDto/SampledFunctionParameterType.cs +++ b/CDP4Common/AutoGenDto/SampledFunctionParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -127,6 +128,83 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ScalarParameterType.cs b/CDP4Common/AutoGenDto/ScalarParameterType.cs index 8f183e05c..6208ef396 100644 --- a/CDP4Common/AutoGenDto/ScalarParameterType.cs +++ b/CDP4Common/AutoGenDto/ScalarParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -77,6 +78,83 @@ public override string Route { get { return this.ComputedRoute(); } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/ScaleReferenceQuantityValue.cs b/CDP4Common/AutoGenDto/ScaleReferenceQuantityValue.cs index a0b159ed5..138df3362 100644 --- a/CDP4Common/AutoGenDto/ScaleReferenceQuantityValue.cs +++ b/CDP4Common/AutoGenDto/ScaleReferenceQuantityValue.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -92,6 +93,71 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Scale != default) + { + dictionary.Add("Scale", new [] { this.Scale }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Scale": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Scale property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ScaleValueDefinition.cs b/CDP4Common/AutoGenDto/ScaleValueDefinition.cs index 068aa9fe0..8d95fa32e 100644 --- a/CDP4Common/AutoGenDto/ScaleValueDefinition.cs +++ b/CDP4Common/AutoGenDto/ScaleValueDefinition.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -85,6 +86,77 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Section.cs b/CDP4Common/AutoGenDto/Section.cs index e28a03dc7..e472dc5c4 100644 --- a/CDP4Common/AutoGenDto/Section.cs +++ b/CDP4Common/AutoGenDto/Section.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -138,6 +139,77 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Category", this.Category); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Category": + this.Category.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/SharedStyle.cs b/CDP4Common/AutoGenDto/SharedStyle.cs index 91d3c2a4f..83d4309f6 100644 --- a/CDP4Common/AutoGenDto/SharedStyle.cs +++ b/CDP4Common/AutoGenDto/SharedStyle.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -79,6 +80,92 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.FillColor != default) + { + dictionary.Add("FillColor", new [] { this.FillColor.Value }); + } + + if (this.FontColor != default) + { + dictionary.Add("FontColor", new [] { this.FontColor.Value }); + } + + if (this.StrokeColor != default) + { + dictionary.Add("StrokeColor", new [] { this.StrokeColor.Value }); + } + + dictionary.Add("UsedColor", this.UsedColor); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "FillColor": + this.FillColor = null; + break; + + case "FontColor": + this.FontColor = null; + break; + + case "StrokeColor": + this.StrokeColor = null; + break; + + case "UsedColor": + this.UsedColor.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/SimpleParameterValue.cs b/CDP4Common/AutoGenDto/SimpleParameterValue.cs index e3b84ea72..9e365f249 100644 --- a/CDP4Common/AutoGenDto/SimpleParameterValue.cs +++ b/CDP4Common/AutoGenDto/SimpleParameterValue.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -115,6 +116,80 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.ParameterType != default) + { + dictionary.Add("ParameterType", new [] { this.ParameterType }); + } + + if (this.Scale != default) + { + dictionary.Add("Scale", new [] { this.Scale.Value }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "ParameterType": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ParameterType property is not allowed."); + } + break; + + case "Scale": + this.Scale = null; + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/SimpleParameterizableThing.cs b/CDP4Common/AutoGenDto/SimpleParameterizableThing.cs index 0f3de300f..5228bde0a 100644 --- a/CDP4Common/AutoGenDto/SimpleParameterizableThing.cs +++ b/CDP4Common/AutoGenDto/SimpleParameterizableThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -97,6 +98,95 @@ public override IEnumerable ContainerLists return containers; } } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + dictionary.Add("ParameterValue", this.ParameterValue); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + + case "ParameterValue": + this.ParameterValue.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/SimpleQuantityKind.cs b/CDP4Common/AutoGenDto/SimpleQuantityKind.cs index 582d9cb4f..b806249c3 100644 --- a/CDP4Common/AutoGenDto/SimpleQuantityKind.cs +++ b/CDP4Common/AutoGenDto/SimpleQuantityKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -78,6 +79,101 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + if (this.DefaultScale != default) + { + dictionary.Add("DefaultScale", new [] { this.DefaultScale }); + } + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("PossibleScale", this.PossibleScale); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "DefaultScale": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from DefaultScale property is not allowed."); + } + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "PossibleScale": + this.PossibleScale.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/SimpleUnit.cs b/CDP4Common/AutoGenDto/SimpleUnit.cs index 84bd86790..16f0fccc4 100644 --- a/CDP4Common/AutoGenDto/SimpleUnit.cs +++ b/CDP4Common/AutoGenDto/SimpleUnit.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -78,6 +79,77 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/SiteDirectory.cs b/CDP4Common/AutoGenDto/SiteDirectory.cs index 055cdf4e3..6f555025f 100644 --- a/CDP4Common/AutoGenDto/SiteDirectory.cs +++ b/CDP4Common/AutoGenDto/SiteDirectory.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -235,6 +236,143 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Annotation", this.Annotation); + + if (this.DefaultParticipantRole != default) + { + dictionary.Add("DefaultParticipantRole", new [] { this.DefaultParticipantRole.Value }); + } + + if (this.DefaultPersonRole != default) + { + dictionary.Add("DefaultPersonRole", new [] { this.DefaultPersonRole.Value }); + } + + dictionary.Add("Domain", this.Domain); + + dictionary.Add("DomainGroup", this.DomainGroup); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("LogEntry", this.LogEntry); + + dictionary.Add("Model", this.Model); + + dictionary.Add("NaturalLanguage", this.NaturalLanguage); + + dictionary.Add("Organization", this.Organization); + + dictionary.Add("ParticipantRole", this.ParticipantRole); + + dictionary.Add("Person", this.Person); + + dictionary.Add("PersonRole", this.PersonRole); + + dictionary.Add("SiteReferenceDataLibrary", this.SiteReferenceDataLibrary); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Annotation": + this.Annotation.Remove(id); + break; + + case "DefaultParticipantRole": + this.DefaultParticipantRole = null; + break; + + case "DefaultPersonRole": + this.DefaultPersonRole = null; + break; + + case "Domain": + this.Domain.Remove(id); + break; + + case "DomainGroup": + this.DomainGroup.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "LogEntry": + this.LogEntry.Remove(id); + break; + + case "Model": + this.Model.Remove(id); + break; + + case "NaturalLanguage": + this.NaturalLanguage.Remove(id); + break; + + case "Organization": + this.Organization.Remove(id); + break; + + case "ParticipantRole": + this.ParticipantRole.Remove(id); + break; + + case "Person": + this.Person.Remove(id); + break; + + case "PersonRole": + this.PersonRole.Remove(id); + break; + + case "SiteReferenceDataLibrary": + this.SiteReferenceDataLibrary.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/SiteDirectoryDataAnnotation.cs b/CDP4Common/AutoGenDto/SiteDirectoryDataAnnotation.cs index 9a535840d..394412c59 100644 --- a/CDP4Common/AutoGenDto/SiteDirectoryDataAnnotation.cs +++ b/CDP4Common/AutoGenDto/SiteDirectoryDataAnnotation.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -125,6 +126,99 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.Author != default) + { + dictionary.Add("Author", new [] { this.Author }); + } + + dictionary.Add("Discussion", this.Discussion); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.PrimaryAnnotatedThing != default) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing }); + } + + dictionary.Add("RelatedThing", this.RelatedThing); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Author": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Author property is not allowed."); + } + break; + + case "Discussion": + this.Discussion.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "PrimaryAnnotatedThing": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from PrimaryAnnotatedThing property is not allowed."); + } + break; + + case "RelatedThing": + if (addModelErrors && this.RelatedThing.Count == 1) + { + errors.Add($"Remove reference '{id}' from RelatedThing property is not allowed."); + } + this.RelatedThing.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/SiteDirectoryDataDiscussionItem.cs b/CDP4Common/AutoGenDto/SiteDirectoryDataDiscussionItem.cs index c94c4b191..9c435a5dc 100644 --- a/CDP4Common/AutoGenDto/SiteDirectoryDataDiscussionItem.cs +++ b/CDP4Common/AutoGenDto/SiteDirectoryDataDiscussionItem.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -86,6 +87,80 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.Author != default) + { + dictionary.Add("Author", new [] { this.Author }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.ReplyTo != default) + { + dictionary.Add("ReplyTo", new [] { this.ReplyTo.Value }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Author": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Author property is not allowed."); + } + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "ReplyTo": + this.ReplyTo = null; + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/SiteDirectoryThingReference.cs b/CDP4Common/AutoGenDto/SiteDirectoryThingReference.cs index 0aebb9be7..ff2e99a7c 100644 --- a/CDP4Common/AutoGenDto/SiteDirectoryThingReference.cs +++ b/CDP4Common/AutoGenDto/SiteDirectoryThingReference.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -79,6 +80,71 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.ReferencedThing != default) + { + dictionary.Add("ReferencedThing", new [] { this.ReferencedThing }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "ReferencedThing": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ReferencedThing property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/SiteLogEntry.cs b/CDP4Common/AutoGenDto/SiteLogEntry.cs index 861770079..e35ecc2cd 100644 --- a/CDP4Common/AutoGenDto/SiteLogEntry.cs +++ b/CDP4Common/AutoGenDto/SiteLogEntry.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -150,6 +151,80 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.Author != default) + { + dictionary.Add("Author", new [] { this.Author.Value }); + } + + dictionary.Add("Category", this.Category); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("LogEntryChangelogItem", this.LogEntryChangelogItem); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Author": + this.Author = null; + break; + + case "Category": + this.Category.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "LogEntryChangelogItem": + this.LogEntryChangelogItem.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/SiteReferenceDataLibrary.cs b/CDP4Common/AutoGenDto/SiteReferenceDataLibrary.cs index 825a646ee..baea85590 100644 --- a/CDP4Common/AutoGenDto/SiteReferenceDataLibrary.cs +++ b/CDP4Common/AutoGenDto/SiteReferenceDataLibrary.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -85,6 +86,152 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("BaseUnit", this.BaseUnit); + + dictionary.Add("Constant", this.Constant); + + dictionary.Add("DefinedCategory", this.DefinedCategory); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("FileType", this.FileType); + + dictionary.Add("Glossary", this.Glossary); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("ParameterType", this.ParameterType); + + dictionary.Add("ReferenceSource", this.ReferenceSource); + + if (this.RequiredRdl != default) + { + dictionary.Add("RequiredRdl", new [] { this.RequiredRdl.Value }); + } + + dictionary.Add("Rule", this.Rule); + + dictionary.Add("Scale", this.Scale); + + dictionary.Add("Unit", this.Unit); + + dictionary.Add("UnitPrefix", this.UnitPrefix); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "BaseUnit": + this.BaseUnit.Remove(id); + break; + + case "Constant": + this.Constant.Remove(id); + break; + + case "DefinedCategory": + this.DefinedCategory.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "FileType": + this.FileType.Remove(id); + break; + + case "Glossary": + this.Glossary.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "ParameterType": + this.ParameterType.Remove(id); + break; + + case "ReferenceSource": + this.ReferenceSource.Remove(id); + break; + + case "RequiredRdl": + this.RequiredRdl = null; + break; + + case "Rule": + this.Rule.Remove(id); + break; + + case "Scale": + this.Scale.Remove(id); + break; + + case "Unit": + this.Unit.Remove(id); + break; + + case "UnitPrefix": + this.UnitPrefix.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Solution.cs b/CDP4Common/AutoGenDto/Solution.cs index 6d0a186c6..30f6faaa4 100644 --- a/CDP4Common/AutoGenDto/Solution.cs +++ b/CDP4Common/AutoGenDto/Solution.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -93,6 +94,83 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.Author != default) + { + dictionary.Add("Author", new [] { this.Author }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Author": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Author property is not allowed."); + } + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/SpecializedQuantityKind.cs b/CDP4Common/AutoGenDto/SpecializedQuantityKind.cs index 94c6c361b..14c91b473 100644 --- a/CDP4Common/AutoGenDto/SpecializedQuantityKind.cs +++ b/CDP4Common/AutoGenDto/SpecializedQuantityKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -85,6 +86,113 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + if (this.DefaultScale != default) + { + dictionary.Add("DefaultScale", new [] { this.DefaultScale }); + } + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.General != default) + { + dictionary.Add("General", new [] { this.General }); + } + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("PossibleScale", this.PossibleScale); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "DefaultScale": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from DefaultScale property is not allowed."); + } + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "General": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from General property is not allowed."); + } + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "PossibleScale": + this.PossibleScale.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/StakeHolderValueMap.cs b/CDP4Common/AutoGenDto/StakeHolderValueMap.cs index f8ba1aee9..ef7542957 100644 --- a/CDP4Common/AutoGenDto/StakeHolderValueMap.cs +++ b/CDP4Common/AutoGenDto/StakeHolderValueMap.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -146,6 +147,117 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("Goal", this.Goal); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("Requirement", this.Requirement); + + dictionary.Add("Settings", this.Settings); + + dictionary.Add("StakeholderValue", this.StakeholderValue); + + dictionary.Add("ValueGroup", this.ValueGroup); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Goal": + this.Goal.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "Requirement": + this.Requirement.Remove(id); + break; + + case "Settings": + if (addModelErrors && this.Settings.Count == 1) + { + errors.Add($"Remove reference '{id}' from Settings property is not allowed."); + } + this.Settings.Remove(id); + break; + + case "StakeholderValue": + this.StakeholderValue.Remove(id); + break; + + case "ValueGroup": + this.ValueGroup.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/StakeHolderValueMapSettings.cs b/CDP4Common/AutoGenDto/StakeHolderValueMapSettings.cs index 11b49ff89..181856026 100644 --- a/CDP4Common/AutoGenDto/StakeHolderValueMapSettings.cs +++ b/CDP4Common/AutoGenDto/StakeHolderValueMapSettings.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -100,6 +101,86 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.GoalToValueGroupRelationship != default) + { + dictionary.Add("GoalToValueGroupRelationship", new [] { this.GoalToValueGroupRelationship.Value }); + } + + if (this.StakeholderValueToRequirementRelationship != default) + { + dictionary.Add("StakeholderValueToRequirementRelationship", new [] { this.StakeholderValueToRequirementRelationship.Value }); + } + + if (this.ValueGroupToStakeholderValueRelationship != default) + { + dictionary.Add("ValueGroupToStakeholderValueRelationship", new [] { this.ValueGroupToStakeholderValueRelationship.Value }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "GoalToValueGroupRelationship": + this.GoalToValueGroupRelationship = null; + break; + + case "StakeholderValueToRequirementRelationship": + this.StakeholderValueToRequirementRelationship = null; + break; + + case "ValueGroupToStakeholderValueRelationship": + this.ValueGroupToStakeholderValueRelationship = null; + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Stakeholder.cs b/CDP4Common/AutoGenDto/Stakeholder.cs index ec1b623db..bcb9cdf9e 100644 --- a/CDP4Common/AutoGenDto/Stakeholder.cs +++ b/CDP4Common/AutoGenDto/Stakeholder.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -97,6 +98,89 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + dictionary.Add("StakeholderValue", this.StakeholderValue); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + + case "StakeholderValue": + this.StakeholderValue.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/StakeholderValue.cs b/CDP4Common/AutoGenDto/StakeholderValue.cs index 11c593e62..213ef30b3 100644 --- a/CDP4Common/AutoGenDto/StakeholderValue.cs +++ b/CDP4Common/AutoGenDto/StakeholderValue.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -88,6 +89,83 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/TelephoneNumber.cs b/CDP4Common/AutoGenDto/TelephoneNumber.cs index 9b7b05d5c..d83002cd3 100644 --- a/CDP4Common/AutoGenDto/TelephoneNumber.cs +++ b/CDP4Common/AutoGenDto/TelephoneNumber.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -94,6 +95,59 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/Term.cs b/CDP4Common/AutoGenDto/Term.cs index 2524a3c88..6fdbcdeae 100644 --- a/CDP4Common/AutoGenDto/Term.cs +++ b/CDP4Common/AutoGenDto/Term.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -85,6 +86,77 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/TextParameterType.cs b/CDP4Common/AutoGenDto/TextParameterType.cs index 5bcbbc294..d77169781 100644 --- a/CDP4Common/AutoGenDto/TextParameterType.cs +++ b/CDP4Common/AutoGenDto/TextParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -78,6 +79,83 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/TextualNote.cs b/CDP4Common/AutoGenDto/TextualNote.cs index 66bdc2b2e..9868c9c34 100644 --- a/CDP4Common/AutoGenDto/TextualNote.cs +++ b/CDP4Common/AutoGenDto/TextualNote.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -93,6 +94,77 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Category", this.Category); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Owner != default) + { + dictionary.Add("Owner", new [] { this.Owner }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Category": + this.Category.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Owner": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Owner property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ThingReference.cs b/CDP4Common/AutoGenDto/ThingReference.cs index 675289ebd..c60a043d8 100644 --- a/CDP4Common/AutoGenDto/ThingReference.cs +++ b/CDP4Common/AutoGenDto/ThingReference.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -83,6 +84,71 @@ protected ThingReference(Guid iid, int rev) : base(iid: iid, rev: rev) [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] [DataMember] public virtual Guid ReferencedThing { get; set; } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.ReferencedThing != default) + { + dictionary.Add("ReferencedThing", new [] { this.ReferencedThing }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "ReferencedThing": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from ReferencedThing property is not allowed."); + } + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/TimeOfDayParameterType.cs b/CDP4Common/AutoGenDto/TimeOfDayParameterType.cs index 265598b5a..0f47bac22 100644 --- a/CDP4Common/AutoGenDto/TimeOfDayParameterType.cs +++ b/CDP4Common/AutoGenDto/TimeOfDayParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -78,6 +79,83 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/TopContainer.cs b/CDP4Common/AutoGenDto/TopContainer.cs index 85a3c2cdb..753b44025 100644 --- a/CDP4Common/AutoGenDto/TopContainer.cs +++ b/CDP4Common/AutoGenDto/TopContainer.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -75,6 +76,59 @@ protected TopContainer(Guid iid, int rev) : base(iid: iid, rev: rev) [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] [DataMember] public virtual DateTime LastModifiedOn { get; set; } + + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } } } diff --git a/CDP4Common/AutoGenDto/UnitFactor.cs b/CDP4Common/AutoGenDto/UnitFactor.cs index baeb90d36..f6b6178ef 100644 --- a/CDP4Common/AutoGenDto/UnitFactor.cs +++ b/CDP4Common/AutoGenDto/UnitFactor.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -92,6 +93,71 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Unit != default) + { + dictionary.Add("Unit", new [] { this.Unit }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Unit": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Unit property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/UnitPrefix.cs b/CDP4Common/AutoGenDto/UnitPrefix.cs index e6632bcd0..9e8283c56 100644 --- a/CDP4Common/AutoGenDto/UnitPrefix.cs +++ b/CDP4Common/AutoGenDto/UnitPrefix.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -92,6 +93,77 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/UserPreference.cs b/CDP4Common/AutoGenDto/UserPreference.cs index 309739940..334c52477 100644 --- a/CDP4Common/AutoGenDto/UserPreference.cs +++ b/CDP4Common/AutoGenDto/UserPreference.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -92,6 +93,59 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/UserRuleVerification.cs b/CDP4Common/AutoGenDto/UserRuleVerification.cs index f0c8fb80c..38a89dea0 100644 --- a/CDP4Common/AutoGenDto/UserRuleVerification.cs +++ b/CDP4Common/AutoGenDto/UserRuleVerification.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -99,6 +100,71 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + if (this.Rule != default) + { + dictionary.Add("Rule", new [] { this.Rule }); + } + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "Rule": + if (addModelErrors) + { + errors.Add($"Remove reference '{id}' from Rule property is not allowed."); + } + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenDto/ValueGroup.cs b/CDP4Common/AutoGenDto/ValueGroup.cs index 0a20c4676..5d10b4bb9 100644 --- a/CDP4Common/AutoGenDto/ValueGroup.cs +++ b/CDP4Common/AutoGenDto/ValueGroup.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -88,6 +89,83 @@ public override string Route get { return this.ComputedRoute(); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias); + + dictionary.Add("Category", this.Category); + + dictionary.Add("Definition", this.Definition); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson); + + dictionary.Add("HyperLink", this.HyperLink); + + return dictionary; + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public override bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = new List(); + var referencedProperties = this.GetReferenceProperties(); + var addModelErrors = !ids.Contains(this.Iid); + var result = true; + + foreach (var id in ids) + { + var foundProperty = referencedProperties.Where(x => x.Value.Contains(id)).ToList(); + + if (foundProperty.Any()) + { + foreach (var kvp in foundProperty) + { + switch (kvp.Key) + { + case "Alias": + this.Alias.Remove(id); + break; + + case "Category": + this.Category.Remove(id); + break; + + case "Definition": + this.Definition.Remove(id); + break; + + case "ExcludedDomain": + this.ExcludedDomain.Remove(id); + break; + + case "ExcludedPerson": + this.ExcludedPerson.Remove(id); + break; + + case "HyperLink": + this.HyperLink.Remove(id); + break; + } + } + } + } + + return result; + } + /// /// Instantiate a from a /// diff --git a/CDP4Common/AutoGenPoco/ActionItem.cs b/CDP4Common/AutoGenPoco/ActionItem.cs index 837f657c9..882a45e41 100644 --- a/CDP4Common/AutoGenPoco/ActionItem.cs +++ b/CDP4Common/AutoGenPoco/ActionItem.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -120,6 +121,95 @@ public ActionItem(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.Actionee != null) + { + dictionary.Add("Actionee", new [] { this.Actionee.Iid }); + } + + dictionary.Add("ApprovedBy", this.ApprovedBy.Select(x => x.Iid)); + + if (this.Author != null) + { + dictionary.Add("Author", new [] { this.Author.Iid }); + } + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Discussion", this.Discussion.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + if (this.PrimaryAnnotatedThing != null) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Iid }); + } + + dictionary.Add("RelatedThing", this.RelatedThing.Select(x => x.Iid)); + + dictionary.Add("SourceAnnotation", this.SourceAnnotation.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Actionee": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Author": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ActualFiniteState.cs b/CDP4Common/AutoGenPoco/ActualFiniteState.cs index 6fb18a8ff..a909cc3e2 100644 --- a/CDP4Common/AutoGenPoco/ActualFiniteState.cs +++ b/CDP4Common/AutoGenPoco/ActualFiniteState.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -154,6 +155,47 @@ public string ShortName set { throw new InvalidOperationException("Forbidden Set value for the derived property ActualFiniteState.ShortName"); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("PossibleState", this.PossibleState.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ActualFiniteStateKind.cs b/CDP4Common/AutoGenPoco/ActualFiniteStateKind.cs index 15d9d02bd..bb203b306 100644 --- a/CDP4Common/AutoGenPoco/ActualFiniteStateKind.cs +++ b/CDP4Common/AutoGenPoco/ActualFiniteStateKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/ActualFiniteStateList.cs b/CDP4Common/AutoGenPoco/ActualFiniteStateList.cs index c8786dd7f..5895854e7 100644 --- a/CDP4Common/AutoGenPoco/ActualFiniteStateList.cs +++ b/CDP4Common/AutoGenPoco/ActualFiniteStateList.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -175,6 +176,62 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ActualState", this.ActualState.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("ExcludeOption", this.ExcludeOption.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + dictionary.Add("PossibleFiniteStateList", this.PossibleFiniteStateList.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/Alias.cs b/CDP4Common/AutoGenPoco/Alias.cs index 0504a2f4e..2987c4962 100644 --- a/CDP4Common/AutoGenPoco/Alias.cs +++ b/CDP4Common/AutoGenPoco/Alias.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -113,6 +114,45 @@ public Alias(Guid iid, ConcurrentDictionary> ca [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] public string LanguageCode { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/AndExpression.cs b/CDP4Common/AutoGenPoco/AndExpression.cs index 61d56c6da..c838e7bed 100644 --- a/CDP4Common/AutoGenPoco/AndExpression.cs +++ b/CDP4Common/AutoGenPoco/AndExpression.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -95,6 +96,47 @@ public AndExpression(Guid iid, ConcurrentDictionary Term { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("Term", this.Term.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/AnnotationApprovalKind.cs b/CDP4Common/AutoGenPoco/AnnotationApprovalKind.cs index ae994e14a..5b351f3f9 100644 --- a/CDP4Common/AutoGenPoco/AnnotationApprovalKind.cs +++ b/CDP4Common/AutoGenPoco/AnnotationApprovalKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/AnnotationClassificationKind.cs b/CDP4Common/AutoGenPoco/AnnotationClassificationKind.cs index 5d5b919bc..1b5d5ae2d 100644 --- a/CDP4Common/AutoGenPoco/AnnotationClassificationKind.cs +++ b/CDP4Common/AutoGenPoco/AnnotationClassificationKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/AnnotationStatusKind.cs b/CDP4Common/AutoGenPoco/AnnotationStatusKind.cs index 035e02d1c..5da758e89 100644 --- a/CDP4Common/AutoGenPoco/AnnotationStatusKind.cs +++ b/CDP4Common/AutoGenPoco/AnnotationStatusKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/Approval.cs b/CDP4Common/AutoGenPoco/Approval.cs index b4b50367c..047ede446 100644 --- a/CDP4Common/AutoGenPoco/Approval.cs +++ b/CDP4Common/AutoGenPoco/Approval.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -112,6 +113,68 @@ public Approval(Guid iid, ConcurrentDictionary> [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] public DomainOfExpertise Owner { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.Author != null) + { + dictionary.Add("Author", new [] { this.Author.Iid }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Author": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ArrayParameterType.cs b/CDP4Common/AutoGenPoco/ArrayParameterType.cs index b6f535f77..3772c35e9 100644 --- a/CDP4Common/AutoGenPoco/ArrayParameterType.cs +++ b/CDP4Common/AutoGenPoco/ArrayParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -147,6 +148,55 @@ public int Rank set { throw new InvalidOperationException("Forbidden Set value for the derived property ArrayParameterType.Rank"); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Component", this.Component.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/BinaryNote.cs b/CDP4Common/AutoGenPoco/BinaryNote.cs index e5b53d906..3f6614cdf 100644 --- a/CDP4Common/AutoGenPoco/BinaryNote.cs +++ b/CDP4Common/AutoGenPoco/BinaryNote.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -102,6 +103,70 @@ public BinaryNote(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.FileType != null) + { + dictionary.Add("FileType", new [] { this.FileType.Iid }); + } + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "FileType": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/BinaryRelationship.cs b/CDP4Common/AutoGenPoco/BinaryRelationship.cs index 9c300911b..17dc80efb 100644 --- a/CDP4Common/AutoGenPoco/BinaryRelationship.cs +++ b/CDP4Common/AutoGenPoco/BinaryRelationship.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -102,6 +103,84 @@ public BinaryRelationship(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + dictionary.Add("ParameterValue", this.ParameterValue.Select(x => x.Iid)); + + if (this.Source != null) + { + dictionary.Add("Source", new [] { this.Source.Iid }); + } + + if (this.Target != null) + { + dictionary.Add("Target", new [] { this.Target.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Source": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Target": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/BinaryRelationshipRule.cs b/CDP4Common/AutoGenPoco/BinaryRelationshipRule.cs index 34c61fd07..9ce2af24a 100644 --- a/CDP4Common/AutoGenPoco/BinaryRelationshipRule.cs +++ b/CDP4Common/AutoGenPoco/BinaryRelationshipRule.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -132,6 +133,86 @@ public BinaryRelationshipRule(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + if (this.RelationshipCategory != null) + { + dictionary.Add("RelationshipCategory", new [] { this.RelationshipCategory.Iid }); + } + + if (this.SourceCategory != null) + { + dictionary.Add("SourceCategory", new [] { this.SourceCategory.Iid }); + } + + if (this.TargetCategory != null) + { + dictionary.Add("TargetCategory", new [] { this.TargetCategory.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "RelationshipCategory": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "SourceCategory": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "TargetCategory": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/Book.cs b/CDP4Common/AutoGenPoco/Book.cs index f50a20890..ccef96349 100644 --- a/CDP4Common/AutoGenPoco/Book.cs +++ b/CDP4Common/AutoGenPoco/Book.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -162,6 +163,60 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + dictionary.Add("Section", this.Section.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/BooleanExpression.cs b/CDP4Common/AutoGenPoco/BooleanExpression.cs index 281b64229..ff535a9a5 100644 --- a/CDP4Common/AutoGenPoco/BooleanExpression.cs +++ b/CDP4Common/AutoGenPoco/BooleanExpression.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -84,6 +85,45 @@ protected BooleanExpression(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/BooleanOperatorKind.cs b/CDP4Common/AutoGenPoco/BooleanOperatorKind.cs index aeb468703..f4373717d 100644 --- a/CDP4Common/AutoGenPoco/BooleanOperatorKind.cs +++ b/CDP4Common/AutoGenPoco/BooleanOperatorKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/BooleanParameterType.cs b/CDP4Common/AutoGenPoco/BooleanParameterType.cs index eed3fa079..c374791d1 100644 --- a/CDP4Common/AutoGenPoco/BooleanParameterType.cs +++ b/CDP4Common/AutoGenPoco/BooleanParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -84,6 +85,53 @@ public BooleanParameterType(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/Bounds.cs b/CDP4Common/AutoGenPoco/Bounds.cs index d9791e541..e217860e1 100644 --- a/CDP4Common/AutoGenPoco/Bounds.cs +++ b/CDP4Common/AutoGenPoco/Bounds.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -120,6 +121,45 @@ public Bounds(Guid iid, ConcurrentDictionary> c [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] public float Y { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/BuiltInRuleVerification.cs b/CDP4Common/AutoGenPoco/BuiltInRuleVerification.cs index 53b0552cf..8c79da0d4 100644 --- a/CDP4Common/AutoGenPoco/BuiltInRuleVerification.cs +++ b/CDP4Common/AutoGenPoco/BuiltInRuleVerification.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -84,6 +85,45 @@ public BuiltInRuleVerification(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/Category.cs b/CDP4Common/AutoGenPoco/Category.cs index 8b880bbc8..29393d020 100644 --- a/CDP4Common/AutoGenPoco/Category.cs +++ b/CDP4Common/AutoGenPoco/Category.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -139,6 +140,53 @@ public Category(Guid iid, ConcurrentDictionary> [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] public List SuperCategory { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("SuperCategory", this.SuperCategory.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ChangeProposal.cs b/CDP4Common/AutoGenPoco/ChangeProposal.cs index 0f885c240..d9eae4b18 100644 --- a/CDP4Common/AutoGenPoco/ChangeProposal.cs +++ b/CDP4Common/AutoGenPoco/ChangeProposal.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -93,6 +94,95 @@ public ChangeProposal(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ApprovedBy", this.ApprovedBy.Select(x => x.Iid)); + + if (this.Author != null) + { + dictionary.Add("Author", new [] { this.Author.Iid }); + } + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + if (this.ChangeRequest != null) + { + dictionary.Add("ChangeRequest", new [] { this.ChangeRequest.Iid }); + } + + dictionary.Add("Discussion", this.Discussion.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + if (this.PrimaryAnnotatedThing != null) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Iid }); + } + + dictionary.Add("RelatedThing", this.RelatedThing.Select(x => x.Iid)); + + dictionary.Add("SourceAnnotation", this.SourceAnnotation.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Author": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "ChangeRequest": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ChangeRequest.cs b/CDP4Common/AutoGenPoco/ChangeRequest.cs index d42f1b7f8..5a7834226 100644 --- a/CDP4Common/AutoGenPoco/ChangeRequest.cs +++ b/CDP4Common/AutoGenPoco/ChangeRequest.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -86,6 +87,83 @@ public ChangeRequest(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ApprovedBy", this.ApprovedBy.Select(x => x.Iid)); + + if (this.Author != null) + { + dictionary.Add("Author", new [] { this.Author.Iid }); + } + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Discussion", this.Discussion.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + if (this.PrimaryAnnotatedThing != null) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Iid }); + } + + dictionary.Add("RelatedThing", this.RelatedThing.Select(x => x.Iid)); + + dictionary.Add("SourceAnnotation", this.SourceAnnotation.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Author": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/Citation.cs b/CDP4Common/AutoGenPoco/Citation.cs index 33edaad91..ddd61d75c 100644 --- a/CDP4Common/AutoGenPoco/Citation.cs +++ b/CDP4Common/AutoGenPoco/Citation.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -134,6 +135,56 @@ public Citation(Guid iid, ConcurrentDictionary> [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] public ReferenceSource Source { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Source != null) + { + dictionary.Add("Source", new [] { this.Source.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Source": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ClassKind.cs b/CDP4Common/AutoGenPoco/ClassKind.cs index 1a0fd8645..c1ba1627e 100644 --- a/CDP4Common/AutoGenPoco/ClassKind.cs +++ b/CDP4Common/AutoGenPoco/ClassKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/Color.cs b/CDP4Common/AutoGenPoco/Color.cs index f80e30a2c..7d53affd7 100644 --- a/CDP4Common/AutoGenPoco/Color.cs +++ b/CDP4Common/AutoGenPoco/Color.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -110,6 +111,45 @@ public Color(Guid iid, ConcurrentDictionary> ca [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] public int Red { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/CommonFileStore.cs b/CDP4Common/AutoGenPoco/CommonFileStore.cs index 1cf8accb7..4a9bcd2c8 100644 --- a/CDP4Common/AutoGenPoco/CommonFileStore.cs +++ b/CDP4Common/AutoGenPoco/CommonFileStore.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -84,6 +85,60 @@ public CommonFileStore(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("File", this.File.Select(x => x.Iid)); + + dictionary.Add("Folder", this.Folder.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/CompoundParameterType.cs b/CDP4Common/AutoGenPoco/CompoundParameterType.cs index 873e67ba1..6616a1e25 100644 --- a/CDP4Common/AutoGenPoco/CompoundParameterType.cs +++ b/CDP4Common/AutoGenPoco/CompoundParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -121,6 +122,55 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Component", this.Component.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/Constant.cs b/CDP4Common/AutoGenPoco/Constant.cs index a34e0f488..7b004f337 100644 --- a/CDP4Common/AutoGenPoco/Constant.cs +++ b/CDP4Common/AutoGenPoco/Constant.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -133,6 +134,69 @@ public Constant(Guid iid, ConcurrentDictionary> [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: true, isNullable: false, isPersistent: true)] public ValueArray Value { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + if (this.ParameterType != null) + { + dictionary.Add("ParameterType", new [] { this.ParameterType.Iid }); + } + + if (this.Scale != null) + { + dictionary.Add("Scale", new [] { this.Scale.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "ParameterType": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ContractChangeNotice.cs b/CDP4Common/AutoGenPoco/ContractChangeNotice.cs index e677b3d8e..7130ab498 100644 --- a/CDP4Common/AutoGenPoco/ContractChangeNotice.cs +++ b/CDP4Common/AutoGenPoco/ContractChangeNotice.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -93,6 +94,95 @@ public ContractChangeNotice(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ApprovedBy", this.ApprovedBy.Select(x => x.Iid)); + + if (this.Author != null) + { + dictionary.Add("Author", new [] { this.Author.Iid }); + } + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + if (this.ChangeProposal != null) + { + dictionary.Add("ChangeProposal", new [] { this.ChangeProposal.Iid }); + } + + dictionary.Add("Discussion", this.Discussion.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + if (this.PrimaryAnnotatedThing != null) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Iid }); + } + + dictionary.Add("RelatedThing", this.RelatedThing.Select(x => x.Iid)); + + dictionary.Add("SourceAnnotation", this.SourceAnnotation.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Author": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "ChangeProposal": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ContractDeviation.cs b/CDP4Common/AutoGenPoco/ContractDeviation.cs index 611c1f82f..51ac66d1d 100644 --- a/CDP4Common/AutoGenPoco/ContractDeviation.cs +++ b/CDP4Common/AutoGenPoco/ContractDeviation.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -84,6 +85,83 @@ protected ContractDeviation(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ApprovedBy", this.ApprovedBy.Select(x => x.Iid)); + + if (this.Author != null) + { + dictionary.Add("Author", new [] { this.Author.Iid }); + } + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Discussion", this.Discussion.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + if (this.PrimaryAnnotatedThing != null) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Iid }); + } + + dictionary.Add("RelatedThing", this.RelatedThing.Select(x => x.Iid)); + + dictionary.Add("SourceAnnotation", this.SourceAnnotation.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Author": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/ConversionBasedUnit.cs b/CDP4Common/AutoGenPoco/ConversionBasedUnit.cs index b353a3515..6c371d888 100644 --- a/CDP4Common/AutoGenPoco/ConversionBasedUnit.cs +++ b/CDP4Common/AutoGenPoco/ConversionBasedUnit.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -101,6 +102,62 @@ protected ConversionBasedUnit(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + if (this.ReferenceUnit != null) + { + dictionary.Add("ReferenceUnit", new [] { this.ReferenceUnit.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "ReferenceUnit": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/CyclicRatioScale.cs b/CDP4Common/AutoGenPoco/CyclicRatioScale.cs index aee442308..9fcca109a 100644 --- a/CDP4Common/AutoGenPoco/CyclicRatioScale.cs +++ b/CDP4Common/AutoGenPoco/CyclicRatioScale.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -96,6 +97,66 @@ public CyclicRatioScale(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("MappingToReferenceScale", this.MappingToReferenceScale.Select(x => x.Iid)); + + if (this.Unit != null) + { + dictionary.Add("Unit", new [] { this.Unit.Iid }); + } + + dictionary.Add("ValueDefinition", this.ValueDefinition.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Unit": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/DateParameterType.cs b/CDP4Common/AutoGenPoco/DateParameterType.cs index 11a99bae8..106bf6b18 100644 --- a/CDP4Common/AutoGenPoco/DateParameterType.cs +++ b/CDP4Common/AutoGenPoco/DateParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -84,6 +85,53 @@ public DateParameterType(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/DateTimeParameterType.cs b/CDP4Common/AutoGenPoco/DateTimeParameterType.cs index 6473826a3..3be5f05da 100644 --- a/CDP4Common/AutoGenPoco/DateTimeParameterType.cs +++ b/CDP4Common/AutoGenPoco/DateTimeParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -84,6 +85,53 @@ public DateTimeParameterType(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/DecompositionRule.cs b/CDP4Common/AutoGenPoco/DecompositionRule.cs index 9b5efc1fc..7eeb19bf9 100644 --- a/CDP4Common/AutoGenPoco/DecompositionRule.cs +++ b/CDP4Common/AutoGenPoco/DecompositionRule.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -126,6 +127,64 @@ public DecompositionRule(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("ContainedCategory", this.ContainedCategory.Select(x => x.Iid)); + + if (this.ContainingCategory != null) + { + dictionary.Add("ContainingCategory", new [] { this.ContainingCategory.Iid }); + } + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "ContainingCategory": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/DefinedThing.cs b/CDP4Common/AutoGenPoco/DefinedThing.cs index c4c8f0a6a..171c2739f 100644 --- a/CDP4Common/AutoGenPoco/DefinedThing.cs +++ b/CDP4Common/AutoGenPoco/DefinedThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -154,6 +155,51 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/Definition.cs b/CDP4Common/AutoGenPoco/Definition.cs index 77e959f90..91f824977 100644 --- a/CDP4Common/AutoGenPoco/Definition.cs +++ b/CDP4Common/AutoGenPoco/Definition.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -150,6 +151,47 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Citation", this.Citation.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/DependentParameterTypeAssignment.cs b/CDP4Common/AutoGenPoco/DependentParameterTypeAssignment.cs index 7e328fed5..43b517fb7 100644 --- a/CDP4Common/AutoGenPoco/DependentParameterTypeAssignment.cs +++ b/CDP4Common/AutoGenPoco/DependentParameterTypeAssignment.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -102,6 +103,61 @@ public DependentParameterTypeAssignment(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.MeasurementScale != null) + { + dictionary.Add("MeasurementScale", new [] { this.MeasurementScale.Iid }); + } + + if (this.ParameterType != null) + { + dictionary.Add("ParameterType", new [] { this.ParameterType.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "ParameterType": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/DerivedQuantityKind.cs b/CDP4Common/AutoGenPoco/DerivedQuantityKind.cs index cab5227d7..96efe07d3 100644 --- a/CDP4Common/AutoGenPoco/DerivedQuantityKind.cs +++ b/CDP4Common/AutoGenPoco/DerivedQuantityKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -110,6 +111,68 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + if (this.DefaultScale != null) + { + dictionary.Add("DefaultScale", new [] { this.DefaultScale.Iid }); + } + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("PossibleScale", this.PossibleScale.Select(x => x.Iid)); + + dictionary.Add("QuantityKindFactor", this.QuantityKindFactor.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "DefaultScale": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/DerivedUnit.cs b/CDP4Common/AutoGenPoco/DerivedUnit.cs index 6b075d41a..4f05a5d41 100644 --- a/CDP4Common/AutoGenPoco/DerivedUnit.cs +++ b/CDP4Common/AutoGenPoco/DerivedUnit.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -115,6 +116,53 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("UnitFactor", this.UnitFactor.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/DiagramCanvas.cs b/CDP4Common/AutoGenPoco/DiagramCanvas.cs index ac8bc3d17..c633813c8 100644 --- a/CDP4Common/AutoGenPoco/DiagramCanvas.cs +++ b/CDP4Common/AutoGenPoco/DiagramCanvas.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -94,6 +95,49 @@ public DiagramCanvas(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Bounds", this.Bounds.Select(x => x.Iid)); + + dictionary.Add("DiagramElement", this.DiagramElement.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/DiagramEdge.cs b/CDP4Common/AutoGenPoco/DiagramEdge.cs index 93af17714..dd1778028 100644 --- a/CDP4Common/AutoGenPoco/DiagramEdge.cs +++ b/CDP4Common/AutoGenPoco/DiagramEdge.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -127,6 +128,86 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Bounds", this.Bounds.Select(x => x.Iid)); + + if (this.DepictedThing != null) + { + dictionary.Add("DepictedThing", new [] { this.DepictedThing.Iid }); + } + + dictionary.Add("DiagramElement", this.DiagramElement.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("LocalStyle", this.LocalStyle.Select(x => x.Iid)); + + dictionary.Add("Point", this.Point.Select(x => x.Iid)); + + if (this.SharedStyle != null) + { + dictionary.Add("SharedStyle", new [] { this.SharedStyle.Iid }); + } + + if (this.Source != null) + { + dictionary.Add("Source", new [] { this.Source.Iid }); + } + + if (this.Target != null) + { + dictionary.Add("Target", new [] { this.Target.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Source": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Target": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/DiagramElementContainer.cs b/CDP4Common/AutoGenPoco/DiagramElementContainer.cs index 896462f27..0cf249460 100644 --- a/CDP4Common/AutoGenPoco/DiagramElementContainer.cs +++ b/CDP4Common/AutoGenPoco/DiagramElementContainer.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -119,6 +120,49 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Bounds", this.Bounds.Select(x => x.Iid)); + + dictionary.Add("DiagramElement", this.DiagramElement.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/DiagramElementThing.cs b/CDP4Common/AutoGenPoco/DiagramElementThing.cs index bd38fdd28..249dfaee4 100644 --- a/CDP4Common/AutoGenPoco/DiagramElementThing.cs +++ b/CDP4Common/AutoGenPoco/DiagramElementThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -127,6 +128,61 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Bounds", this.Bounds.Select(x => x.Iid)); + + if (this.DepictedThing != null) + { + dictionary.Add("DepictedThing", new [] { this.DepictedThing.Iid }); + } + + dictionary.Add("DiagramElement", this.DiagramElement.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("LocalStyle", this.LocalStyle.Select(x => x.Iid)); + + if (this.SharedStyle != null) + { + dictionary.Add("SharedStyle", new [] { this.SharedStyle.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/DiagramObject.cs b/CDP4Common/AutoGenPoco/DiagramObject.cs index 9e0733c2d..aeb0ee268 100644 --- a/CDP4Common/AutoGenPoco/DiagramObject.cs +++ b/CDP4Common/AutoGenPoco/DiagramObject.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -103,6 +104,61 @@ public DiagramObject(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Bounds", this.Bounds.Select(x => x.Iid)); + + if (this.DepictedThing != null) + { + dictionary.Add("DepictedThing", new [] { this.DepictedThing.Iid }); + } + + dictionary.Add("DiagramElement", this.DiagramElement.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("LocalStyle", this.LocalStyle.Select(x => x.Iid)); + + if (this.SharedStyle != null) + { + dictionary.Add("SharedStyle", new [] { this.SharedStyle.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/DiagramShape.cs b/CDP4Common/AutoGenPoco/DiagramShape.cs index 518c38581..34f921f9d 100644 --- a/CDP4Common/AutoGenPoco/DiagramShape.cs +++ b/CDP4Common/AutoGenPoco/DiagramShape.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -90,6 +91,61 @@ protected DiagramShape(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Bounds", this.Bounds.Select(x => x.Iid)); + + if (this.DepictedThing != null) + { + dictionary.Add("DepictedThing", new [] { this.DepictedThing.Iid }); + } + + dictionary.Add("DiagramElement", this.DiagramElement.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("LocalStyle", this.LocalStyle.Select(x => x.Iid)); + + if (this.SharedStyle != null) + { + dictionary.Add("SharedStyle", new [] { this.SharedStyle.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/DiagramThingBase.cs b/CDP4Common/AutoGenPoco/DiagramThingBase.cs index 2af5c0b0d..671195581 100644 --- a/CDP4Common/AutoGenPoco/DiagramThingBase.cs +++ b/CDP4Common/AutoGenPoco/DiagramThingBase.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -93,6 +94,45 @@ protected DiagramThingBase(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/DiagrammingStyle.cs b/CDP4Common/AutoGenPoco/DiagrammingStyle.cs index 7101d50b0..593cfe8d9 100644 --- a/CDP4Common/AutoGenPoco/DiagrammingStyle.cs +++ b/CDP4Common/AutoGenPoco/DiagrammingStyle.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -226,6 +227,62 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.FillColor != null) + { + dictionary.Add("FillColor", new [] { this.FillColor.Iid }); + } + + if (this.FontColor != null) + { + dictionary.Add("FontColor", new [] { this.FontColor.Iid }); + } + + if (this.StrokeColor != null) + { + dictionary.Add("StrokeColor", new [] { this.StrokeColor.Iid }); + } + + dictionary.Add("UsedColor", this.UsedColor.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/DiscussionItem.cs b/CDP4Common/AutoGenPoco/DiscussionItem.cs index a7f50af99..c4c2016af 100644 --- a/CDP4Common/AutoGenPoco/DiscussionItem.cs +++ b/CDP4Common/AutoGenPoco/DiscussionItem.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -92,6 +93,50 @@ protected DiscussionItem(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.ReplyTo != null) + { + dictionary.Add("ReplyTo", new [] { this.ReplyTo.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/DomainFileStore.cs b/CDP4Common/AutoGenPoco/DomainFileStore.cs index 9d416a600..fdb9a639b 100644 --- a/CDP4Common/AutoGenPoco/DomainFileStore.cs +++ b/CDP4Common/AutoGenPoco/DomainFileStore.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -94,6 +95,60 @@ public DomainFileStore(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("File", this.File.Select(x => x.Iid)); + + dictionary.Add("Folder", this.Folder.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/DomainOfExpertise.cs b/CDP4Common/AutoGenPoco/DomainOfExpertise.cs index 76b342722..181de2666 100644 --- a/CDP4Common/AutoGenPoco/DomainOfExpertise.cs +++ b/CDP4Common/AutoGenPoco/DomainOfExpertise.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -105,6 +106,53 @@ public DomainOfExpertise(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/DomainOfExpertiseGroup.cs b/CDP4Common/AutoGenPoco/DomainOfExpertiseGroup.cs index 24a287915..6d56e6a4b 100644 --- a/CDP4Common/AutoGenPoco/DomainOfExpertiseGroup.cs +++ b/CDP4Common/AutoGenPoco/DomainOfExpertiseGroup.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -104,6 +105,53 @@ public DomainOfExpertiseGroup(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("Domain", this.Domain.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ElementBase.cs b/CDP4Common/AutoGenPoco/ElementBase.cs index 915a25e0d..7dfe78090 100644 --- a/CDP4Common/AutoGenPoco/ElementBase.cs +++ b/CDP4Common/AutoGenPoco/ElementBase.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -103,6 +104,64 @@ protected ElementBase(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ElementDefinition.cs b/CDP4Common/AutoGenPoco/ElementDefinition.cs index fd1848c44..f14233d4c 100644 --- a/CDP4Common/AutoGenPoco/ElementDefinition.cs +++ b/CDP4Common/AutoGenPoco/ElementDefinition.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -169,6 +170,74 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("ContainedElement", this.ContainedElement.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("OrganizationalParticipant", this.OrganizationalParticipant.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + dictionary.Add("Parameter", this.Parameter.Select(x => x.Iid)); + + dictionary.Add("ParameterGroup", this.ParameterGroup.Select(x => x.Iid)); + + dictionary.Add("ReferencedElement", this.ReferencedElement.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ElementUsage.cs b/CDP4Common/AutoGenPoco/ElementUsage.cs index d6eb7977a..ce6a93824 100644 --- a/CDP4Common/AutoGenPoco/ElementUsage.cs +++ b/CDP4Common/AutoGenPoco/ElementUsage.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -151,6 +152,80 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + if (this.ElementDefinition != null) + { + dictionary.Add("ElementDefinition", new [] { this.ElementDefinition.Iid }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("ExcludeOption", this.ExcludeOption.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + dictionary.Add("ParameterOverride", this.ParameterOverride.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "ElementDefinition": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/EmailAddress.cs b/CDP4Common/AutoGenPoco/EmailAddress.cs index 86ecf7a43..5eabe3f01 100644 --- a/CDP4Common/AutoGenPoco/EmailAddress.cs +++ b/CDP4Common/AutoGenPoco/EmailAddress.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -103,6 +104,45 @@ public EmailAddress(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/EngineeringModel.cs b/CDP4Common/AutoGenPoco/EngineeringModel.cs index b60eb1dc0..022445bb7 100644 --- a/CDP4Common/AutoGenPoco/EngineeringModel.cs +++ b/CDP4Common/AutoGenPoco/EngineeringModel.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -184,6 +185,68 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Book", this.Book.Select(x => x.Iid)); + + dictionary.Add("CommonFileStore", this.CommonFileStore.Select(x => x.Iid)); + + if (this.EngineeringModelSetup != null) + { + dictionary.Add("EngineeringModelSetup", new [] { this.EngineeringModelSetup.Iid }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("GenericNote", this.GenericNote.Select(x => x.Iid)); + + dictionary.Add("Iteration", this.Iteration.Select(x => x.Iid)); + + dictionary.Add("LogEntry", this.LogEntry.Select(x => x.Iid)); + + dictionary.Add("ModellingAnnotation", this.ModellingAnnotation.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "EngineeringModelSetup": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/EngineeringModelDataAnnotation.cs b/CDP4Common/AutoGenPoco/EngineeringModelDataAnnotation.cs index 7f8f3d2b1..9f6f119dd 100644 --- a/CDP4Common/AutoGenPoco/EngineeringModelDataAnnotation.cs +++ b/CDP4Common/AutoGenPoco/EngineeringModelDataAnnotation.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -137,6 +138,65 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.Author != null) + { + dictionary.Add("Author", new [] { this.Author.Iid }); + } + + dictionary.Add("Discussion", this.Discussion.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.PrimaryAnnotatedThing != null) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Iid }); + } + + dictionary.Add("RelatedThing", this.RelatedThing.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Author": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/EngineeringModelDataDiscussionItem.cs b/CDP4Common/AutoGenPoco/EngineeringModelDataDiscussionItem.cs index 1382fb06a..20bf48972 100644 --- a/CDP4Common/AutoGenPoco/EngineeringModelDataDiscussionItem.cs +++ b/CDP4Common/AutoGenPoco/EngineeringModelDataDiscussionItem.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -93,6 +94,61 @@ public EngineeringModelDataDiscussionItem(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.Author != null) + { + dictionary.Add("Author", new [] { this.Author.Iid }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.ReplyTo != null) + { + dictionary.Add("ReplyTo", new [] { this.ReplyTo.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Author": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/EngineeringModelDataNote.cs b/CDP4Common/AutoGenPoco/EngineeringModelDataNote.cs index 4e64f47ba..fc90c69df 100644 --- a/CDP4Common/AutoGenPoco/EngineeringModelDataNote.cs +++ b/CDP4Common/AutoGenPoco/EngineeringModelDataNote.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -84,6 +85,65 @@ public EngineeringModelDataNote(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.Author != null) + { + dictionary.Add("Author", new [] { this.Author.Iid }); + } + + dictionary.Add("Discussion", this.Discussion.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.PrimaryAnnotatedThing != null) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Iid }); + } + + dictionary.Add("RelatedThing", this.RelatedThing.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Author": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/EngineeringModelKind.cs b/CDP4Common/AutoGenPoco/EngineeringModelKind.cs index 199aa90b7..6352001d5 100644 --- a/CDP4Common/AutoGenPoco/EngineeringModelKind.cs +++ b/CDP4Common/AutoGenPoco/EngineeringModelKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/EngineeringModelSetup.cs b/CDP4Common/AutoGenPoco/EngineeringModelSetup.cs index 960e5a152..8063666ab 100644 --- a/CDP4Common/AutoGenPoco/EngineeringModelSetup.cs +++ b/CDP4Common/AutoGenPoco/EngineeringModelSetup.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -219,6 +220,72 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ActiveDomain", this.ActiveDomain.Select(x => x.Iid)); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + if (this.DefaultOrganizationalParticipant != null) + { + dictionary.Add("DefaultOrganizationalParticipant", new [] { this.DefaultOrganizationalParticipant.Iid }); + } + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("IterationSetup", this.IterationSetup.Select(x => x.Iid)); + + dictionary.Add("OrganizationalParticipant", this.OrganizationalParticipant.Select(x => x.Iid)); + + dictionary.Add("Participant", this.Participant.Select(x => x.Iid)); + + dictionary.Add("RequiredRdl", this.RequiredRdl.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "RequiredRdl": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/EnumerationParameterType.cs b/CDP4Common/AutoGenPoco/EnumerationParameterType.cs index bdcb10727..fffbb2215 100644 --- a/CDP4Common/AutoGenPoco/EnumerationParameterType.cs +++ b/CDP4Common/AutoGenPoco/EnumerationParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -117,6 +118,55 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("ValueDefinition", this.ValueDefinition.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/EnumerationValueDefinition.cs b/CDP4Common/AutoGenPoco/EnumerationValueDefinition.cs index d80434aa1..bfc282178 100644 --- a/CDP4Common/AutoGenPoco/EnumerationValueDefinition.cs +++ b/CDP4Common/AutoGenPoco/EnumerationValueDefinition.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -85,6 +86,51 @@ public EnumerationValueDefinition(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/ExclusiveOrExpression.cs b/CDP4Common/AutoGenPoco/ExclusiveOrExpression.cs index 59dddf62b..2c270683a 100644 --- a/CDP4Common/AutoGenPoco/ExclusiveOrExpression.cs +++ b/CDP4Common/AutoGenPoco/ExclusiveOrExpression.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -95,6 +96,47 @@ public ExclusiveOrExpression(Guid iid, ConcurrentDictionary Term { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("Term", this.Term.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ExternalIdentifierMap.cs b/CDP4Common/AutoGenPoco/ExternalIdentifierMap.cs index 170b00faa..bd5fb21d9 100644 --- a/CDP4Common/AutoGenPoco/ExternalIdentifierMap.cs +++ b/CDP4Common/AutoGenPoco/ExternalIdentifierMap.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -164,6 +165,63 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Correspondence", this.Correspondence.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.ExternalFormat != null) + { + dictionary.Add("ExternalFormat", new [] { this.ExternalFormat.Iid }); + } + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/File.cs b/CDP4Common/AutoGenPoco/File.cs index 000eb5362..c1b6942e6 100644 --- a/CDP4Common/AutoGenPoco/File.cs +++ b/CDP4Common/AutoGenPoco/File.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -138,6 +139,65 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("FileRevision", this.FileRevision.Select(x => x.Iid)); + + if (this.LockedBy != null) + { + dictionary.Add("LockedBy", new [] { this.LockedBy.Iid }); + } + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/FileRevision.cs b/CDP4Common/AutoGenPoco/FileRevision.cs index ed8f222f1..84e06d446 100644 --- a/CDP4Common/AutoGenPoco/FileRevision.cs +++ b/CDP4Common/AutoGenPoco/FileRevision.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -163,6 +164,63 @@ public string Path set { throw new InvalidOperationException("Forbidden Set value for the derived property FileRevision.Path"); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.ContainingFolder != null) + { + dictionary.Add("ContainingFolder", new [] { this.ContainingFolder.Iid }); + } + + if (this.Creator != null) + { + dictionary.Add("Creator", new [] { this.Creator.Iid }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("FileType", this.FileType.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Creator": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/FileStore.cs b/CDP4Common/AutoGenPoco/FileStore.cs index 0703ffc58..0bb1c9b82 100644 --- a/CDP4Common/AutoGenPoco/FileStore.cs +++ b/CDP4Common/AutoGenPoco/FileStore.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -148,6 +149,60 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("File", this.File.Select(x => x.Iid)); + + dictionary.Add("Folder", this.Folder.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/FileType.cs b/CDP4Common/AutoGenPoco/FileType.cs index ec2e0b68c..f121a76f5 100644 --- a/CDP4Common/AutoGenPoco/FileType.cs +++ b/CDP4Common/AutoGenPoco/FileType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -117,6 +118,53 @@ public FileType(Guid iid, ConcurrentDictionary> [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] public bool IsDeprecated { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/Folder.cs b/CDP4Common/AutoGenPoco/Folder.cs index 7523a99d7..488343f16 100644 --- a/CDP4Common/AutoGenPoco/Folder.cs +++ b/CDP4Common/AutoGenPoco/Folder.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -150,6 +151,73 @@ public string Path set { throw new InvalidOperationException("Forbidden Set value for the derived property Folder.Path"); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.ContainingFolder != null) + { + dictionary.Add("ContainingFolder", new [] { this.ContainingFolder.Iid }); + } + + if (this.Creator != null) + { + dictionary.Add("Creator", new [] { this.Creator.Iid }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Creator": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/GenericAnnotation.cs b/CDP4Common/AutoGenPoco/GenericAnnotation.cs index 15710b23a..65f88b7b5 100644 --- a/CDP4Common/AutoGenPoco/GenericAnnotation.cs +++ b/CDP4Common/AutoGenPoco/GenericAnnotation.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -112,6 +113,45 @@ protected GenericAnnotation(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/Glossary.cs b/CDP4Common/AutoGenPoco/Glossary.cs index 8feb852b0..1d2bcba5b 100644 --- a/CDP4Common/AutoGenPoco/Glossary.cs +++ b/CDP4Common/AutoGenPoco/Glossary.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -127,6 +128,55 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("Term", this.Term.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/Goal.cs b/CDP4Common/AutoGenPoco/Goal.cs index 3f6b0ace8..ffa2f06b4 100644 --- a/CDP4Common/AutoGenPoco/Goal.cs +++ b/CDP4Common/AutoGenPoco/Goal.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -95,6 +96,53 @@ public Goal(Guid iid, ConcurrentDictionary> cac [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] public List Category { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/HyperLink.cs b/CDP4Common/AutoGenPoco/HyperLink.cs index c54eca598..c7e2a508c 100644 --- a/CDP4Common/AutoGenPoco/HyperLink.cs +++ b/CDP4Common/AutoGenPoco/HyperLink.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -111,6 +112,45 @@ public HyperLink(Guid iid, ConcurrentDictionary [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] public string Uri { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/IAnnotation.cs b/CDP4Common/AutoGenPoco/IAnnotation.cs index 8ce04298d..4394a2c56 100644 --- a/CDP4Common/AutoGenPoco/IAnnotation.cs +++ b/CDP4Common/AutoGenPoco/IAnnotation.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/ICategorizableThing.cs b/CDP4Common/AutoGenPoco/ICategorizableThing.cs index b9f35765c..fbdf1f3db 100644 --- a/CDP4Common/AutoGenPoco/ICategorizableThing.cs +++ b/CDP4Common/AutoGenPoco/ICategorizableThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/IDeprecatableThing.cs b/CDP4Common/AutoGenPoco/IDeprecatableThing.cs index 40ead340e..812e08e19 100644 --- a/CDP4Common/AutoGenPoco/IDeprecatableThing.cs +++ b/CDP4Common/AutoGenPoco/IDeprecatableThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/ILogEntry.cs b/CDP4Common/AutoGenPoco/ILogEntry.cs index a4ac86b3f..19edde00e 100644 --- a/CDP4Common/AutoGenPoco/ILogEntry.cs +++ b/CDP4Common/AutoGenPoco/ILogEntry.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/INamedThing.cs b/CDP4Common/AutoGenPoco/INamedThing.cs index a38afd67c..2c8bf7975 100644 --- a/CDP4Common/AutoGenPoco/INamedThing.cs +++ b/CDP4Common/AutoGenPoco/INamedThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/IOptionDependentThing.cs b/CDP4Common/AutoGenPoco/IOptionDependentThing.cs index 3cb8c09ea..41d00eb0f 100644 --- a/CDP4Common/AutoGenPoco/IOptionDependentThing.cs +++ b/CDP4Common/AutoGenPoco/IOptionDependentThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/IOwnedThing.cs b/CDP4Common/AutoGenPoco/IOwnedThing.cs index c243608e2..a8ab302a0 100644 --- a/CDP4Common/AutoGenPoco/IOwnedThing.cs +++ b/CDP4Common/AutoGenPoco/IOwnedThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/IParameterTypeAssignment.cs b/CDP4Common/AutoGenPoco/IParameterTypeAssignment.cs index 24b1599d3..8e9e1ea98 100644 --- a/CDP4Common/AutoGenPoco/IParameterTypeAssignment.cs +++ b/CDP4Common/AutoGenPoco/IParameterTypeAssignment.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/IParticipantAffectedAccessThing.cs b/CDP4Common/AutoGenPoco/IParticipantAffectedAccessThing.cs index 3503fc1b7..6fabe1af0 100644 --- a/CDP4Common/AutoGenPoco/IParticipantAffectedAccessThing.cs +++ b/CDP4Common/AutoGenPoco/IParticipantAffectedAccessThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/IShortNamedThing.cs b/CDP4Common/AutoGenPoco/IShortNamedThing.cs index e049b008e..27d1b1602 100644 --- a/CDP4Common/AutoGenPoco/IShortNamedThing.cs +++ b/CDP4Common/AutoGenPoco/IShortNamedThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/ITimeStampedThing.cs b/CDP4Common/AutoGenPoco/ITimeStampedThing.cs index 7535d786c..230401e74 100644 --- a/CDP4Common/AutoGenPoco/ITimeStampedThing.cs +++ b/CDP4Common/AutoGenPoco/ITimeStampedThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/IVolatileThing.cs b/CDP4Common/AutoGenPoco/IVolatileThing.cs index 0c2997252..b412510e8 100644 --- a/CDP4Common/AutoGenPoco/IVolatileThing.cs +++ b/CDP4Common/AutoGenPoco/IVolatileThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/IdCorrespondence.cs b/CDP4Common/AutoGenPoco/IdCorrespondence.cs index 567fdb329..f97766f1f 100644 --- a/CDP4Common/AutoGenPoco/IdCorrespondence.cs +++ b/CDP4Common/AutoGenPoco/IdCorrespondence.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -119,6 +120,45 @@ public DomainOfExpertise Owner set { throw new InvalidOperationException("Forbidden Set value for the derived property IdCorrespondence.Owner"); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/IndependentParameterTypeAssignment.cs b/CDP4Common/AutoGenPoco/IndependentParameterTypeAssignment.cs index 9ee44017f..9736510c9 100644 --- a/CDP4Common/AutoGenPoco/IndependentParameterTypeAssignment.cs +++ b/CDP4Common/AutoGenPoco/IndependentParameterTypeAssignment.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -102,6 +103,61 @@ public IndependentParameterTypeAssignment(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.MeasurementScale != null) + { + dictionary.Add("MeasurementScale", new [] { this.MeasurementScale.Iid }); + } + + if (this.ParameterType != null) + { + dictionary.Add("ParameterType", new [] { this.ParameterType.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "ParameterType": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/InterfaceEndKind.cs b/CDP4Common/AutoGenPoco/InterfaceEndKind.cs index 7cbf6733d..890cbcde0 100644 --- a/CDP4Common/AutoGenPoco/InterfaceEndKind.cs +++ b/CDP4Common/AutoGenPoco/InterfaceEndKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/IntervalScale.cs b/CDP4Common/AutoGenPoco/IntervalScale.cs index 59b53161c..ce590d118 100644 --- a/CDP4Common/AutoGenPoco/IntervalScale.cs +++ b/CDP4Common/AutoGenPoco/IntervalScale.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -108,6 +109,66 @@ public IntervalScale(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("MappingToReferenceScale", this.MappingToReferenceScale.Select(x => x.Iid)); + + if (this.Unit != null) + { + dictionary.Add("Unit", new [] { this.Unit.Iid }); + } + + dictionary.Add("ValueDefinition", this.ValueDefinition.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Unit": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/Iteration.cs b/CDP4Common/AutoGenPoco/Iteration.cs index 7f280e721..28321aa3e 100644 --- a/CDP4Common/AutoGenPoco/Iteration.cs +++ b/CDP4Common/AutoGenPoco/Iteration.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -343,6 +344,100 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ActualFiniteStateList", this.ActualFiniteStateList.Select(x => x.Iid)); + + if (this.DefaultOption != null) + { + dictionary.Add("DefaultOption", new [] { this.DefaultOption.Iid }); + } + + dictionary.Add("DiagramCanvas", this.DiagramCanvas.Select(x => x.Iid)); + + dictionary.Add("DomainFileStore", this.DomainFileStore.Select(x => x.Iid)); + + dictionary.Add("Element", this.Element.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("ExternalIdentifierMap", this.ExternalIdentifierMap.Select(x => x.Iid)); + + dictionary.Add("Goal", this.Goal.Select(x => x.Iid)); + + if (this.IterationSetup != null) + { + dictionary.Add("IterationSetup", new [] { this.IterationSetup.Iid }); + } + + dictionary.Add("Option", this.Option.Select(x => x.Iid)); + + dictionary.Add("PossibleFiniteStateList", this.PossibleFiniteStateList.Select(x => x.Iid)); + + dictionary.Add("Publication", this.Publication.Select(x => x.Iid)); + + dictionary.Add("Relationship", this.Relationship.Select(x => x.Iid)); + + dictionary.Add("RequirementsSpecification", this.RequirementsSpecification.Select(x => x.Iid)); + + dictionary.Add("RuleVerificationList", this.RuleVerificationList.Select(x => x.Iid)); + + dictionary.Add("SharedDiagramStyle", this.SharedDiagramStyle.Select(x => x.Iid)); + + dictionary.Add("Stakeholder", this.Stakeholder.Select(x => x.Iid)); + + dictionary.Add("StakeholderValue", this.StakeholderValue.Select(x => x.Iid)); + + dictionary.Add("StakeholderValueMap", this.StakeholderValueMap.Select(x => x.Iid)); + + if (this.TopElement != null) + { + dictionary.Add("TopElement", new [] { this.TopElement.Iid }); + } + + dictionary.Add("ValueGroup", this.ValueGroup.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "IterationSetup": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/IterationSetup.cs b/CDP4Common/AutoGenPoco/IterationSetup.cs index 6c9e42655..28b9c3a9e 100644 --- a/CDP4Common/AutoGenPoco/IterationSetup.cs +++ b/CDP4Common/AutoGenPoco/IterationSetup.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -153,6 +154,50 @@ public IterationSetup(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.SourceIterationSetup != null) + { + dictionary.Add("SourceIterationSetup", new [] { this.SourceIterationSetup.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/LinearConversionUnit.cs b/CDP4Common/AutoGenPoco/LinearConversionUnit.cs index 5e73e0b77..1c3d69210 100644 --- a/CDP4Common/AutoGenPoco/LinearConversionUnit.cs +++ b/CDP4Common/AutoGenPoco/LinearConversionUnit.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -86,6 +87,62 @@ public LinearConversionUnit(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + if (this.ReferenceUnit != null) + { + dictionary.Add("ReferenceUnit", new [] { this.ReferenceUnit.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "ReferenceUnit": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/LogEntryChangelogItem.cs b/CDP4Common/AutoGenPoco/LogEntryChangelogItem.cs index 2b095ff51..9a001cf83 100644 --- a/CDP4Common/AutoGenPoco/LogEntryChangelogItem.cs +++ b/CDP4Common/AutoGenPoco/LogEntryChangelogItem.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -122,6 +123,45 @@ public LogEntryChangelogItem(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/LogEntryChangelogItemKind.cs b/CDP4Common/AutoGenPoco/LogEntryChangelogItemKind.cs index ffba54667..1e11a12cd 100644 --- a/CDP4Common/AutoGenPoco/LogEntryChangelogItemKind.cs +++ b/CDP4Common/AutoGenPoco/LogEntryChangelogItemKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/LogLevelKind.cs b/CDP4Common/AutoGenPoco/LogLevelKind.cs index e188e4035..9c68e8f0d 100644 --- a/CDP4Common/AutoGenPoco/LogLevelKind.cs +++ b/CDP4Common/AutoGenPoco/LogLevelKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/LogarithmBaseKind.cs b/CDP4Common/AutoGenPoco/LogarithmBaseKind.cs index 36c4148ca..7602ab7df 100644 --- a/CDP4Common/AutoGenPoco/LogarithmBaseKind.cs +++ b/CDP4Common/AutoGenPoco/LogarithmBaseKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/LogarithmicScale.cs b/CDP4Common/AutoGenPoco/LogarithmicScale.cs index 7b5afcadd..d24e4be56 100644 --- a/CDP4Common/AutoGenPoco/LogarithmicScale.cs +++ b/CDP4Common/AutoGenPoco/LogarithmicScale.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -148,6 +149,80 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("MappingToReferenceScale", this.MappingToReferenceScale.Select(x => x.Iid)); + + if (this.ReferenceQuantityKind != null) + { + dictionary.Add("ReferenceQuantityKind", new [] { this.ReferenceQuantityKind.Iid }); + } + + dictionary.Add("ReferenceQuantityValue", this.ReferenceQuantityValue.Select(x => x.Iid)); + + if (this.Unit != null) + { + dictionary.Add("Unit", new [] { this.Unit.Iid }); + } + + dictionary.Add("ValueDefinition", this.ValueDefinition.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "ReferenceQuantityKind": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Unit": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/MappingToReferenceScale.cs b/CDP4Common/AutoGenPoco/MappingToReferenceScale.cs index f5ff02808..1e3e5b586 100644 --- a/CDP4Common/AutoGenPoco/MappingToReferenceScale.cs +++ b/CDP4Common/AutoGenPoco/MappingToReferenceScale.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -105,6 +106,68 @@ public MappingToReferenceScale(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.DependentScaleValue != null) + { + dictionary.Add("DependentScaleValue", new [] { this.DependentScaleValue.Iid }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.ReferenceScaleValue != null) + { + dictionary.Add("ReferenceScaleValue", new [] { this.ReferenceScaleValue.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "DependentScaleValue": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "ReferenceScaleValue": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/MeasurementScale.cs b/CDP4Common/AutoGenPoco/MeasurementScale.cs index 0de3bfec4..8957f24d5 100644 --- a/CDP4Common/AutoGenPoco/MeasurementScale.cs +++ b/CDP4Common/AutoGenPoco/MeasurementScale.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -216,6 +217,66 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("MappingToReferenceScale", this.MappingToReferenceScale.Select(x => x.Iid)); + + if (this.Unit != null) + { + dictionary.Add("Unit", new [] { this.Unit.Iid }); + } + + dictionary.Add("ValueDefinition", this.ValueDefinition.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Unit": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/MeasurementUnit.cs b/CDP4Common/AutoGenPoco/MeasurementUnit.cs index f0e85083d..21a50e42f 100644 --- a/CDP4Common/AutoGenPoco/MeasurementUnit.cs +++ b/CDP4Common/AutoGenPoco/MeasurementUnit.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -101,6 +102,51 @@ protected MeasurementUnit(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/ModelLogEntry.cs b/CDP4Common/AutoGenPoco/ModelLogEntry.cs index 7af3c0e39..23378559d 100644 --- a/CDP4Common/AutoGenPoco/ModelLogEntry.cs +++ b/CDP4Common/AutoGenPoco/ModelLogEntry.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -188,6 +189,54 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.Author != null) + { + dictionary.Add("Author", new [] { this.Author.Iid }); + } + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("LogEntryChangelogItem", this.LogEntryChangelogItem.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ModelReferenceDataLibrary.cs b/CDP4Common/AutoGenPoco/ModelReferenceDataLibrary.cs index 967dcac66..499e90f25 100644 --- a/CDP4Common/AutoGenPoco/ModelReferenceDataLibrary.cs +++ b/CDP4Common/AutoGenPoco/ModelReferenceDataLibrary.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -83,6 +84,80 @@ public ModelReferenceDataLibrary(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("BaseQuantityKind", this.BaseQuantityKind.Select(x => x.Iid)); + + dictionary.Add("BaseUnit", this.BaseUnit.Select(x => x.Iid)); + + dictionary.Add("Constant", this.Constant.Select(x => x.Iid)); + + dictionary.Add("DefinedCategory", this.DefinedCategory.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("FileType", this.FileType.Select(x => x.Iid)); + + dictionary.Add("Glossary", this.Glossary.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("ParameterType", this.ParameterType.Select(x => x.Iid)); + + dictionary.Add("ReferenceSource", this.ReferenceSource.Select(x => x.Iid)); + + if (this.RequiredRdl != null) + { + dictionary.Add("RequiredRdl", new [] { this.RequiredRdl.Iid }); + } + + dictionary.Add("Rule", this.Rule.Select(x => x.Iid)); + + dictionary.Add("Scale", this.Scale.Select(x => x.Iid)); + + dictionary.Add("Unit", this.Unit.Select(x => x.Iid)); + + dictionary.Add("UnitPrefix", this.UnitPrefix.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/ModellingAnnotationItem.cs b/CDP4Common/AutoGenPoco/ModellingAnnotationItem.cs index 7763fd325..094045819 100644 --- a/CDP4Common/AutoGenPoco/ModellingAnnotationItem.cs +++ b/CDP4Common/AutoGenPoco/ModellingAnnotationItem.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -179,6 +180,83 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ApprovedBy", this.ApprovedBy.Select(x => x.Iid)); + + if (this.Author != null) + { + dictionary.Add("Author", new [] { this.Author.Iid }); + } + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Discussion", this.Discussion.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + if (this.PrimaryAnnotatedThing != null) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Iid }); + } + + dictionary.Add("RelatedThing", this.RelatedThing.Select(x => x.Iid)); + + dictionary.Add("SourceAnnotation", this.SourceAnnotation.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Author": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ModellingThingReference.cs b/CDP4Common/AutoGenPoco/ModellingThingReference.cs index 9f0b6f143..8294bf366 100644 --- a/CDP4Common/AutoGenPoco/ModellingThingReference.cs +++ b/CDP4Common/AutoGenPoco/ModellingThingReference.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -84,6 +85,56 @@ public ModellingThingReference(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.ReferencedThing != null) + { + dictionary.Add("ReferencedThing", new [] { this.ReferencedThing.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "ReferencedThing": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/MultiRelationship.cs b/CDP4Common/AutoGenPoco/MultiRelationship.cs index 26e1e0219..6954dfd08 100644 --- a/CDP4Common/AutoGenPoco/MultiRelationship.cs +++ b/CDP4Common/AutoGenPoco/MultiRelationship.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -96,6 +97,62 @@ public MultiRelationship(Guid iid, ConcurrentDictionary RelatedThing { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + dictionary.Add("ParameterValue", this.ParameterValue.Select(x => x.Iid)); + + dictionary.Add("RelatedThing", this.RelatedThing.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/MultiRelationshipRule.cs b/CDP4Common/AutoGenPoco/MultiRelationshipRule.cs index 5701a3250..b8efa6196 100644 --- a/CDP4Common/AutoGenPoco/MultiRelationshipRule.cs +++ b/CDP4Common/AutoGenPoco/MultiRelationshipRule.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -124,6 +125,64 @@ public MultiRelationshipRule(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("RelatedCategory", this.RelatedCategory.Select(x => x.Iid)); + + if (this.RelationshipCategory != null) + { + dictionary.Add("RelationshipCategory", new [] { this.RelationshipCategory.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "RelationshipCategory": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/NaturalLanguage.cs b/CDP4Common/AutoGenPoco/NaturalLanguage.cs index a1105812f..628939975 100644 --- a/CDP4Common/AutoGenPoco/NaturalLanguage.cs +++ b/CDP4Common/AutoGenPoco/NaturalLanguage.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -113,6 +114,45 @@ public NaturalLanguage(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/NestedElement.cs b/CDP4Common/AutoGenPoco/NestedElement.cs index 7be52d8e0..5266993fc 100644 --- a/CDP4Common/AutoGenPoco/NestedElement.cs +++ b/CDP4Common/AutoGenPoco/NestedElement.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -192,6 +193,60 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ElementUsage", this.ElementUsage.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("NestedParameter", this.NestedParameter.Select(x => x.Iid)); + + if (this.RootElement != null) + { + dictionary.Add("RootElement", new [] { this.RootElement.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "RootElement": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/NestedParameter.cs b/CDP4Common/AutoGenPoco/NestedParameter.cs index e9ba457c3..db0341efd 100644 --- a/CDP4Common/AutoGenPoco/NestedParameter.cs +++ b/CDP4Common/AutoGenPoco/NestedParameter.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -157,6 +158,73 @@ public string Path set { throw new InvalidOperationException("Forbidden Set value for the derived property NestedParameter.Path"); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.ActualState != null) + { + dictionary.Add("ActualState", new [] { this.ActualState.Iid }); + } + + if (this.AssociatedParameter != null) + { + dictionary.Add("AssociatedParameter", new [] { this.AssociatedParameter.Iid }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "AssociatedParameter": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/NotExpression.cs b/CDP4Common/AutoGenPoco/NotExpression.cs index dccf38b03..653c53cd5 100644 --- a/CDP4Common/AutoGenPoco/NotExpression.cs +++ b/CDP4Common/AutoGenPoco/NotExpression.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -93,6 +94,56 @@ public NotExpression(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Term != null) + { + dictionary.Add("Term", new [] { this.Term.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Term": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/Note.cs b/CDP4Common/AutoGenPoco/Note.cs index a8760d58d..f5a8c2ee0 100644 --- a/CDP4Common/AutoGenPoco/Note.cs +++ b/CDP4Common/AutoGenPoco/Note.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -137,6 +138,58 @@ protected Note(Guid iid, ConcurrentDictionary> [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] public virtual string ShortName { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/NumberSetKind.cs b/CDP4Common/AutoGenPoco/NumberSetKind.cs index ba7434c9e..d121af570 100644 --- a/CDP4Common/AutoGenPoco/NumberSetKind.cs +++ b/CDP4Common/AutoGenPoco/NumberSetKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/Option.cs b/CDP4Common/AutoGenPoco/Option.cs index 24ef9821f..35b0e3782 100644 --- a/CDP4Common/AutoGenPoco/Option.cs +++ b/CDP4Common/AutoGenPoco/Option.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -120,6 +121,55 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("NestedElement", this.NestedElement.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/OrExpression.cs b/CDP4Common/AutoGenPoco/OrExpression.cs index ce338477d..00399a356 100644 --- a/CDP4Common/AutoGenPoco/OrExpression.cs +++ b/CDP4Common/AutoGenPoco/OrExpression.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -94,6 +95,47 @@ public OrExpression(Guid iid, ConcurrentDictionary Term { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("Term", this.Term.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/OrdinalScale.cs b/CDP4Common/AutoGenPoco/OrdinalScale.cs index 7fa7b2db1..623a8e78f 100644 --- a/CDP4Common/AutoGenPoco/OrdinalScale.cs +++ b/CDP4Common/AutoGenPoco/OrdinalScale.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -118,6 +119,66 @@ public OrdinalScale(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("MappingToReferenceScale", this.MappingToReferenceScale.Select(x => x.Iid)); + + if (this.Unit != null) + { + dictionary.Add("Unit", new [] { this.Unit.Iid }); + } + + dictionary.Add("ValueDefinition", this.ValueDefinition.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Unit": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/Organization.cs b/CDP4Common/AutoGenPoco/Organization.cs index 8d4294617..c23055ceb 100644 --- a/CDP4Common/AutoGenPoco/Organization.cs +++ b/CDP4Common/AutoGenPoco/Organization.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -115,6 +116,45 @@ public Organization(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/OrganizationalParticipant.cs b/CDP4Common/AutoGenPoco/OrganizationalParticipant.cs index 85fd83026..42c242c17 100644 --- a/CDP4Common/AutoGenPoco/OrganizationalParticipant.cs +++ b/CDP4Common/AutoGenPoco/OrganizationalParticipant.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -93,6 +94,56 @@ public OrganizationalParticipant(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Organization != null) + { + dictionary.Add("Organization", new [] { this.Organization.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Organization": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/OwnedStyle.cs b/CDP4Common/AutoGenPoco/OwnedStyle.cs index d977add9d..c0aec4a92 100644 --- a/CDP4Common/AutoGenPoco/OwnedStyle.cs +++ b/CDP4Common/AutoGenPoco/OwnedStyle.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -84,6 +85,62 @@ public OwnedStyle(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.FillColor != null) + { + dictionary.Add("FillColor", new [] { this.FillColor.Iid }); + } + + if (this.FontColor != null) + { + dictionary.Add("FontColor", new [] { this.FontColor.Iid }); + } + + if (this.StrokeColor != null) + { + dictionary.Add("StrokeColor", new [] { this.StrokeColor.Iid }); + } + + dictionary.Add("UsedColor", this.UsedColor.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/Page.cs b/CDP4Common/AutoGenPoco/Page.cs index fafca9240..f8af334f5 100644 --- a/CDP4Common/AutoGenPoco/Page.cs +++ b/CDP4Common/AutoGenPoco/Page.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -161,6 +162,60 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("Note", this.Note.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/Parameter.cs b/CDP4Common/AutoGenPoco/Parameter.cs index d846c978e..ce65b390a 100644 --- a/CDP4Common/AutoGenPoco/Parameter.cs +++ b/CDP4Common/AutoGenPoco/Parameter.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -137,6 +138,92 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Group != null) + { + dictionary.Add("Group", new [] { this.Group.Iid }); + } + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + dictionary.Add("ParameterSubscription", this.ParameterSubscription.Select(x => x.Iid)); + + if (this.ParameterType != null) + { + dictionary.Add("ParameterType", new [] { this.ParameterType.Iid }); + } + + if (this.RequestedBy != null) + { + dictionary.Add("RequestedBy", new [] { this.RequestedBy.Iid }); + } + + if (this.Scale != null) + { + dictionary.Add("Scale", new [] { this.Scale.Iid }); + } + + if (this.StateDependence != null) + { + dictionary.Add("StateDependence", new [] { this.StateDependence.Iid }); + } + + dictionary.Add("ValueSet", this.ValueSet.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "ParameterType": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ParameterBase.cs b/CDP4Common/AutoGenPoco/ParameterBase.cs index 6e4d7b6f1..e73a914d2 100644 --- a/CDP4Common/AutoGenPoco/ParameterBase.cs +++ b/CDP4Common/AutoGenPoco/ParameterBase.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -140,6 +141,83 @@ protected ParameterBase(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Group != null) + { + dictionary.Add("Group", new [] { this.Group.Iid }); + } + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + if (this.ParameterType != null) + { + dictionary.Add("ParameterType", new [] { this.ParameterType.Iid }); + } + + if (this.Scale != null) + { + dictionary.Add("Scale", new [] { this.Scale.Iid }); + } + + if (this.StateDependence != null) + { + dictionary.Add("StateDependence", new [] { this.StateDependence.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "ParameterType": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ParameterGroup.cs b/CDP4Common/AutoGenPoco/ParameterGroup.cs index cd40a02c6..b0c17b40a 100644 --- a/CDP4Common/AutoGenPoco/ParameterGroup.cs +++ b/CDP4Common/AutoGenPoco/ParameterGroup.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -105,6 +106,50 @@ public ParameterGroup(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.ContainingGroup != null) + { + dictionary.Add("ContainingGroup", new [] { this.ContainingGroup.Iid }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ParameterOrOverrideBase.cs b/CDP4Common/AutoGenPoco/ParameterOrOverrideBase.cs index e58bfca98..d9fa8709d 100644 --- a/CDP4Common/AutoGenPoco/ParameterOrOverrideBase.cs +++ b/CDP4Common/AutoGenPoco/ParameterOrOverrideBase.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -106,6 +107,85 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Group != null) + { + dictionary.Add("Group", new [] { this.Group.Iid }); + } + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + dictionary.Add("ParameterSubscription", this.ParameterSubscription.Select(x => x.Iid)); + + if (this.ParameterType != null) + { + dictionary.Add("ParameterType", new [] { this.ParameterType.Iid }); + } + + if (this.Scale != null) + { + dictionary.Add("Scale", new [] { this.Scale.Iid }); + } + + if (this.StateDependence != null) + { + dictionary.Add("StateDependence", new [] { this.StateDependence.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "ParameterType": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/ParameterOverride.cs b/CDP4Common/AutoGenPoco/ParameterOverride.cs index 928093b29..3a7ae4fa3 100644 --- a/CDP4Common/AutoGenPoco/ParameterOverride.cs +++ b/CDP4Common/AutoGenPoco/ParameterOverride.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -198,6 +199,72 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + if (this.Parameter != null) + { + dictionary.Add("Parameter", new [] { this.Parameter.Iid }); + } + + dictionary.Add("ParameterSubscription", this.ParameterSubscription.Select(x => x.Iid)); + + dictionary.Add("ValueSet", this.ValueSet.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Parameter": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ParameterOverrideValueSet.cs b/CDP4Common/AutoGenPoco/ParameterOverrideValueSet.cs index 0c4b97d88..7f1d9b2ca 100644 --- a/CDP4Common/AutoGenPoco/ParameterOverrideValueSet.cs +++ b/CDP4Common/AutoGenPoco/ParameterOverrideValueSet.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -125,6 +126,56 @@ public override ActualFiniteState ActualState [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] public ParameterValueSet ParameterValueSet { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.ParameterValueSet != null) + { + dictionary.Add("ParameterValueSet", new [] { this.ParameterValueSet.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "ParameterValueSet": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ParameterSubscription.cs b/CDP4Common/AutoGenPoco/ParameterSubscription.cs index e462ac668..b8dc33b83 100644 --- a/CDP4Common/AutoGenPoco/ParameterSubscription.cs +++ b/CDP4Common/AutoGenPoco/ParameterSubscription.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -188,6 +189,58 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + dictionary.Add("ValueSet", this.ValueSet.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/ParameterSubscriptionValueSet.cs b/CDP4Common/AutoGenPoco/ParameterSubscriptionValueSet.cs index 762131f07..a6c853e64 100644 --- a/CDP4Common/AutoGenPoco/ParameterSubscriptionValueSet.cs +++ b/CDP4Common/AutoGenPoco/ParameterSubscriptionValueSet.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -213,6 +214,56 @@ public ValueArray Reference [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] public ParameterSwitchKind ValueSwitch { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.SubscribedValueSet != null) + { + dictionary.Add("SubscribedValueSet", new [] { this.SubscribedValueSet.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "SubscribedValueSet": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ParameterSwitchKind.cs b/CDP4Common/AutoGenPoco/ParameterSwitchKind.cs index 1d066ac90..7c1256754 100644 --- a/CDP4Common/AutoGenPoco/ParameterSwitchKind.cs +++ b/CDP4Common/AutoGenPoco/ParameterSwitchKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/ParameterType.cs b/CDP4Common/AutoGenPoco/ParameterType.cs index 47a554b17..1b4dbb7e2 100644 --- a/CDP4Common/AutoGenPoco/ParameterType.cs +++ b/CDP4Common/AutoGenPoco/ParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -131,6 +132,53 @@ public int NumberOfValues [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] public virtual string Symbol { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ParameterTypeComponent.cs b/CDP4Common/AutoGenPoco/ParameterTypeComponent.cs index f4840f619..67c5dbd14 100644 --- a/CDP4Common/AutoGenPoco/ParameterTypeComponent.cs +++ b/CDP4Common/AutoGenPoco/ParameterTypeComponent.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -118,6 +119,61 @@ public ParameterTypeComponent(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.ParameterType != null) + { + dictionary.Add("ParameterType", new [] { this.ParameterType.Iid }); + } + + if (this.Scale != null) + { + dictionary.Add("Scale", new [] { this.Scale.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "ParameterType": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ParameterValue.cs b/CDP4Common/AutoGenPoco/ParameterValue.cs index 6afd2982b..1130bf6ba 100644 --- a/CDP4Common/AutoGenPoco/ParameterValue.cs +++ b/CDP4Common/AutoGenPoco/ParameterValue.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -113,6 +114,61 @@ protected ParameterValue(Guid iid, ConcurrentDictionary Value { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.ParameterType != null) + { + dictionary.Add("ParameterType", new [] { this.ParameterType.Iid }); + } + + if (this.Scale != null) + { + dictionary.Add("Scale", new [] { this.Scale.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "ParameterType": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ParameterValueSet.cs b/CDP4Common/AutoGenPoco/ParameterValueSet.cs index 351484670..9f587bc11 100644 --- a/CDP4Common/AutoGenPoco/ParameterValueSet.cs +++ b/CDP4Common/AutoGenPoco/ParameterValueSet.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -83,6 +84,55 @@ public ParameterValueSet(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.ActualOption != null) + { + dictionary.Add("ActualOption", new [] { this.ActualOption.Iid }); + } + + if (this.ActualState != null) + { + dictionary.Add("ActualState", new [] { this.ActualState.Iid }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/ParameterValueSetBase.cs b/CDP4Common/AutoGenPoco/ParameterValueSetBase.cs index 1c5fe7433..8bbb2f0b8 100644 --- a/CDP4Common/AutoGenPoco/ParameterValueSetBase.cs +++ b/CDP4Common/AutoGenPoco/ParameterValueSetBase.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -208,6 +209,55 @@ public DomainOfExpertise Owner [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] public virtual ParameterSwitchKind ValueSwitch { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.ActualOption != null) + { + dictionary.Add("ActualOption", new [] { this.ActualOption.Iid }); + } + + if (this.ActualState != null) + { + dictionary.Add("ActualState", new [] { this.ActualState.Iid }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ParameterizedCategoryRule.cs b/CDP4Common/AutoGenPoco/ParameterizedCategoryRule.cs index 25d43e25e..ab187e6ff 100644 --- a/CDP4Common/AutoGenPoco/ParameterizedCategoryRule.cs +++ b/CDP4Common/AutoGenPoco/ParameterizedCategoryRule.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -103,6 +104,64 @@ public ParameterizedCategoryRule(Guid iid, ConcurrentDictionary ParameterType { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + if (this.Category != null) + { + dictionary.Add("Category", new [] { this.Category.Iid }); + } + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("ParameterType", this.ParameterType.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Category": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ParametricConstraint.cs b/CDP4Common/AutoGenPoco/ParametricConstraint.cs index 877644ac5..6d5d3df34 100644 --- a/CDP4Common/AutoGenPoco/ParametricConstraint.cs +++ b/CDP4Common/AutoGenPoco/ParametricConstraint.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -132,6 +133,52 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("Expression", this.Expression.Select(x => x.Iid)); + + if (this.TopExpression != null) + { + dictionary.Add("TopExpression", new [] { this.TopExpression.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/Participant.cs b/CDP4Common/AutoGenPoco/Participant.cs index 61b19d94c..45e92bbd2 100644 --- a/CDP4Common/AutoGenPoco/Participant.cs +++ b/CDP4Common/AutoGenPoco/Participant.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -137,6 +138,82 @@ public Participant(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Domain", this.Domain.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Person != null) + { + dictionary.Add("Person", new [] { this.Person.Iid }); + } + + if (this.Role != null) + { + dictionary.Add("Role", new [] { this.Role.Iid }); + } + + if (this.SelectedDomain != null) + { + dictionary.Add("SelectedDomain", new [] { this.SelectedDomain.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Person": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Role": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "SelectedDomain": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ParticipantAccessRightKind.cs b/CDP4Common/AutoGenPoco/ParticipantAccessRightKind.cs index 46171adfc..83e22973f 100644 --- a/CDP4Common/AutoGenPoco/ParticipantAccessRightKind.cs +++ b/CDP4Common/AutoGenPoco/ParticipantAccessRightKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/ParticipantPermission.cs b/CDP4Common/AutoGenPoco/ParticipantPermission.cs index 792f81520..8c421338d 100644 --- a/CDP4Common/AutoGenPoco/ParticipantPermission.cs +++ b/CDP4Common/AutoGenPoco/ParticipantPermission.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -110,6 +111,45 @@ public ParticipantPermission(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/ParticipantRole.cs b/CDP4Common/AutoGenPoco/ParticipantRole.cs index b7fc18314..acb1b8eba 100644 --- a/CDP4Common/AutoGenPoco/ParticipantRole.cs +++ b/CDP4Common/AutoGenPoco/ParticipantRole.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -119,6 +120,53 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("ParticipantPermission", this.ParticipantPermission.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/Person.cs b/CDP4Common/AutoGenPoco/Person.cs index d0e115524..493399f52 100644 --- a/CDP4Common/AutoGenPoco/Person.cs +++ b/CDP4Common/AutoGenPoco/Person.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -271,6 +272,76 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.DefaultDomain != null) + { + dictionary.Add("DefaultDomain", new [] { this.DefaultDomain.Iid }); + } + + if (this.DefaultEmailAddress != null) + { + dictionary.Add("DefaultEmailAddress", new [] { this.DefaultEmailAddress.Iid }); + } + + if (this.DefaultTelephoneNumber != null) + { + dictionary.Add("DefaultTelephoneNumber", new [] { this.DefaultTelephoneNumber.Iid }); + } + + dictionary.Add("EmailAddress", this.EmailAddress.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Organization != null) + { + dictionary.Add("Organization", new [] { this.Organization.Iid }); + } + + if (this.Role != null) + { + dictionary.Add("Role", new [] { this.Role.Iid }); + } + + dictionary.Add("TelephoneNumber", this.TelephoneNumber.Select(x => x.Iid)); + + dictionary.Add("UserPreference", this.UserPreference.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/PersonAccessRightKind.cs b/CDP4Common/AutoGenPoco/PersonAccessRightKind.cs index 26a8ea497..3e0d8af96 100644 --- a/CDP4Common/AutoGenPoco/PersonAccessRightKind.cs +++ b/CDP4Common/AutoGenPoco/PersonAccessRightKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/PersonPermission.cs b/CDP4Common/AutoGenPoco/PersonPermission.cs index 7494eb298..4b1f91ba8 100644 --- a/CDP4Common/AutoGenPoco/PersonPermission.cs +++ b/CDP4Common/AutoGenPoco/PersonPermission.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -111,6 +112,45 @@ public PersonPermission(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/PersonRole.cs b/CDP4Common/AutoGenPoco/PersonRole.cs index 8fdd2b07d..667d8e56b 100644 --- a/CDP4Common/AutoGenPoco/PersonRole.cs +++ b/CDP4Common/AutoGenPoco/PersonRole.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -119,6 +120,53 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("PersonPermission", this.PersonPermission.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/Point.cs b/CDP4Common/AutoGenPoco/Point.cs index 8cf1c3a76..793a1dc52 100644 --- a/CDP4Common/AutoGenPoco/Point.cs +++ b/CDP4Common/AutoGenPoco/Point.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -103,6 +104,45 @@ public Point(Guid iid, ConcurrentDictionary> ca [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] public float Y { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/PossibleFiniteState.cs b/CDP4Common/AutoGenPoco/PossibleFiniteState.cs index b9b29e6d8..f9b6953c1 100644 --- a/CDP4Common/AutoGenPoco/PossibleFiniteState.cs +++ b/CDP4Common/AutoGenPoco/PossibleFiniteState.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -101,6 +102,51 @@ public DomainOfExpertise Owner set { throw new InvalidOperationException("Forbidden Set value for the derived property PossibleFiniteState.Owner"); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/PossibleFiniteStateList.cs b/CDP4Common/AutoGenPoco/PossibleFiniteStateList.cs index 151bee7f2..cd0b11224 100644 --- a/CDP4Common/AutoGenPoco/PossibleFiniteStateList.cs +++ b/CDP4Common/AutoGenPoco/PossibleFiniteStateList.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -146,6 +147,71 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + if (this.DefaultState != null) + { + dictionary.Add("DefaultState", new [] { this.DefaultState.Iid }); + } + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + dictionary.Add("PossibleState", this.PossibleState.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/PrefixedUnit.cs b/CDP4Common/AutoGenPoco/PrefixedUnit.cs index 7d468975d..130ef570c 100644 --- a/CDP4Common/AutoGenPoco/PrefixedUnit.cs +++ b/CDP4Common/AutoGenPoco/PrefixedUnit.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -145,6 +146,74 @@ public override string ShortName set { throw new InvalidOperationException("Forbidden Set value for the derived property PrefixedUnit.ShortName"); } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + if (this.Prefix != null) + { + dictionary.Add("Prefix", new [] { this.Prefix.Iid }); + } + + if (this.ReferenceUnit != null) + { + dictionary.Add("ReferenceUnit", new [] { this.ReferenceUnit.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Prefix": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "ReferenceUnit": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/Publication.cs b/CDP4Common/AutoGenPoco/Publication.cs index d922fb81e..262b36b0d 100644 --- a/CDP4Common/AutoGenPoco/Publication.cs +++ b/CDP4Common/AutoGenPoco/Publication.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -121,6 +122,49 @@ public Publication(Guid iid, ConcurrentDictionary PublishedParameter { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Domain", this.Domain.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("PublishedParameter", this.PublishedParameter.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/QuantityKind.cs b/CDP4Common/AutoGenPoco/QuantityKind.cs index c68b456bf..52d081aab 100644 --- a/CDP4Common/AutoGenPoco/QuantityKind.cs +++ b/CDP4Common/AutoGenPoco/QuantityKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -173,6 +174,66 @@ public string QuantityDimensionExpression [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] public virtual string QuantityDimensionSymbol { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + if (this.DefaultScale != null) + { + dictionary.Add("DefaultScale", new [] { this.DefaultScale.Iid }); + } + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("PossibleScale", this.PossibleScale.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "DefaultScale": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/QuantityKindFactor.cs b/CDP4Common/AutoGenPoco/QuantityKindFactor.cs index 3a7a680d9..891965182 100644 --- a/CDP4Common/AutoGenPoco/QuantityKindFactor.cs +++ b/CDP4Common/AutoGenPoco/QuantityKindFactor.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -102,6 +103,56 @@ public QuantityKindFactor(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.QuantityKind != null) + { + dictionary.Add("QuantityKind", new [] { this.QuantityKind.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "QuantityKind": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/RatioScale.cs b/CDP4Common/AutoGenPoco/RatioScale.cs index 851f5fa35..db26b7c57 100644 --- a/CDP4Common/AutoGenPoco/RatioScale.cs +++ b/CDP4Common/AutoGenPoco/RatioScale.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -102,6 +103,66 @@ public RatioScale(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("MappingToReferenceScale", this.MappingToReferenceScale.Select(x => x.Iid)); + + if (this.Unit != null) + { + dictionary.Add("Unit", new [] { this.Unit.Iid }); + } + + dictionary.Add("ValueDefinition", this.ValueDefinition.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Unit": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/ReferenceDataLibrary.cs b/CDP4Common/AutoGenPoco/ReferenceDataLibrary.cs index a5d3f180f..3e77687b5 100644 --- a/CDP4Common/AutoGenPoco/ReferenceDataLibrary.cs +++ b/CDP4Common/AutoGenPoco/ReferenceDataLibrary.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -257,6 +258,80 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("BaseQuantityKind", this.BaseQuantityKind.Select(x => x.Iid)); + + dictionary.Add("BaseUnit", this.BaseUnit.Select(x => x.Iid)); + + dictionary.Add("Constant", this.Constant.Select(x => x.Iid)); + + dictionary.Add("DefinedCategory", this.DefinedCategory.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("FileType", this.FileType.Select(x => x.Iid)); + + dictionary.Add("Glossary", this.Glossary.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("ParameterType", this.ParameterType.Select(x => x.Iid)); + + dictionary.Add("ReferenceSource", this.ReferenceSource.Select(x => x.Iid)); + + if (this.RequiredRdl != null) + { + dictionary.Add("RequiredRdl", new [] { this.RequiredRdl.Iid }); + } + + dictionary.Add("Rule", this.Rule.Select(x => x.Iid)); + + dictionary.Add("Scale", this.Scale.Select(x => x.Iid)); + + dictionary.Add("Unit", this.Unit.Select(x => x.Iid)); + + dictionary.Add("UnitPrefix", this.UnitPrefix.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ReferenceSource.cs b/CDP4Common/AutoGenPoco/ReferenceSource.cs index 99c45944d..4a8be10ad 100644 --- a/CDP4Common/AutoGenPoco/ReferenceSource.cs +++ b/CDP4Common/AutoGenPoco/ReferenceSource.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -169,6 +170,63 @@ public ReferenceSource(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + if (this.PublishedIn != null) + { + dictionary.Add("PublishedIn", new [] { this.PublishedIn.Iid }); + } + + if (this.Publisher != null) + { + dictionary.Add("Publisher", new [] { this.Publisher.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ReferencerRule.cs b/CDP4Common/AutoGenPoco/ReferencerRule.cs index a2dc76f78..2730d3e37 100644 --- a/CDP4Common/AutoGenPoco/ReferencerRule.cs +++ b/CDP4Common/AutoGenPoco/ReferencerRule.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -124,6 +125,64 @@ public ReferencerRule(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("ReferencedCategory", this.ReferencedCategory.Select(x => x.Iid)); + + if (this.ReferencingCategory != null) + { + dictionary.Add("ReferencingCategory", new [] { this.ReferencingCategory.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "ReferencingCategory": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/RelationalExpression.cs b/CDP4Common/AutoGenPoco/RelationalExpression.cs index cd3fa1031..bf09a599e 100644 --- a/CDP4Common/AutoGenPoco/RelationalExpression.cs +++ b/CDP4Common/AutoGenPoco/RelationalExpression.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -122,6 +123,61 @@ public RelationalExpression(Guid iid, ConcurrentDictionary Value { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.ParameterType != null) + { + dictionary.Add("ParameterType", new [] { this.ParameterType.Iid }); + } + + if (this.Scale != null) + { + dictionary.Add("Scale", new [] { this.Scale.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "ParameterType": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/RelationalOperatorKind.cs b/CDP4Common/AutoGenPoco/RelationalOperatorKind.cs index 708878362..afae6f298 100644 --- a/CDP4Common/AutoGenPoco/RelationalOperatorKind.cs +++ b/CDP4Common/AutoGenPoco/RelationalOperatorKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/Relationship.cs b/CDP4Common/AutoGenPoco/Relationship.cs index db0ee872b..86c172f71 100644 --- a/CDP4Common/AutoGenPoco/Relationship.cs +++ b/CDP4Common/AutoGenPoco/Relationship.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -141,6 +142,60 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + dictionary.Add("ParameterValue", this.ParameterValue.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/RelationshipParameterValue.cs b/CDP4Common/AutoGenPoco/RelationshipParameterValue.cs index 25379f1f2..d26636c67 100644 --- a/CDP4Common/AutoGenPoco/RelationshipParameterValue.cs +++ b/CDP4Common/AutoGenPoco/RelationshipParameterValue.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -84,6 +85,61 @@ public RelationshipParameterValue(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.ParameterType != null) + { + dictionary.Add("ParameterType", new [] { this.ParameterType.Iid }); + } + + if (this.Scale != null) + { + dictionary.Add("Scale", new [] { this.Scale.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "ParameterType": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/RequestForDeviation.cs b/CDP4Common/AutoGenPoco/RequestForDeviation.cs index f0b9c65eb..f1f485a93 100644 --- a/CDP4Common/AutoGenPoco/RequestForDeviation.cs +++ b/CDP4Common/AutoGenPoco/RequestForDeviation.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -85,6 +86,83 @@ public RequestForDeviation(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ApprovedBy", this.ApprovedBy.Select(x => x.Iid)); + + if (this.Author != null) + { + dictionary.Add("Author", new [] { this.Author.Iid }); + } + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Discussion", this.Discussion.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + if (this.PrimaryAnnotatedThing != null) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Iid }); + } + + dictionary.Add("RelatedThing", this.RelatedThing.Select(x => x.Iid)); + + dictionary.Add("SourceAnnotation", this.SourceAnnotation.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Author": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/RequestForWaiver.cs b/CDP4Common/AutoGenPoco/RequestForWaiver.cs index 29106d1e6..8303b550c 100644 --- a/CDP4Common/AutoGenPoco/RequestForWaiver.cs +++ b/CDP4Common/AutoGenPoco/RequestForWaiver.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -84,6 +85,83 @@ public RequestForWaiver(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ApprovedBy", this.ApprovedBy.Select(x => x.Iid)); + + if (this.Author != null) + { + dictionary.Add("Author", new [] { this.Author.Iid }); + } + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Discussion", this.Discussion.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + if (this.PrimaryAnnotatedThing != null) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Iid }); + } + + dictionary.Add("RelatedThing", this.RelatedThing.Select(x => x.Iid)); + + dictionary.Add("SourceAnnotation", this.SourceAnnotation.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Author": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/Requirement.cs b/CDP4Common/AutoGenPoco/Requirement.cs index 528fda15c..1bddd9995 100644 --- a/CDP4Common/AutoGenPoco/Requirement.cs +++ b/CDP4Common/AutoGenPoco/Requirement.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -139,6 +140,73 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Group != null) + { + dictionary.Add("Group", new [] { this.Group.Iid }); + } + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + dictionary.Add("ParameterValue", this.ParameterValue.Select(x => x.Iid)); + + dictionary.Add("ParametricConstraint", this.ParametricConstraint.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/RequirementsContainer.cs b/CDP4Common/AutoGenPoco/RequirementsContainer.cs index cc548215a..57d265f65 100644 --- a/CDP4Common/AutoGenPoco/RequirementsContainer.cs +++ b/CDP4Common/AutoGenPoco/RequirementsContainer.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -142,6 +143,68 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("Group", this.Group.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + dictionary.Add("ParameterValue", this.ParameterValue.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/RequirementsContainerParameterValue.cs b/CDP4Common/AutoGenPoco/RequirementsContainerParameterValue.cs index 3d0f6e5ba..e08d70cb6 100644 --- a/CDP4Common/AutoGenPoco/RequirementsContainerParameterValue.cs +++ b/CDP4Common/AutoGenPoco/RequirementsContainerParameterValue.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -84,6 +85,61 @@ public RequirementsContainerParameterValue(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.ParameterType != null) + { + dictionary.Add("ParameterType", new [] { this.ParameterType.Iid }); + } + + if (this.Scale != null) + { + dictionary.Add("Scale", new [] { this.Scale.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "ParameterType": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/RequirementsGroup.cs b/CDP4Common/AutoGenPoco/RequirementsGroup.cs index a72335eaa..6b1908ccc 100644 --- a/CDP4Common/AutoGenPoco/RequirementsGroup.cs +++ b/CDP4Common/AutoGenPoco/RequirementsGroup.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -83,6 +84,68 @@ public RequirementsGroup(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("Group", this.Group.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + dictionary.Add("ParameterValue", this.ParameterValue.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/RequirementsSpecification.cs b/CDP4Common/AutoGenPoco/RequirementsSpecification.cs index ea889d92c..0d22082b3 100644 --- a/CDP4Common/AutoGenPoco/RequirementsSpecification.cs +++ b/CDP4Common/AutoGenPoco/RequirementsSpecification.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -118,6 +119,70 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("Group", this.Group.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + dictionary.Add("ParameterValue", this.ParameterValue.Select(x => x.Iid)); + + dictionary.Add("Requirement", this.Requirement.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/ReviewItemDiscrepancy.cs b/CDP4Common/AutoGenPoco/ReviewItemDiscrepancy.cs index c0a5371b1..e8d6803a9 100644 --- a/CDP4Common/AutoGenPoco/ReviewItemDiscrepancy.cs +++ b/CDP4Common/AutoGenPoco/ReviewItemDiscrepancy.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -110,6 +111,85 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ApprovedBy", this.ApprovedBy.Select(x => x.Iid)); + + if (this.Author != null) + { + dictionary.Add("Author", new [] { this.Author.Iid }); + } + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Discussion", this.Discussion.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + if (this.PrimaryAnnotatedThing != null) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Iid }); + } + + dictionary.Add("RelatedThing", this.RelatedThing.Select(x => x.Iid)); + + dictionary.Add("Solution", this.Solution.Select(x => x.Iid)); + + dictionary.Add("SourceAnnotation", this.SourceAnnotation.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Author": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/Rule.cs b/CDP4Common/AutoGenPoco/Rule.cs index 5c0529996..42e44ea4c 100644 --- a/CDP4Common/AutoGenPoco/Rule.cs +++ b/CDP4Common/AutoGenPoco/Rule.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -93,6 +94,51 @@ protected Rule(Guid iid, ConcurrentDictionary> [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] public virtual bool IsDeprecated { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/RuleVerification.cs b/CDP4Common/AutoGenPoco/RuleVerification.cs index 1d9d85f57..06c90b689 100644 --- a/CDP4Common/AutoGenPoco/RuleVerification.cs +++ b/CDP4Common/AutoGenPoco/RuleVerification.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -162,6 +163,45 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/RuleVerificationList.cs b/CDP4Common/AutoGenPoco/RuleVerificationList.cs index e9bf67796..b8cb7cd71 100644 --- a/CDP4Common/AutoGenPoco/RuleVerificationList.cs +++ b/CDP4Common/AutoGenPoco/RuleVerificationList.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -118,6 +119,64 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + dictionary.Add("RuleVerification", this.RuleVerification.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/RuleVerificationStatusKind.cs b/CDP4Common/AutoGenPoco/RuleVerificationStatusKind.cs index 5bf3928a4..41d17f03c 100644 --- a/CDP4Common/AutoGenPoco/RuleVerificationStatusKind.cs +++ b/CDP4Common/AutoGenPoco/RuleVerificationStatusKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/RuleViolation.cs b/CDP4Common/AutoGenPoco/RuleViolation.cs index 55a806543..6b033d021 100644 --- a/CDP4Common/AutoGenPoco/RuleViolation.cs +++ b/CDP4Common/AutoGenPoco/RuleViolation.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -103,6 +104,45 @@ public RuleViolation(Guid iid, ConcurrentDictionary ViolatingThing { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/SampledFunctionParameterType.cs b/CDP4Common/AutoGenPoco/SampledFunctionParameterType.cs index 55e3124f8..a93005a58 100644 --- a/CDP4Common/AutoGenPoco/SampledFunctionParameterType.cs +++ b/CDP4Common/AutoGenPoco/SampledFunctionParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -148,6 +149,57 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("DependentParameterType", this.DependentParameterType.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("IndependentParameterType", this.IndependentParameterType.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/ScalarParameterType.cs b/CDP4Common/AutoGenPoco/ScalarParameterType.cs index de3a23134..537a552a8 100644 --- a/CDP4Common/AutoGenPoco/ScalarParameterType.cs +++ b/CDP4Common/AutoGenPoco/ScalarParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -85,6 +86,53 @@ protected ScalarParameterType(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/ScaleReferenceQuantityValue.cs b/CDP4Common/AutoGenPoco/ScaleReferenceQuantityValue.cs index 96e45e188..acaeb4543 100644 --- a/CDP4Common/AutoGenPoco/ScaleReferenceQuantityValue.cs +++ b/CDP4Common/AutoGenPoco/ScaleReferenceQuantityValue.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -102,6 +103,56 @@ public ScaleReferenceQuantityValue(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Scale != null) + { + dictionary.Add("Scale", new [] { this.Scale.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Scale": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ScaleValueDefinition.cs b/CDP4Common/AutoGenPoco/ScaleValueDefinition.cs index 9153596cd..f4b76529e 100644 --- a/CDP4Common/AutoGenPoco/ScaleValueDefinition.cs +++ b/CDP4Common/AutoGenPoco/ScaleValueDefinition.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -93,6 +94,51 @@ public ScaleValueDefinition(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/Section.cs b/CDP4Common/AutoGenPoco/Section.cs index bd0cfed74..b1c6c893d 100644 --- a/CDP4Common/AutoGenPoco/Section.cs +++ b/CDP4Common/AutoGenPoco/Section.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -162,6 +163,60 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + dictionary.Add("Page", this.Page.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/SharedStyle.cs b/CDP4Common/AutoGenPoco/SharedStyle.cs index 7b9142bf2..4d8a8462d 100644 --- a/CDP4Common/AutoGenPoco/SharedStyle.cs +++ b/CDP4Common/AutoGenPoco/SharedStyle.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -84,6 +85,62 @@ public SharedStyle(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.FillColor != null) + { + dictionary.Add("FillColor", new [] { this.FillColor.Iid }); + } + + if (this.FontColor != null) + { + dictionary.Add("FontColor", new [] { this.FontColor.Iid }); + } + + if (this.StrokeColor != null) + { + dictionary.Add("StrokeColor", new [] { this.StrokeColor.Iid }); + } + + dictionary.Add("UsedColor", this.UsedColor.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/SimpleParameterValue.cs b/CDP4Common/AutoGenPoco/SimpleParameterValue.cs index b8ed58504..378317f5c 100644 --- a/CDP4Common/AutoGenPoco/SimpleParameterValue.cs +++ b/CDP4Common/AutoGenPoco/SimpleParameterValue.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -131,6 +132,61 @@ public DomainOfExpertise Owner [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: true, isNullable: false, isPersistent: true)] public ValueArray Value { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.ParameterType != null) + { + dictionary.Add("ParameterType", new [] { this.ParameterType.Iid }); + } + + if (this.Scale != null) + { + dictionary.Add("Scale", new [] { this.Scale.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "ParameterType": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/SimpleParameterizableThing.cs b/CDP4Common/AutoGenPoco/SimpleParameterizableThing.cs index a190a6f47..143b6bef3 100644 --- a/CDP4Common/AutoGenPoco/SimpleParameterizableThing.cs +++ b/CDP4Common/AutoGenPoco/SimpleParameterizableThing.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -118,6 +119,64 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + dictionary.Add("ParameterValue", this.ParameterValue.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/SimpleQuantityKind.cs b/CDP4Common/AutoGenPoco/SimpleQuantityKind.cs index 61d1ede32..71b5f7f72 100644 --- a/CDP4Common/AutoGenPoco/SimpleQuantityKind.cs +++ b/CDP4Common/AutoGenPoco/SimpleQuantityKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -85,6 +86,66 @@ public SimpleQuantityKind(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + if (this.DefaultScale != null) + { + dictionary.Add("DefaultScale", new [] { this.DefaultScale.Iid }); + } + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("PossibleScale", this.PossibleScale.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "DefaultScale": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/SimpleUnit.cs b/CDP4Common/AutoGenPoco/SimpleUnit.cs index f25c5f45c..87f253e28 100644 --- a/CDP4Common/AutoGenPoco/SimpleUnit.cs +++ b/CDP4Common/AutoGenPoco/SimpleUnit.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -88,6 +89,51 @@ public SimpleUnit(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/SiteDirectory.cs b/CDP4Common/AutoGenPoco/SiteDirectory.cs index 7821ec83c..6b1417aff 100644 --- a/CDP4Common/AutoGenPoco/SiteDirectory.cs +++ b/CDP4Common/AutoGenPoco/SiteDirectory.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -283,6 +284,77 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Annotation", this.Annotation.Select(x => x.Iid)); + + if (this.DefaultParticipantRole != null) + { + dictionary.Add("DefaultParticipantRole", new [] { this.DefaultParticipantRole.Iid }); + } + + if (this.DefaultPersonRole != null) + { + dictionary.Add("DefaultPersonRole", new [] { this.DefaultPersonRole.Iid }); + } + + dictionary.Add("Domain", this.Domain.Select(x => x.Iid)); + + dictionary.Add("DomainGroup", this.DomainGroup.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("LogEntry", this.LogEntry.Select(x => x.Iid)); + + dictionary.Add("Model", this.Model.Select(x => x.Iid)); + + dictionary.Add("NaturalLanguage", this.NaturalLanguage.Select(x => x.Iid)); + + dictionary.Add("Organization", this.Organization.Select(x => x.Iid)); + + dictionary.Add("ParticipantRole", this.ParticipantRole.Select(x => x.Iid)); + + dictionary.Add("Person", this.Person.Select(x => x.Iid)); + + dictionary.Add("PersonRole", this.PersonRole.Select(x => x.Iid)); + + dictionary.Add("SiteReferenceDataLibrary", this.SiteReferenceDataLibrary.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/SiteDirectoryDataAnnotation.cs b/CDP4Common/AutoGenPoco/SiteDirectoryDataAnnotation.cs index 8aedbc1f2..ff3b62c44 100644 --- a/CDP4Common/AutoGenPoco/SiteDirectoryDataAnnotation.cs +++ b/CDP4Common/AutoGenPoco/SiteDirectoryDataAnnotation.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -137,6 +138,72 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.Author != null) + { + dictionary.Add("Author", new [] { this.Author.Iid }); + } + + dictionary.Add("Discussion", this.Discussion.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.PrimaryAnnotatedThing != null) + { + dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Iid }); + } + + dictionary.Add("RelatedThing", this.RelatedThing.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Author": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "PrimaryAnnotatedThing": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/SiteDirectoryDataDiscussionItem.cs b/CDP4Common/AutoGenPoco/SiteDirectoryDataDiscussionItem.cs index 5dca4506f..72deaac42 100644 --- a/CDP4Common/AutoGenPoco/SiteDirectoryDataDiscussionItem.cs +++ b/CDP4Common/AutoGenPoco/SiteDirectoryDataDiscussionItem.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -93,6 +94,61 @@ public SiteDirectoryDataDiscussionItem(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.Author != null) + { + dictionary.Add("Author", new [] { this.Author.Iid }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.ReplyTo != null) + { + dictionary.Add("ReplyTo", new [] { this.ReplyTo.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Author": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/SiteDirectoryThingReference.cs b/CDP4Common/AutoGenPoco/SiteDirectoryThingReference.cs index ff6846ca4..df5ef994a 100644 --- a/CDP4Common/AutoGenPoco/SiteDirectoryThingReference.cs +++ b/CDP4Common/AutoGenPoco/SiteDirectoryThingReference.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -84,6 +85,56 @@ public SiteDirectoryThingReference(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.ReferencedThing != null) + { + dictionary.Add("ReferencedThing", new [] { this.ReferencedThing.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "ReferencedThing": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/SiteLogEntry.cs b/CDP4Common/AutoGenPoco/SiteLogEntry.cs index ae8289229..1be2029b1 100644 --- a/CDP4Common/AutoGenPoco/SiteLogEntry.cs +++ b/CDP4Common/AutoGenPoco/SiteLogEntry.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -188,6 +189,54 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.Author != null) + { + dictionary.Add("Author", new [] { this.Author.Iid }); + } + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("LogEntryChangelogItem", this.LogEntryChangelogItem.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/SiteReferenceDataLibrary.cs b/CDP4Common/AutoGenPoco/SiteReferenceDataLibrary.cs index ae21570e2..ddbcac661 100644 --- a/CDP4Common/AutoGenPoco/SiteReferenceDataLibrary.cs +++ b/CDP4Common/AutoGenPoco/SiteReferenceDataLibrary.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -94,6 +95,80 @@ public SiteReferenceDataLibrary(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("BaseQuantityKind", this.BaseQuantityKind.Select(x => x.Iid)); + + dictionary.Add("BaseUnit", this.BaseUnit.Select(x => x.Iid)); + + dictionary.Add("Constant", this.Constant.Select(x => x.Iid)); + + dictionary.Add("DefinedCategory", this.DefinedCategory.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("FileType", this.FileType.Select(x => x.Iid)); + + dictionary.Add("Glossary", this.Glossary.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("ParameterType", this.ParameterType.Select(x => x.Iid)); + + dictionary.Add("ReferenceSource", this.ReferenceSource.Select(x => x.Iid)); + + if (this.RequiredRdl != null) + { + dictionary.Add("RequiredRdl", new [] { this.RequiredRdl.Iid }); + } + + dictionary.Add("Rule", this.Rule.Select(x => x.Iid)); + + dictionary.Add("Scale", this.Scale.Select(x => x.Iid)); + + dictionary.Add("Unit", this.Unit.Select(x => x.Iid)); + + dictionary.Add("UnitPrefix", this.UnitPrefix.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/Solution.cs b/CDP4Common/AutoGenPoco/Solution.cs index 664c9f190..cca0914db 100644 --- a/CDP4Common/AutoGenPoco/Solution.cs +++ b/CDP4Common/AutoGenPoco/Solution.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -103,6 +104,68 @@ public Solution(Guid iid, ConcurrentDictionary> [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] public DomainOfExpertise Owner { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + if (this.Author != null) + { + dictionary.Add("Author", new [] { this.Author.Iid }); + } + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Author": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/SpecializedQuantityKind.cs b/CDP4Common/AutoGenPoco/SpecializedQuantityKind.cs index 4ba5b03ee..17d7e678d 100644 --- a/CDP4Common/AutoGenPoco/SpecializedQuantityKind.cs +++ b/CDP4Common/AutoGenPoco/SpecializedQuantityKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -96,6 +97,78 @@ public SpecializedQuantityKind(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + if (this.DefaultScale != null) + { + dictionary.Add("DefaultScale", new [] { this.DefaultScale.Iid }); + } + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.General != null) + { + dictionary.Add("General", new [] { this.General.Iid }); + } + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("PossibleScale", this.PossibleScale.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "DefaultScale": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + + case "General": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/StakeHolderValueMap.cs b/CDP4Common/AutoGenPoco/StakeHolderValueMap.cs index f08bac39d..0190ea996 100644 --- a/CDP4Common/AutoGenPoco/StakeHolderValueMap.cs +++ b/CDP4Common/AutoGenPoco/StakeHolderValueMap.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -158,6 +159,69 @@ public override IEnumerable ContainerLists } } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("Goal", this.Goal.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("Requirement", this.Requirement.Select(x => x.Iid)); + + dictionary.Add("Settings", this.Settings.Select(x => x.Iid)); + + dictionary.Add("StakeholderValue", this.StakeholderValue.Select(x => x.Iid)); + + dictionary.Add("ValueGroup", this.ValueGroup.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Settings": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/StakeHolderValueMapSettings.cs b/CDP4Common/AutoGenPoco/StakeHolderValueMapSettings.cs index 2410d6f5d..3fabe5279 100644 --- a/CDP4Common/AutoGenPoco/StakeHolderValueMapSettings.cs +++ b/CDP4Common/AutoGenPoco/StakeHolderValueMapSettings.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -108,6 +109,60 @@ public StakeHolderValueMapSettings(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.GoalToValueGroupRelationship != null) + { + dictionary.Add("GoalToValueGroupRelationship", new [] { this.GoalToValueGroupRelationship.Iid }); + } + + if (this.StakeholderValueToRequirementRelationship != null) + { + dictionary.Add("StakeholderValueToRequirementRelationship", new [] { this.StakeholderValueToRequirementRelationship.Iid }); + } + + if (this.ValueGroupToStakeholderValueRelationship != null) + { + dictionary.Add("ValueGroupToStakeholderValueRelationship", new [] { this.ValueGroupToStakeholderValueRelationship.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/Stakeholder.cs b/CDP4Common/AutoGenPoco/Stakeholder.cs index b3a7f9d09..3b635685d 100644 --- a/CDP4Common/AutoGenPoco/Stakeholder.cs +++ b/CDP4Common/AutoGenPoco/Stakeholder.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -105,6 +106,55 @@ public Stakeholder(Guid iid, ConcurrentDictionary StakeholderValue { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + dictionary.Add("StakeholderValue", this.StakeholderValue.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/StakeholderValue.cs b/CDP4Common/AutoGenPoco/StakeholderValue.cs index 4a450f767..410a236cc 100644 --- a/CDP4Common/AutoGenPoco/StakeholderValue.cs +++ b/CDP4Common/AutoGenPoco/StakeholderValue.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -95,6 +96,53 @@ public StakeholderValue(Guid iid, ConcurrentDictionary Category { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/StudyPhaseKind.cs b/CDP4Common/AutoGenPoco/StudyPhaseKind.cs index f83f8a29a..933b58287 100644 --- a/CDP4Common/AutoGenPoco/StudyPhaseKind.cs +++ b/CDP4Common/AutoGenPoco/StudyPhaseKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/TelephoneNumber.cs b/CDP4Common/AutoGenPoco/TelephoneNumber.cs index 9581431b4..97e7ac2bd 100644 --- a/CDP4Common/AutoGenPoco/TelephoneNumber.cs +++ b/CDP4Common/AutoGenPoco/TelephoneNumber.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -107,6 +108,45 @@ public TelephoneNumber(Guid iid, ConcurrentDictionary VcardType { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/Term.cs b/CDP4Common/AutoGenPoco/Term.cs index 0cfc97a29..deef38958 100644 --- a/CDP4Common/AutoGenPoco/Term.cs +++ b/CDP4Common/AutoGenPoco/Term.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -92,6 +93,51 @@ public Term(Guid iid, ConcurrentDictionary> cac [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] public bool IsDeprecated { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/TextParameterType.cs b/CDP4Common/AutoGenPoco/TextParameterType.cs index 76b602596..01f9cb6f1 100644 --- a/CDP4Common/AutoGenPoco/TextParameterType.cs +++ b/CDP4Common/AutoGenPoco/TextParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -83,6 +84,53 @@ public TextParameterType(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/TextualNote.cs b/CDP4Common/AutoGenPoco/TextualNote.cs index d4ef4b5e6..ce6cafb55 100644 --- a/CDP4Common/AutoGenPoco/TextualNote.cs +++ b/CDP4Common/AutoGenPoco/TextualNote.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -100,6 +101,58 @@ public TextualNote(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Owner != null) + { + dictionary.Add("Owner", new [] { this.Owner.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Owner": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/ThingReference.cs b/CDP4Common/AutoGenPoco/ThingReference.cs index c49e44ed9..a31e06ab7 100644 --- a/CDP4Common/AutoGenPoco/ThingReference.cs +++ b/CDP4Common/AutoGenPoco/ThingReference.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -100,6 +101,56 @@ protected ThingReference(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.ReferencedThing != null) + { + dictionary.Add("ReferencedThing", new [] { this.ReferencedThing.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "ReferencedThing": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/TimeOfDayParameterType.cs b/CDP4Common/AutoGenPoco/TimeOfDayParameterType.cs index af5d399ac..9d09da2de 100644 --- a/CDP4Common/AutoGenPoco/TimeOfDayParameterType.cs +++ b/CDP4Common/AutoGenPoco/TimeOfDayParameterType.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -84,6 +85,53 @@ public TimeOfDayParameterType(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/TopContainer.cs b/CDP4Common/AutoGenPoco/TopContainer.cs index fe4f209d9..8f161d98c 100644 --- a/CDP4Common/AutoGenPoco/TopContainer.cs +++ b/CDP4Common/AutoGenPoco/TopContainer.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -93,6 +94,45 @@ protected TopContainer(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/UnitFactor.cs b/CDP4Common/AutoGenPoco/UnitFactor.cs index cf019df9f..34739800b 100644 --- a/CDP4Common/AutoGenPoco/UnitFactor.cs +++ b/CDP4Common/AutoGenPoco/UnitFactor.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -102,6 +103,56 @@ public UnitFactor(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Unit != null) + { + dictionary.Add("Unit", new [] { this.Unit.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Unit": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/UnitPrefix.cs b/CDP4Common/AutoGenPoco/UnitPrefix.cs index 8b8d1d2d3..3ea83777b 100644 --- a/CDP4Common/AutoGenPoco/UnitPrefix.cs +++ b/CDP4Common/AutoGenPoco/UnitPrefix.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -102,6 +103,51 @@ public UnitPrefix(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/UserPreference.cs b/CDP4Common/AutoGenPoco/UserPreference.cs index 5cf92a314..841e07216 100644 --- a/CDP4Common/AutoGenPoco/UserPreference.cs +++ b/CDP4Common/AutoGenPoco/UserPreference.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -105,6 +106,45 @@ public UserPreference(Guid iid, ConcurrentDictionary + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Creates and returns a copy of this for edit purpose. /// diff --git a/CDP4Common/AutoGenPoco/UserRuleVerification.cs b/CDP4Common/AutoGenPoco/UserRuleVerification.cs index d71f1fb89..addedc140 100644 --- a/CDP4Common/AutoGenPoco/UserRuleVerification.cs +++ b/CDP4Common/AutoGenPoco/UserRuleVerification.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -108,6 +109,56 @@ public override string Name [UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] public Rule Rule { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + if (this.Rule != null) + { + dictionary.Add("Rule", new [] { this.Rule.Iid }); + } + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + case "Rule": + if (ids.Intersect(kvp.Value).Any()) + { + result = true; + } + break; + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/ValueGroup.cs b/CDP4Common/AutoGenPoco/ValueGroup.cs index 7da39d1ff..7996fbbcf 100644 --- a/CDP4Common/AutoGenPoco/ValueGroup.cs +++ b/CDP4Common/AutoGenPoco/ValueGroup.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -95,6 +96,53 @@ public ValueGroup(Guid iid, ConcurrentDictionary Category { get; set; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public override IDictionary> GetReferenceProperties() + { + var dictionary = new Dictionary>(); + + dictionary.Add("Alias", this.Alias.Select(x => x.Iid)); + + dictionary.Add("Category", this.Category.Select(x => x.Iid)); + + dictionary.Add("Definition", this.Definition.Select(x => x.Iid)); + + dictionary.Add("ExcludedDomain", this.ExcludedDomain.Select(x => x.Iid)); + + dictionary.Add("ExcludedPerson", this.ExcludedPerson.Select(x => x.Iid)); + + dictionary.Add("HyperLink", this.HyperLink.Select(x => x.Iid)); + + return dictionary; + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public override bool HasMandatoryReferenceToAny(IEnumerable ids) + { + var result = false; + + if (!ids.Any()) + { + return false; + } + + foreach (var kvp in this.GetReferenceProperties()) + { + switch (kvp.Key) + { + } + } + + return result; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Common/AutoGenPoco/VcardEmailAddressKind.cs b/CDP4Common/AutoGenPoco/VcardEmailAddressKind.cs index 08f5ab218..598819075 100644 --- a/CDP4Common/AutoGenPoco/VcardEmailAddressKind.cs +++ b/CDP4Common/AutoGenPoco/VcardEmailAddressKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/AutoGenPoco/VcardTelephoneNumberKind.cs b/CDP4Common/AutoGenPoco/VcardTelephoneNumberKind.cs index 6fe56f5a3..51c458390 100644 --- a/CDP4Common/AutoGenPoco/VcardTelephoneNumberKind.cs +++ b/CDP4Common/AutoGenPoco/VcardTelephoneNumberKind.cs @@ -1,18 +1,19 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // -// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski +// Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, +// Antoine Théate, Omar Elebiary, Jaime Bernar // -// This file is part of COMET-SDK Community Edition +// This file is part of CDP4-COMET SDK Community Edition // This is an auto-generated class. Any manual changes to this file will be overwritten! // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. diff --git a/CDP4Common/CDP4Common.csproj b/CDP4Common/CDP4Common.csproj index 0133bf69f..0ebfa5841 100644 --- a/CDP4Common/CDP4Common.csproj +++ b/CDP4Common/CDP4Common.csproj @@ -4,7 +4,7 @@ net462;net47;net471;net472;net48;netstandard2.0;netstandard2.1 RHEA System S.A. CDP4Common Community Edition - 24.3.0 + 24.4.0 CDP4 Common Class Library that contains DTOs, POCOs Copyright © RHEA System S.A. Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathanael, Ahmed @@ -20,7 +20,7 @@ CDP COMET ECSS-E-TM-10-25 LGPL-3.0-only - [Update] NLog to version 5.2.7 + [UPGRADE] CDP4Common 24.4.0 README.md diff --git a/CDP4Common/Dto/Thing.cs b/CDP4Common/Dto/Thing.cs index 3b8f6caa2..1241b13eb 100644 --- a/CDP4Common/Dto/Thing.cs +++ b/CDP4Common/Dto/Thing.cs @@ -186,15 +186,36 @@ public virtual IEnumerable ContainerLists } /// - /// Queries the that was the source of the DTO - /// - /// - /// The that is the source from which the DTO may have been created. - /// - /// - /// The return value may be null if the DTO was not created based on an existing POCO. - /// - public CommonData.Thing QuerySourceThing() + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public virtual IDictionary> GetReferenceProperties() + { + return new Dictionary>(); + } + + /// + /// Tries to remove references to id's if they exist in a collection of id's (Guid's) + /// + /// The collection of Guids to remove references for. + /// The errors collected while trying to remove references + /// True if no errors were found while trying to remove references + public virtual bool TryRemoveReferences(IEnumerable ids, out List errors) + { + errors = null; + return true; + } + + /// + /// Queries the that was the source of the DTO + /// + /// + /// The that is the source from which the DTO may have been created. + /// + /// + /// The return value may be null if the DTO was not created based on an existing POCO. + /// + public CommonData.Thing QuerySourceThing() { return this.SourceThing; } diff --git a/CDP4Common/Poco/Thing.cs b/CDP4Common/Poco/Thing.cs index 37799603f..e0f5d4c43 100644 --- a/CDP4Common/Poco/Thing.cs +++ b/CDP4Common/Poco/Thing.cs @@ -348,6 +348,25 @@ public IEnumerable QueryContainedThingsDeep() return temp; } + /// + /// Get all Reference Properties by their Name and id's of instance values + /// + /// A dictionary of string (Name) and a collections of Guid's (id's of instance values) + public virtual IDictionary> GetReferenceProperties() + { + return new Dictionary>(); + } + + /// + /// Checks if this instance has mandatory references to any of the id's in a collection of id's (Guid's) + /// + /// The collection of Guids to search for. + /// True is any of the id's in is found in this instance's reference properties. + public virtual bool HasMandatoryReferenceToAny(IEnumerable ids) + { + return false; + } + /// /// Queries the referenced s of the current /// diff --git a/CDP4Dal/CDP4Dal.csproj b/CDP4Dal/CDP4Dal.csproj index 8247bc04e..91b92ea1d 100644 --- a/CDP4Dal/CDP4Dal.csproj +++ b/CDP4Dal/CDP4Dal.csproj @@ -4,7 +4,7 @@ net462;net47;net471;net472;net48;netstandard2.0;netstandard2.1 RHEA System S.A. CDP4Dal Community Edition - 24.3.0 + 24.4.0 CDP4 Data Access Layer library, a consumer of an ECSS-E-TM-10-25 Annex C API Copyright © RHEA System S.A. Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathanael, Ahmed @@ -20,7 +20,7 @@ CDP COMET ECSS-E-TM-10-25 LGPL-3.0-only - [UPGRADE] CDP4Common 24.3.0 + [UPGRADE] CDP4Common 24.4.0 README.md diff --git a/CDP4JsonFileDal.NetCore.Tests/JsonFileDalTestFixture.cs b/CDP4JsonFileDal.NetCore.Tests/JsonFileDalTestFixture.cs index 6553c546e..8aff6c059 100644 --- a/CDP4JsonFileDal.NetCore.Tests/JsonFileDalTestFixture.cs +++ b/CDP4JsonFileDal.NetCore.Tests/JsonFileDalTestFixture.cs @@ -1,6 +1,6 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // // Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft // @@ -41,6 +41,8 @@ namespace CDP4JsonFileDal.NetCore.Tests using CDP4Dal.Exceptions; using CDP4Dal.Operations; + using CDP4JsonFileDal; + using Moq; using NLog; @@ -64,6 +66,9 @@ namespace CDP4JsonFileDal.NetCore.Tests using SiteDirectory = CDP4Common.SiteDirectoryData.SiteDirectory; using SiteReferenceDataLibrary = CDP4Common.SiteDirectoryData.SiteReferenceDataLibrary; using Thing = CDP4Common.CommonData.Thing; + using SampledFunctionParameterType = CDP4Common.SiteDirectoryData.SampledFunctionParameterType; + using ElementDefinition = CDP4Common.EngineeringModelData.ElementDefinition; + using Parameter = CDP4Common.EngineeringModelData.Parameter; [TestFixture] public class JsonFileDalTestFixture @@ -103,6 +108,17 @@ public class JsonFileDalTestFixture /// private SiteDirectory siteDirectoryData; + /// + /// An instance of iteration data used to be returned from the mocked session. + /// + private Iteration iteration; + + private EngineeringModel model; + private ConcurrentDictionary> cache; + private CDP4Common.EngineeringModelData.Iteration iterationPoco; + private Guid iterationIid; + private Guid modelSetupId; + [OneTimeSetUp] public void OneTimeSetUp() { @@ -140,7 +156,7 @@ public void SetUp() Session = this.session.Object }; - this.siteDirectoryData = new SiteDirectory(); + this.siteDirectoryData = new SiteDirectory(Guid.NewGuid(), this.cache, this.credentials.Uri); this.session.Setup(x => x.RetrieveSiteDirectory()).Returns(this.siteDirectoryData); this.session.Setup(x => x.Credentials).Returns(this.credentials); } @@ -172,9 +188,8 @@ public void Verify_that_when_uri_path_does_not_exist_exception_is_thrown() public async Task VerifyThatOpenCreatesAConnection() { var returned = await this.dal.Open(this.credentials, this.cancelationTokenSource.Token); - Assert.NotNull(returned); - Assert.IsNotEmpty(returned); - + Assert.That(returned, Is.Not.Null); + Assert.That(returned, Is.Not.Empty); Assert.DoesNotThrow(() => this.dal.Close()); } @@ -195,7 +210,7 @@ public void VerifyThatDeleteThrowsException() [Test] public void VerifyThatAJsonDalThatIsNotOpenCannotBeClosed() { - Assert.IsNull(this.dal.Credentials); + Assert.That(this.dal.Credentials, Is.Null); Assert.Throws(() => this.dal.Close()); } @@ -228,11 +243,12 @@ public async Task VerifyThatReadReturnsCorrectDTO() var readResult = (await this.dal.Read(iterObject, this.cancelationTokenSource.Token)).ToList(); // General assertions for any kind of Thing we read - Assert.NotNull(readResult); - Assert.IsTrue(readResult.Count != 1); + Assert.That(readResult, Is.Not.Null); + Assert.That(readResult.Count, Is.Not.EqualTo(1)); + var iter1 = readResult.Single(d => d.ClassKind == ClassKind.Iteration); - Assert.IsTrue(iterObject.ClassKind == iter1.ClassKind); - Assert.IsTrue(iterObject.Iid == iter1.Iid); + Assert.That(iter1.ClassKind, Is.EqualTo(iterObject.ClassKind)); + Assert.That(iter1.Iid, Is.EqualTo(iterObject.Iid)); } [Test] @@ -260,7 +276,7 @@ public async Task VerifyWriteEnumerableOperationContainer() Assert.Throws(() => this.dal.Write((IEnumerable)null, files)); Assert.Throws(() => this.dal.Write(new List(), files)); - var operationContainers = new[] { new OperationContainer("/SiteDirectory/00000000-0000-0000-0000-000000000000", 0) }; + var operationContainers = new[] { new OperationContainer($"/SiteDirectory/{this.siteDirectoryData.Iid}", 0) }; Assert.Throws(() => this.dal.Write(operationContainers, files)); var domainSys = new DomainOfExpertise(Guid.NewGuid(), cache, this.credentials.Uri) { ShortName = "SYS" }; @@ -291,14 +307,15 @@ public async Task VerifyWriteEnumerableOperationContainer() var sitedirectoryDto = (CDP4Common.DTO.SiteDirectory)this.siteDirectoryData.ToDto(); var clone = sitedirectoryDto.DeepClone(); var operation = new Operation(sitedirectoryDto, clone, OperationKind.Update); - Assert.AreEqual(0, operationContainers.Single().Operations.Count()); + + Assert.That(operationContainers.Single().Operations.Count(), Is.EqualTo(0)); operationContainers.Single().AddOperation(operation); - Assert.AreEqual(1, operationContainers.Single().Operations.Count()); + Assert.That(operationContainers.Single().Operations.Count(), Is.EqualTo(1)); Assert.Throws(() => this.dal.Write(operationContainers, files)); operationContainers.Single().RemoveOperation(operation); - Assert.AreEqual(0, operationContainers.Single().Operations.Count()); + Assert.That(operationContainers.Single().Operations.Count(), Is.EqualTo(0)); var iterationIid = new Guid("b58ea73d-350d-4520-b9d9-a52c75ac2b5d"); var iterationSetup = new IterationSetup(Guid.NewGuid(), 0); @@ -328,6 +345,8 @@ public async Task VerifyWriteEnumerableOperationContainer() DefaultDomain = domainAer }; + this.siteDirectoryData.Person.Add(person); + var participant = new Participant(Guid.NewGuid(), cache, this.credentials.Uri) { Person = person }; participant.Person.Role = role; participant.Role = participantRole; @@ -354,7 +373,8 @@ public async Task VerifyWriteEnumerableOperationContainer() operationContainer.AddOperation(operation); operationContainers = new[] { operationContainer, operationContainer }; - Assert.IsEmpty(await this.dal.Write(operationContainers, files)); + var things = await this.dal.Write(operationContainers, files); + Assert.That(things, Is.Empty); } [Test] @@ -388,34 +408,34 @@ public void VerifyCtorWithVersion() { this.dal = new JsonFileDal(new Version("1.0.0")); - Assert.IsTrue(this.dal.Serializer.RequestDataModelVersion.Major == 1); - Assert.IsTrue(this.dal.Serializer.RequestDataModelVersion.Minor == 0); - Assert.IsTrue(this.dal.Serializer.RequestDataModelVersion.Build == 0); + Assert.That(this.dal.Serializer.RequestDataModelVersion.Major, Is.EqualTo(1)); + Assert.That(this.dal.Serializer.RequestDataModelVersion.Minor, Is.EqualTo(0)); + Assert.That(this.dal.Serializer.RequestDataModelVersion.Build, Is.EqualTo(0)); this.dal = new JsonFileDal(null); - Assert.IsTrue(this.dal.DalVersion.Major == 1); - Assert.IsTrue(this.dal.DalVersion.Minor == 3); - Assert.IsTrue(this.dal.DalVersion.Build == 0); + Assert.That(this.dal.DalVersion.Major, Is.EqualTo(1)); + Assert.That(this.dal.DalVersion.Minor, Is.EqualTo(3)); + Assert.That(this.dal.DalVersion.Build, Is.EqualTo(0)); } [Test] public void VerifyCtorWithVersionAndCopyright() { this.dal = new JsonFileDal(new Version("1.0.0")); - const string COPYRIGHT = "Copyright 2020 © ESA."; + const string COPYRIGHT = "Copyright 2020 © RHEA Group."; const string REMARK = "This is custom ECSS-E-TM-10-25 exchange file"; - Assert.IsTrue(this.dal.Serializer.RequestDataModelVersion.Major == 1); - Assert.IsTrue(this.dal.Serializer.RequestDataModelVersion.Minor == 0); - Assert.IsTrue(this.dal.Serializer.RequestDataModelVersion.Build == 0); + Assert.That(this.dal.Serializer.RequestDataModelVersion.Major, Is.EqualTo(1)); + Assert.That(this.dal.Serializer.RequestDataModelVersion.Minor, Is.EqualTo(0)); + Assert.That(this.dal.Serializer.RequestDataModelVersion.Build, Is.EqualTo(0)); this.dal.UpdateExchangeFileHeader(new Person { ShortName = "admin" }); - Assert.IsInstanceOf(typeof(Json.ExchangeFileHeader), this.dal.FileHeader); + Assert.That(this.dal.FileHeader, Is.InstanceOf()); this.dal.UpdateExchangeFileHeader(new Person { ShortName = "admin" }, COPYRIGHT, REMARK); - Assert.IsTrue(this.dal.FileHeader.Copyright == COPYRIGHT); - Assert.IsTrue(this.dal.FileHeader.Remark == REMARK); + Assert.That(this.dal.FileHeader.Copyright, Is.EqualTo(COPYRIGHT)); + Assert.That(this.dal.FileHeader.Remark, Is.EqualTo(REMARK)); } [Test] @@ -448,6 +468,7 @@ public void VerifyWritingWithoutMigrationFile() var zipCredentials = new Credentials("admin", "pass", new Uri(this.annexC3File)); var zipSession = new Session(this.dal, zipCredentials); + this.CreateBasicModel(); var operationContainers = this.BuildOperationContainers(); Assert.DoesNotThrowAsync(async () => await Task.Run(() => this.dal.Write(operationContainers))); @@ -459,11 +480,132 @@ public void VerifyWritingMigrationFile() var zipCredentials = new Credentials("admin", "pass", new Uri(this.annexC3File)); var zipSession = new Session(this.dal, zipCredentials); + this.CreateBasicModel(); var operationContainers = this.BuildOperationContainers(); Assert.DoesNotThrowAsync(async () => await Task.Run(() => this.dal.Write(operationContainers, new string[] { this.migrationFile }))); } + [Test] + public void VerifyCherryPick() + { + Assert.That(async () => await this.dal.CherryPick(Guid.NewGuid(), Guid.NewGuid(), new List(), + new List(), CancellationToken.None), Throws.Exception.TypeOf()); + } + + [Test] + public async Task VerifyWriteOfIncompatibleVersionFile() + { + this.dal = new JsonFileDal(new Version("1.0.0")) + { + Session = this.session.Object + }; + + var zipCredentials = new Credentials("admin", "pass", new Uri(this.annexC3File)); + var zipSession = new Session(this.dal, zipCredentials); + + this.CreateBasicModel(); + this.AddSampledFunctionParameterAndUsage(); + + var operationContainers = this.BuildOperationContainers(); + + Assert.DoesNotThrowAsync(async () => await Task.Run(() => this.dal.Write(operationContainers))); + + //Part 2 read newly created file + var newDal = new JsonFileDal(new Version("1.0.0")); + var newSession = new Session(newDal, zipCredentials); + + await newSession.Open(); + + var siteDirectory = newSession.RetrieveSiteDirectory(); + + var modelSetup = siteDirectory.Model.First(); + var domain = siteDirectory.Domain.First(); + + var model = new CDP4Common.EngineeringModelData.EngineeringModel(modelSetup.EngineeringModelIid, newSession.Assembler.Cache, newDal.Credentials.Uri) + { EngineeringModelSetup = modelSetup }; + + var iteration = new CDP4Common.EngineeringModelData.Iteration(this.iterationIid, newSession.Assembler.Cache, newDal.Credentials.Uri); + + model.Iteration.Add(iteration); + + await newSession.Read(iteration, domain); + + var readIteration = newSession.OpenIterations.First().Key; + + Assert.That(readIteration.Element.Count, Is.EqualTo(2)); + + var mainElement = readIteration.Element.FirstOrDefault(x => x.ContainedElement.Any()); + Assert.That(mainElement, Is.Not.Null); + + Assert.That(mainElement.Parameter.Any(), Is.False); + + var elementUsage = mainElement.ContainedElement.FirstOrDefault(); + Assert.That(elementUsage, Is.Not.Null); + Assert.That(elementUsage.ParameterOverride.Any(), Is.False); + } + + [Test] + public async Task VerifyWriteOfCompatibleVersionFile() + { + this.dal = new JsonFileDal(new Version("1.3.0")) + { + Session = this.session.Object + }; + + var zipCredentials = new Credentials("admin", "pass", new Uri(this.annexC3File)); + var zipSession = new Session(this.dal, zipCredentials); + + this.CreateBasicModel(); + this.AddSampledFunctionParameterAndUsage(); + + var operationContainers = this.BuildOperationContainers(); + + Assert.DoesNotThrowAsync(async () => await Task.Run(() => this.dal.Write(operationContainers))); + + //Part 2 read newly created file + var newDal = new JsonFileDal(new Version("1.0.0")); + var newSession = new Session(newDal, zipCredentials); + + await newSession.Open(); + + var siteDirectory = newSession.RetrieveSiteDirectory(); + + var modelSetup = siteDirectory.Model.First(); + var domain = siteDirectory.Domain.First(); + + var model = new CDP4Common.EngineeringModelData.EngineeringModel(modelSetup.EngineeringModelIid, newSession.Assembler.Cache, newDal.Credentials.Uri) + { EngineeringModelSetup = modelSetup }; + + var iteration = new CDP4Common.EngineeringModelData.Iteration(this.iterationIid, newSession.Assembler.Cache, newDal.Credentials.Uri); + + model.Iteration.Add(iteration); + + await newSession.Read(iteration, domain); + + var readIteration = newSession.OpenIterations.First().Key; + + Assert.That(readIteration.Element.Count, Is.EqualTo(2)); + + var mainElement = readIteration.Element.FirstOrDefault(x => x.ContainedElement.Any()); + Assert.That(mainElement, Is.Not.Null); + + Assert.That(mainElement.Parameter.Count(), Is.EqualTo(1)); + + var parameter = mainElement.Parameter.FirstOrDefault(); + Assert.That(parameter, Is.Not.Null); + Assert.That(parameter.ParameterType.GetType(), Is.EqualTo(typeof(SampledFunctionParameterType))); + + var elementUsage = mainElement.ContainedElement.First(); + Assert.That(elementUsage, Is.Not.Null); + Assert.That(elementUsage.ParameterOverride.Any(), Is.True); + + var parameterOverride = elementUsage.ParameterOverride.FirstOrDefault(); + Assert.That(parameterOverride, Is.Not.Null); + + Assert.That(parameterOverride.Parameter.ParameterType.GetType(), Is.EqualTo(typeof(SampledFunctionParameterType))); + } + /// /// Build operation containes structure that will be serialized /// @@ -472,10 +614,21 @@ public void VerifyWritingMigrationFile() /// private IEnumerable BuildOperationContainers() { - var cache = new ConcurrentDictionary>(); + var iterationClone = this.iteration.DeepClone(); + + var operation = new Operation(this.iteration, iterationClone, OperationKind.Update); + var operationContainers = new[] { new OperationContainer("/EngineeringModel/" + this.model.Iid + "/iteration/" + this.iteration.Iid, 0) }; + operationContainers.Single().AddOperation(operation); + + return operationContainers; + } + + private void CreateBasicModel() + { + this.cache = new ConcurrentDictionary>(); // DomainOfExpertise - var domain = new DomainOfExpertise(Guid.NewGuid(), cache, this.credentials.Uri) { ShortName = "SYS" }; + var domain = new DomainOfExpertise(Guid.NewGuid(), this.cache, this.credentials.Uri) { ShortName = "SYS" }; this.siteDirectoryData.Domain.Add(domain); // PersonRole @@ -484,7 +637,7 @@ private IEnumerable BuildOperationContainers() this.siteDirectoryData.DefaultPersonRole = role; // ParticipantRole - var participantRole = new ParticipantRole(Guid.Empty, null, null); + var participantRole = new ParticipantRole(Guid.NewGuid(), null, null); this.siteDirectoryData.ParticipantRole.Add(participantRole); this.siteDirectoryData.DefaultParticipantRole = participantRole; @@ -495,42 +648,69 @@ private IEnumerable BuildOperationContainers() }; // Iteration - var iterationIid = new Guid("b58ea73d-350d-4520-b9d9-a52c75ac2b5d"); + this.iterationIid = new Guid("b58ea73d-350d-4520-b9d9-a52c75ac2b5d"); var iterationSetup = new IterationSetup(Guid.NewGuid(), 0); - var iterationSetupPoco = new CDP4Common.SiteDirectoryData.IterationSetup(iterationSetup.Iid, cache, this.credentials.Uri); + var iterationSetupPoco = new CDP4Common.SiteDirectoryData.IterationSetup(iterationSetup.Iid, this.cache, this.credentials.Uri); + iterationSetup.IterationIid = this.iterationIid; + iterationSetupPoco.IterationIid = this.iterationIid; // EngineeringModel - var model = new EngineeringModel(Guid.NewGuid(), cache, this.credentials.Uri); - var modelSetup = new CDP4Common.SiteDirectoryData.EngineeringModelSetup(); + this.model = new EngineeringModel(Guid.NewGuid(), this.cache, this.credentials.Uri); + this.modelSetupId = Guid.NewGuid(); + var modelSetup = new CDP4Common.SiteDirectoryData.EngineeringModelSetup(this.modelSetupId, this.cache, this.credentials.Uri); modelSetup.ActiveDomain.Add(domain); - var requiredRdl = new ModelReferenceDataLibrary(); + var requiredRdl = new ModelReferenceDataLibrary(Guid.NewGuid(), this.cache, this.credentials.Uri); - var person = new Person { ShortName = "admin", Organization = organization }; - var participant = new Participant(Guid.NewGuid(), cache, this.credentials.Uri) { Person = person }; + var person = new Person(Guid.NewGuid(), this.cache, this.credentials.Uri) { ShortName = "admin", Organization = organization }; + this.siteDirectoryData.Person.Add(person); + var participant = new Participant(Guid.NewGuid(), this.cache, this.credentials.Uri) { Person = person }; participant.Person.Role = role; participant.Role = participantRole; participant.Domain.Add(domain); modelSetup.Participant.Add(participant); var lazyPerson = new Lazy(() => person); - var iterationPoco = new CDP4Common.EngineeringModelData.Iteration(iterationIid, cache, this.credentials.Uri) { IterationSetup = iterationSetupPoco }; - model.Iteration.Add(iterationPoco); - var iteration = (Iteration)iterationPoco.ToDto(); - model.EngineeringModelSetup = modelSetup; + this.iterationPoco = new CDP4Common.EngineeringModelData.Iteration(this.iterationIid, this.cache, this.credentials.Uri) { IterationSetup = iterationSetupPoco }; + this.model.Iteration.Add(this.iterationPoco); + this.model.EngineeringModelSetup = modelSetup; this.siteDirectoryData.Model.Add(modelSetup); modelSetup.RequiredRdl.Add(requiredRdl); modelSetup.IterationSetup.Add(iterationSetupPoco); - cache.TryAdd(new CacheKey(person.Iid, this.siteDirectoryData.Iid), lazyPerson); - this.siteDirectoryData.Cache = cache; - iteration.IterationSetup = iterationSetup.Iid; - var iterationClone = iteration.DeepClone(); + modelSetup.EngineeringModelIid = this.model.Iid; + this.cache.TryAdd(new CacheKey(person.Iid, this.siteDirectoryData.Iid), lazyPerson); + this.siteDirectoryData.Cache = this.cache; - var operation = new Operation(iteration, iterationClone, OperationKind.Update); - var operationContainers = new[] { new OperationContainer("/EngineeringModel/" + model.Iid + "/iteration/" + iteration.Iid, 0) }; - operationContainers.Single().AddOperation(operation); + this.iteration = (Iteration)this.iterationPoco.ToDto(); + } - return operationContainers; + private void AddSampledFunctionParameterAndUsage() + { + var sampledFunctionParameterType = new SampledFunctionParameterType(Guid.NewGuid(), this.cache, this.credentials.Uri); + this.siteDirectoryData.Model.First().RequiredRdl.First().ParameterType.Add(sampledFunctionParameterType); + + var elementDefinition1 = new ElementDefinition(Guid.NewGuid(), this.cache, this.credentials.Uri); + var elementDefinition2 = new ElementDefinition(Guid.NewGuid(), this.cache, this.credentials.Uri); + var sampledFunctionParameter1 = new Parameter(Guid.NewGuid(), this.cache, this.credentials.Uri); + var sampledFunctionParameter2 = new Parameter(Guid.NewGuid(), this.cache, this.credentials.Uri); + + sampledFunctionParameter1.ParameterType = sampledFunctionParameterType; + sampledFunctionParameter2.ParameterType = sampledFunctionParameterType; + elementDefinition1.Parameter.Add(sampledFunctionParameter1); + elementDefinition2.Parameter.Add(sampledFunctionParameter2); + this.iterationPoco.Element.Add(elementDefinition1); + this.iterationPoco.Element.Add(elementDefinition2); + + var elementUsage = new CDP4Common.EngineeringModelData.ElementUsage(Guid.NewGuid(), this.cache, this.credentials.Uri); + elementUsage.ElementDefinition = elementDefinition2; + var parameterOverride = new CDP4Common.EngineeringModelData.ParameterOverride(Guid.NewGuid(), this.cache, this.credentials.Uri); + parameterOverride.Parameter = sampledFunctionParameter2; + elementUsage.ParameterOverride.Add(parameterOverride); + + elementDefinition1.ContainedElement.Add(elementUsage); + + //Create the DTO again as it might have been changed + this.iteration = (Iteration)this.iterationPoco.ToDto(); } } } diff --git a/CDP4JsonFileDal.Tests/JsonFileDalTestFixture.cs b/CDP4JsonFileDal.Tests/JsonFileDalTestFixture.cs index 62149fa7d..545555275 100644 --- a/CDP4JsonFileDal.Tests/JsonFileDalTestFixture.cs +++ b/CDP4JsonFileDal.Tests/JsonFileDalTestFixture.cs @@ -1,6 +1,6 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2022 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // // Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft // @@ -66,6 +66,9 @@ namespace CDP4JsonFileDal.Tests using SiteDirectory = CDP4Common.SiteDirectoryData.SiteDirectory; using SiteReferenceDataLibrary = CDP4Common.SiteDirectoryData.SiteReferenceDataLibrary; using Thing = CDP4Common.CommonData.Thing; + using SampledFunctionParameterType = CDP4Common.SiteDirectoryData.SampledFunctionParameterType; + using ElementDefinition = CDP4Common.EngineeringModelData.ElementDefinition; + using Parameter = CDP4Common.EngineeringModelData.Parameter; [TestFixture] public class JsonFileDalTestFixture @@ -105,6 +108,17 @@ public class JsonFileDalTestFixture /// private SiteDirectory siteDirectoryData; + /// + /// An instance of iteration data used to be returned from the mocked session. + /// + private Iteration iteration; + + private EngineeringModel model; + private ConcurrentDictionary> cache; + private CDP4Common.EngineeringModelData.Iteration iterationPoco; + private Guid iterationIid; + private Guid modelSetupId; + [OneTimeSetUp] public void OneTimeSetUp() { @@ -142,7 +156,7 @@ public void SetUp() Session = this.session.Object }; - this.siteDirectoryData = new SiteDirectory(); + this.siteDirectoryData = new SiteDirectory(Guid.NewGuid(), this.cache, this.credentials.Uri); this.session.Setup(x => x.RetrieveSiteDirectory()).Returns(this.siteDirectoryData); this.session.Setup(x => x.Credentials).Returns(this.credentials); } @@ -262,7 +276,7 @@ public async Task VerifyWriteEnumerableOperationContainer() Assert.Throws(() => this.dal.Write((IEnumerable)null, files)); Assert.Throws(() => this.dal.Write(new List(), files)); - var operationContainers = new[] { new OperationContainer("/SiteDirectory/00000000-0000-0000-0000-000000000000", 0) }; + var operationContainers = new[] { new OperationContainer($"/SiteDirectory/{this.siteDirectoryData.Iid}", 0) }; Assert.Throws(() => this.dal.Write(operationContainers, files)); var domainSys = new DomainOfExpertise(Guid.NewGuid(), cache, this.credentials.Uri) { ShortName = "SYS" }; @@ -331,6 +345,8 @@ public async Task VerifyWriteEnumerableOperationContainer() DefaultDomain = domainAer }; + this.siteDirectoryData.Person.Add(person); + var participant = new Participant(Guid.NewGuid(), cache, this.credentials.Uri) { Person = person }; participant.Person.Role = role; participant.Role = participantRole; @@ -452,6 +468,7 @@ public void VerifyWritingWithoutMigrationFile() var zipCredentials = new Credentials("admin", "pass", new Uri(this.annexC3File)); var zipSession = new Session(this.dal, zipCredentials); + this.CreateBasicModel(); var operationContainers = this.BuildOperationContainers(); Assert.DoesNotThrowAsync(async () => await Task.Run(() => this.dal.Write(operationContainers))); @@ -463,6 +480,7 @@ public void VerifyWritingMigrationFile() var zipCredentials = new Credentials("admin", "pass", new Uri(this.annexC3File)); var zipSession = new Session(this.dal, zipCredentials); + this.CreateBasicModel(); var operationContainers = this.BuildOperationContainers(); Assert.DoesNotThrowAsync(async () => await Task.Run(() => this.dal.Write(operationContainers, new string[] { this.migrationFile }))); @@ -475,6 +493,119 @@ public void VerifyCherryPick() new List(), CancellationToken.None), Throws.Exception.TypeOf()); } + [Test] + public async Task VerifyWriteOfIncompatibleVersionFile() + { + this.dal = new JsonFileDal(new Version("1.0.0")) + { + Session = this.session.Object + }; + + var zipCredentials = new Credentials("admin", "pass", new Uri(this.annexC3File)); + var zipSession = new Session(this.dal, zipCredentials); + + this.CreateBasicModel(); + this.AddSampledFunctionParameterAndUsage(); + + var operationContainers = this.BuildOperationContainers(); + + Assert.DoesNotThrowAsync(async () => await Task.Run(() => this.dal.Write(operationContainers))); + + //Part 2 read newly created file + var newDal = new JsonFileDal(new Version("1.0.0")); + var newSession = new Session(newDal, zipCredentials); + + await newSession.Open(); + + var siteDirectory = newSession.RetrieveSiteDirectory(); + + var modelSetup = siteDirectory.Model.First(); + var domain = siteDirectory.Domain.First(); + + var model = new CDP4Common.EngineeringModelData.EngineeringModel(modelSetup.EngineeringModelIid, newSession.Assembler.Cache, newDal.Credentials.Uri) + { EngineeringModelSetup = modelSetup }; + + var iteration = new CDP4Common.EngineeringModelData.Iteration(this.iterationIid, newSession.Assembler.Cache, newDal.Credentials.Uri); + + model.Iteration.Add(iteration); + + await newSession.Read(iteration, domain); + + var readIteration = newSession.OpenIterations.First().Key; + + Assert.That(readIteration.Element.Count, Is.EqualTo(2)); + + var mainElement = readIteration.Element.FirstOrDefault(x => x.ContainedElement.Any()); + Assert.That(mainElement, Is.Not.Null); + + Assert.That(mainElement.Parameter.Any(), Is.False); + + var elementUsage = mainElement.ContainedElement.FirstOrDefault(); + Assert.That(elementUsage, Is.Not.Null); + Assert.That(elementUsage.ParameterOverride.Any(), Is.False); + } + + [Test] + public async Task VerifyWriteOfCompatibleVersionFile() + { + this.dal = new JsonFileDal(new Version("1.3.0")) + { + Session = this.session.Object + }; + + var zipCredentials = new Credentials("admin", "pass", new Uri(this.annexC3File)); + var zipSession = new Session(this.dal, zipCredentials); + + this.CreateBasicModel(); + this.AddSampledFunctionParameterAndUsage(); + + var operationContainers = this.BuildOperationContainers(); + + Assert.DoesNotThrowAsync(async () => await Task.Run(() => this.dal.Write(operationContainers))); + + //Part 2 read newly created file + var newDal = new JsonFileDal(new Version("1.0.0")); + var newSession = new Session(newDal, zipCredentials); + + await newSession.Open(); + + var siteDirectory = newSession.RetrieveSiteDirectory(); + + var modelSetup = siteDirectory.Model.First(); + var domain = siteDirectory.Domain.First(); + + var model = new CDP4Common.EngineeringModelData.EngineeringModel(modelSetup.EngineeringModelIid, newSession.Assembler.Cache, newDal.Credentials.Uri) + { EngineeringModelSetup = modelSetup }; + + var iteration = new CDP4Common.EngineeringModelData.Iteration(this.iterationIid, newSession.Assembler.Cache, newDal.Credentials.Uri); + + model.Iteration.Add(iteration); + + await newSession.Read(iteration, domain); + + var readIteration = newSession.OpenIterations.First().Key; + + Assert.That(readIteration.Element.Count, Is.EqualTo(2)); + + var mainElement = readIteration.Element.FirstOrDefault(x => x.ContainedElement.Any()); + Assert.That(mainElement, Is.Not.Null); + + Assert.That(mainElement.Parameter.Count(), Is.EqualTo(1)); + + var parameter = mainElement.Parameter.FirstOrDefault(); + Assert.That(parameter, Is.Not.Null); + Assert.That(parameter.ParameterType.GetType(), Is.EqualTo(typeof(SampledFunctionParameterType))); + + var elementUsage = mainElement.ContainedElement.First(); + Assert.That(elementUsage, Is.Not.Null); + Assert.That(elementUsage.ParameterOverride.Any(), Is.True); + + var parameterOverride = elementUsage.ParameterOverride.FirstOrDefault(); + Assert.That(parameterOverride, Is.Not.Null); + + Assert.That(parameterOverride.Parameter.ParameterType.GetType(), Is.EqualTo(typeof(SampledFunctionParameterType))); + } + /// /// Build operation containes structure that will be serialized /// @@ -483,10 +614,21 @@ public void VerifyCherryPick() /// private IEnumerable BuildOperationContainers() { - var cache = new ConcurrentDictionary>(); + var iterationClone = this.iteration.DeepClone(); + + var operation = new Operation(this.iteration, iterationClone, OperationKind.Update); + var operationContainers = new[] { new OperationContainer("/EngineeringModel/" + this.model.Iid + "/iteration/" + this.iteration.Iid, 0) }; + operationContainers.Single().AddOperation(operation); + + return operationContainers; + } + + private void CreateBasicModel() + { + this.cache = new ConcurrentDictionary>(); // DomainOfExpertise - var domain = new DomainOfExpertise(Guid.NewGuid(), cache, this.credentials.Uri) { ShortName = "SYS" }; + var domain = new DomainOfExpertise(Guid.NewGuid(), this.cache, this.credentials.Uri) { ShortName = "SYS" }; this.siteDirectoryData.Domain.Add(domain); // PersonRole @@ -495,7 +637,7 @@ private IEnumerable BuildOperationContainers() this.siteDirectoryData.DefaultPersonRole = role; // ParticipantRole - var participantRole = new ParticipantRole(Guid.Empty, null, null); + var participantRole = new ParticipantRole(Guid.NewGuid(), null, null); this.siteDirectoryData.ParticipantRole.Add(participantRole); this.siteDirectoryData.DefaultParticipantRole = participantRole; @@ -506,42 +648,69 @@ private IEnumerable BuildOperationContainers() }; // Iteration - var iterationIid = new Guid("b58ea73d-350d-4520-b9d9-a52c75ac2b5d"); + this.iterationIid = new Guid("b58ea73d-350d-4520-b9d9-a52c75ac2b5d"); var iterationSetup = new IterationSetup(Guid.NewGuid(), 0); - var iterationSetupPoco = new CDP4Common.SiteDirectoryData.IterationSetup(iterationSetup.Iid, cache, this.credentials.Uri); + var iterationSetupPoco = new CDP4Common.SiteDirectoryData.IterationSetup(iterationSetup.Iid, this.cache, this.credentials.Uri); + iterationSetup.IterationIid = this.iterationIid; + iterationSetupPoco.IterationIid = this.iterationIid; // EngineeringModel - var model = new EngineeringModel(Guid.NewGuid(), cache, this.credentials.Uri); - var modelSetup = new CDP4Common.SiteDirectoryData.EngineeringModelSetup(); + this.model = new EngineeringModel(Guid.NewGuid(), this.cache, this.credentials.Uri); + this.modelSetupId = Guid.NewGuid(); + var modelSetup = new CDP4Common.SiteDirectoryData.EngineeringModelSetup(this.modelSetupId, this.cache, this.credentials.Uri); modelSetup.ActiveDomain.Add(domain); - var requiredRdl = new ModelReferenceDataLibrary(); + var requiredRdl = new ModelReferenceDataLibrary(Guid.NewGuid(), this.cache, this.credentials.Uri); - var person = new Person { ShortName = "admin", Organization = organization }; - var participant = new Participant(Guid.NewGuid(), cache, this.credentials.Uri) { Person = person }; + var person = new Person(Guid.NewGuid(), this.cache, this.credentials.Uri) { ShortName = "admin", Organization = organization }; + this.siteDirectoryData.Person.Add(person); + var participant = new Participant(Guid.NewGuid(), this.cache, this.credentials.Uri) { Person = person }; participant.Person.Role = role; participant.Role = participantRole; participant.Domain.Add(domain); modelSetup.Participant.Add(participant); var lazyPerson = new Lazy(() => person); - var iterationPoco = new CDP4Common.EngineeringModelData.Iteration(iterationIid, cache, this.credentials.Uri) { IterationSetup = iterationSetupPoco }; - model.Iteration.Add(iterationPoco); - var iteration = (Iteration)iterationPoco.ToDto(); - model.EngineeringModelSetup = modelSetup; + this.iterationPoco = new CDP4Common.EngineeringModelData.Iteration(this.iterationIid, this.cache, this.credentials.Uri) { IterationSetup = iterationSetupPoco }; + this.model.Iteration.Add(this.iterationPoco); + this.model.EngineeringModelSetup = modelSetup; this.siteDirectoryData.Model.Add(modelSetup); modelSetup.RequiredRdl.Add(requiredRdl); modelSetup.IterationSetup.Add(iterationSetupPoco); - cache.TryAdd(new CacheKey(person.Iid, this.siteDirectoryData.Iid), lazyPerson); - this.siteDirectoryData.Cache = cache; - iteration.IterationSetup = iterationSetup.Iid; - var iterationClone = iteration.DeepClone(); + modelSetup.EngineeringModelIid = this.model.Iid; + this.cache.TryAdd(new CacheKey(person.Iid, this.siteDirectoryData.Iid), lazyPerson); + this.siteDirectoryData.Cache = this.cache; - var operation = new Operation(iteration, iterationClone, OperationKind.Update); - var operationContainers = new[] { new OperationContainer("/EngineeringModel/" + model.Iid + "/iteration/" + iteration.Iid, 0) }; - operationContainers.Single().AddOperation(operation); + this.iteration = (Iteration)this.iterationPoco.ToDto(); + } - return operationContainers; + private void AddSampledFunctionParameterAndUsage() + { + var sampledFunctionParameterType = new SampledFunctionParameterType(Guid.NewGuid(), this.cache, this.credentials.Uri); + this.siteDirectoryData.Model.First().RequiredRdl.First().ParameterType.Add(sampledFunctionParameterType); + + var elementDefinition1 = new ElementDefinition(Guid.NewGuid(), this.cache, this.credentials.Uri); + var elementDefinition2 = new ElementDefinition(Guid.NewGuid(), this.cache, this.credentials.Uri); + var sampledFunctionParameter1 = new Parameter(Guid.NewGuid(), this.cache, this.credentials.Uri); + var sampledFunctionParameter2 = new Parameter(Guid.NewGuid(), this.cache, this.credentials.Uri); + + sampledFunctionParameter1.ParameterType = sampledFunctionParameterType; + sampledFunctionParameter2.ParameterType = sampledFunctionParameterType; + elementDefinition1.Parameter.Add(sampledFunctionParameter1); + elementDefinition2.Parameter.Add(sampledFunctionParameter2); + this.iterationPoco.Element.Add(elementDefinition1); + this.iterationPoco.Element.Add(elementDefinition2); + + var elementUsage = new CDP4Common.EngineeringModelData.ElementUsage(Guid.NewGuid(), this.cache, this.credentials.Uri); + elementUsage.ElementDefinition = elementDefinition2; + var parameterOverride = new CDP4Common.EngineeringModelData.ParameterOverride(Guid.NewGuid(), this.cache, this.credentials.Uri); + parameterOverride.Parameter = sampledFunctionParameter2; + elementUsage.ParameterOverride.Add(parameterOverride); + + elementDefinition1.ContainedElement.Add(elementUsage); + + //Create the DTO again as it might have been changed + this.iteration = (Iteration)this.iterationPoco.ToDto(); } } } diff --git a/CDP4JsonFileDal/CDP4JsonFileDal.csproj b/CDP4JsonFileDal/CDP4JsonFileDal.csproj index ac5d6152c..5480e15c7 100644 --- a/CDP4JsonFileDal/CDP4JsonFileDal.csproj +++ b/CDP4JsonFileDal/CDP4JsonFileDal.csproj @@ -4,7 +4,7 @@ net462;net47;net471;net472;net48;netstandard2.0;netstandard2.1 RHEA System S.A. CDP4JsonFileDal Community Edition - 24.3.0 + 24.4.0 CDP4 Json File Dal Plugin Copyright © RHEA System S.A. Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathanael @@ -20,7 +20,7 @@ CDP COMET ECSS-E-TM-10-25 LGPL-3.0-only - [UPGRADE] CDP4Common 24.3.0 + [ADD] Support for ANNEX.C3 archive creation and instances of newer model items. README.md diff --git a/CDP4JsonFileDal/JsonFileDal.cs b/CDP4JsonFileDal/JsonFileDal.cs index 12059b24d..95fa8c07b 100644 --- a/CDP4JsonFileDal/JsonFileDal.cs +++ b/CDP4JsonFileDal/JsonFileDal.cs @@ -1,17 +1,17 @@ // ------------------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2015-2021 RHEA System S.A. +// Copyright (c) 2015-2023 RHEA System S.A. // // Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexandervan Delft, Nathanael Smiechowski, Ahmed Abulwafa Ahmed // // This file is part of COMET-SDK Community Edition // -// The COMET-SDK Community Edition is free software; you can redistribute it and/or +// The CDP4-COMET-SDK Community Edition is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // -// The COMET-SDK Community Edition is distributed in the hope that it will be useful, +// The CDP4-COMET-SDK Community Edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -24,10 +24,6 @@ namespace CDP4JsonFileDal { -#if NETFRAMEWORK - using System.ComponentModel.Composition; -#endif - using System; using System.Collections.Generic; using System.Diagnostics; @@ -39,13 +35,14 @@ namespace CDP4JsonFileDal using CDP4Common.CommonData; using CDP4Common.Comparers; using CDP4Common.EngineeringModelData; + using CDP4Common.Exceptions; using CDP4Common.SiteDirectoryData; - using CDP4Dal.Operations; using CDP4Dal; using CDP4Dal.Composition; using CDP4Dal.DAL; using CDP4Dal.Exceptions; + using CDP4Dal.Operations; using CDP4JsonFileDal.Json; @@ -55,7 +52,12 @@ namespace CDP4JsonFileDal using NLog; + using Person = CDP4Common.SiteDirectoryData.Person; + using SiteDirectory = CDP4Common.SiteDirectoryData.SiteDirectory; using Thing = CDP4Common.DTO.Thing; +#if NETFRAMEWORK + using System.ComponentModel.Composition; +#endif /// /// Provides the Data Access Layer for file based import/export @@ -135,7 +137,7 @@ public JsonFileDal(Version dalVersion) /// The that is used to create the /// Header copyright text /// Header remark text - public void UpdateExchangeFileHeader(CDP4Common.SiteDirectoryData.Person person, string headerCopyright = null, string headerRemark = null) + public void UpdateExchangeFileHeader(Person person, string headerCopyright = null, string headerRemark = null) { var exchangeFileHeader = JsonFileDalUtils.CreateExchangeFileHeader(person); exchangeFileHeader.Remark = headerRemark ?? exchangeFileHeader.Remark; @@ -152,10 +154,7 @@ public void UpdateExchangeFileHeader(CDP4Common.SiteDirectoryData.Person person, /// /// Gets the value indicating whether this is read only /// - public override bool IsReadOnly - { - get { return true; } - } + public override bool IsReadOnly => true; /// /// Gets the @@ -172,29 +171,31 @@ public override bool IsReadOnly /// The path to the files that need to be uploaded. If is null, then no files are to be uploaded /// /// - /// A list of s that has been created or updated since the last Read or Write operation. + /// A list of s that has been created or updated since the last Read or Write operation. /// public override Task> Write(IEnumerable operationContainers, IEnumerable extensionFiles = null) { this.ValidateOperationContainers(operationContainers); - CDP4Common.SiteDirectoryData.SiteDirectory siteDirectory = null; - var iterations = new HashSet(); - var siteReferenceDataLibraries = new HashSet(); - var modelReferenceDataLibraries = new HashSet(); - var domainOfExpertises = new HashSet(); - var persons = new HashSet(); - var personRoles = new HashSet(); - var participantRoles = new HashSet(); - var organizations = new HashSet(); - var engineeringModelSetups = new HashSet(); - var iterationSetups = new HashSet(); + SiteDirectory siteDirectory = null; + var iterations = new HashSet(); + var siteReferenceDataLibraries = new HashSet(); + var modelReferenceDataLibraries = new HashSet(); + var domainOfExpertises = new HashSet(); + var persons = new HashSet(); + var personRoles = new HashSet(); + var participantRoles = new HashSet(); + var organizations = new HashSet(); + var engineeringModelSetups = new HashSet(); + var iterationSetups = new HashSet(); + + var allExtraInstancesToRemove = new HashSet(); foreach (var operationContainer in operationContainers) { var operation = operationContainer.Operations.First(x => x.ModifiedThing is CDP4Common.DTO.Iteration); var iterationDto = (CDP4Common.DTO.Iteration)operation.ModifiedThing; - var iterationPoco = (CDP4Common.EngineeringModelData.Iteration)iterationDto.QuerySourceThing(); + var iterationPoco = (Iteration)iterationDto.QuerySourceThing(); JsonFileDalUtils.AddIteration(iterationPoco, ref iterations); @@ -204,12 +205,12 @@ public override Task> Write(IEnumerable o var iterationRequiredRls = iterationPoco.RequiredRdls; JsonFileDalUtils.AddReferenceDataLibraries(iterationRequiredRls, ref siteReferenceDataLibraries, ref modelReferenceDataLibraries); - var engineeringModelSetup = (CDP4Common.SiteDirectoryData.EngineeringModelSetup)iterationSetup.Container; + var engineeringModelSetup = (EngineeringModelSetup)iterationSetup.Container; JsonFileDalUtils.AddEngineeringModelSetup(engineeringModelSetup, ref engineeringModelSetups); if (siteDirectory == null) { - siteDirectory = (CDP4Common.SiteDirectoryData.SiteDirectory)engineeringModelSetup.Container; + siteDirectory = (SiteDirectory)engineeringModelSetup.Container; } // add the domains-of-expertise that are to be included in the File @@ -220,20 +221,47 @@ public override Task> Write(IEnumerable o // add organizations that are referrenced by ReferencedSource JsonFileDalUtils.AddOrganizations(iterationRequiredRls, ref organizations); + + var allPocos = siteReferenceDataLibraries.ToList().Cast() + .Union(domainOfExpertises.ToList()) + .Union(persons.ToList()) + .Union(personRoles.ToList()) + .Union(participantRoles.ToList()) + .Union(organizations.ToList()) + .Union(engineeringModelSetups.ToList()) + .Union(iterationSetups.ToList()) + .Union(iterationPoco.QueryContainedThingsDeep()) + .Union(siteReferenceDataLibraries.SelectMany(x => x.QueryContainedThingsDeep()) + .Union(modelReferenceDataLibraries.SelectMany(x => x.QueryContainedThingsDeep()))); + + foreach (var extraInstanceToRemove in this.FindNonSupportedVersionThings(allPocos)) + { + allExtraInstancesToRemove.Add(extraInstanceToRemove); + } } var path = this.Session.Credentials.Uri.LocalPath; var prunedSiteDirectoryDtos = JsonFileDalUtils.CreateSiteDirectoryAndPrunedContainedThingDtos( - siteDirectory, - siteReferenceDataLibraries, - domainOfExpertises, - persons, - personRoles, - participantRoles, - organizations, - engineeringModelSetups, - iterationSetups); + siteDirectory, + siteReferenceDataLibraries, + domainOfExpertises, + persons, + personRoles, + participantRoles, + organizations, + engineeringModelSetups, + iterationSetups) + .Where(x => !allExtraInstancesToRemove.Contains(x.Iid)) + .ToList(); + + foreach (var dto in prunedSiteDirectoryDtos) + { + if (!dto.TryRemoveReferences(allExtraInstancesToRemove, out var errors)) + { + throw new ModelErrorException(string.Join("\n", errors)); + } + } var activePerson = JsonFileDalUtils.QueryActivePerson(this.Session.Credentials.UserName, siteDirectory); @@ -249,12 +277,13 @@ public override Task> Write(IEnumerable o this.WriteSiteDirectoryToZipFile(prunedSiteDirectoryDtos, zipFile, path); - this.WriteSiteReferenceDataLibraryToZipFile(siteReferenceDataLibraries, zipFile, path); + this.WriteSiteReferenceDataLibraryToZipFile(siteReferenceDataLibraries, allExtraInstancesToRemove, zipFile, path); - this.WriteModelReferenceDataLibraryToZipFile(modelReferenceDataLibraries, zipFile, path); + this.WriteModelReferenceDataLibraryToZipFile(modelReferenceDataLibraries, allExtraInstancesToRemove, zipFile, path); - this.WriteIterationsToZipFile(iterations, zipFile, path); + this.WriteIterationsToZipFile(iterations, allExtraInstancesToRemove, zipFile, path); + //ToDo: GH283: Remove extensionsFiles that are referenced by removed instances this.WriteExtensionFilesToZipFile(extensionFiles, zipFile, path); } @@ -268,6 +297,49 @@ public override Task> Write(IEnumerable o return Task.FromResult(Enumerable.Empty()); } + /// + /// Find not supported things by model version + /// + /// A list of s where to find incompatible objects in + /// A collection of not supported things based on their model version + private IEnumerable FindNonSupportedVersionThings(IEnumerable allPocos) + { + var filterOutObjects = new List(); + var pocosToCheck = allPocos.ToList(); + + foreach (var thing in pocosToCheck) + { + var typeName = thing.ClassKind.ToString(); + var classVersion = new Version(this.MetaDataProvider.GetClassVersion(typeName)); + + if (classVersion > this.DalVersion) + { + filterOutObjects.Add(thing); + } + } + + var allThingsToRemove = new HashSet(filterOutObjects.Select(x => x.Iid)); + var extraThingsToRemove = new HashSet(allThingsToRemove); + + while (extraThingsToRemove.Any()) + { + var newThingsToRemove = new HashSet(); + + foreach (var thing in pocosToCheck.ToList()) + { + if (thing.HasMandatoryReferenceToAny(extraThingsToRemove)) + { + allThingsToRemove.Add(thing.Iid); + newThingsToRemove.Add(thing.Iid); + } + } + + extraThingsToRemove = newThingsToRemove; + } + + return allThingsToRemove; + } + /// /// Write all the s from an asynchronously. /// @@ -314,7 +386,7 @@ public override async Task> Read(T thing, CancellationToke throw new NotSupportedException("The JSONFileDal only supports Read on Iteration, SiteReferenceDataLibrary and DomainOfExpertise instances."); } - if (this.Credentials.Uri == null) + if (this.Credentials.Uri == null) { throw new ArgumentNullException(nameof(this.Credentials.Uri), $"The Credentials URI may not be null"); } @@ -397,7 +469,7 @@ public override async Task> Read(CDP4Common.DTO.Iteration ite /// /// Retrieves all data necessary for the transfer of a DomainOfExpertise /// - /// The + /// The /// All SiteDirectory DTOs /// List of things contained by the particular srdl private List RetrieveDomainOfExpertiseThings(CDP4Common.DTO.DomainOfExpertise domain, List siteDirectoryData) @@ -413,7 +485,7 @@ private List RetrieveDomainOfExpertiseThings(CDP4Common.DTO.DomainOfExper { var thingDto = siteDirectoryData.FirstOrDefault(s => s.Iid.Equals(refThing)) as CDP4Common.DTO.Alias; - if(thingDto != null) + if (thingDto != null) { thingDto.ExcludedPerson.Clear(); thingDto.ExcludedDomain.Clear(); @@ -470,12 +542,12 @@ private List RetrieveDomainOfExpertiseThings(CDP4Common.DTO.DomainOfExper /// /// Retrieves all data necessary for the transfer of a SRDL /// - /// The + /// The /// All SiteDirectory DTOs /// The zip file /// The object /// List of things contained by the particular srdl - private List RetrieveSRDLThings(CDP4Common.DTO.SiteReferenceDataLibrary siteRdl, List siteDirectoryData, ZipFile zip, CDP4Common.SiteDirectoryData.SiteDirectory siteDir) + private List RetrieveSRDLThings(CDP4Common.DTO.SiteReferenceDataLibrary siteRdl, List siteDirectoryData, ZipFile zip, SiteDirectory siteDir) { var returned = new List(); @@ -483,6 +555,7 @@ private List RetrieveSRDLThings(CDP4Common.DTO.SiteReferenceDataLibrary s // load the reference data libraries as per the containment chain var requiredRdl = srdl; + while (requiredRdl != null) { // add the rdlDto to the returned collection to make sure it's content gets dereferenced @@ -504,12 +577,12 @@ private List RetrieveSRDLThings(CDP4Common.DTO.SiteReferenceDataLibrary s /// /// Retrieves all data necessary for the transfer of an iteration /// - /// The + /// The /// All SiteDirectory DTOs /// The zip file /// The object /// List of things relevant for a particular iteration - private List RetrieveIterationThings(CDP4Common.DTO.Iteration iteration, List siteDirectoryData, ZipFile zip, CDP4Common.SiteDirectoryData.SiteDirectory siteDir) + private List RetrieveIterationThings(CDP4Common.DTO.Iteration iteration, List siteDirectoryData, ZipFile zip, SiteDirectory siteDir) { var engineeringModelSetup = siteDir.Model.SingleOrDefault(x => x.IterationSetup.Any(y => y.IterationIid == iteration.Iid)); @@ -521,8 +594,10 @@ private List RetrieveIterationThings(CDP4Common.DTO.Iteration iteration, // read engineeringmodel var engineeringModelFilePath = $"{engineeringModelSetup.EngineeringModelIid}.json"; + var engineeringModelZipEntry = zip.Entries.SingleOrDefault(x => x.FileName.EndsWith(engineeringModelFilePath)); + var returned = this.ReadInfoFromArchiveEntry(engineeringModelZipEntry, this.Credentials.Password); var iterationFilePath = $"{iteration.Iid}.json"; @@ -547,6 +622,7 @@ private List RetrieveIterationThings(CDP4Common.DTO.Iteration iteration, // load the reference data libraries as per the containment chain var requiredRdl = modelRdl.RequiredRdl; + while (requiredRdl != null) { // add the rdlDto to the returned collection to make sure it's content gets dereferenced @@ -818,7 +894,7 @@ private void WriteHeaderToZipFile(ExchangeFileHeader echExchangeFileHeader, ZipF /// /// The file Path. /// - private void WriteSiteDirectoryToZipFile(IEnumerable prunedSiteDirectoryContents, ZipFile zipFile, string filePath) + private void WriteSiteDirectoryToZipFile(IEnumerable prunedSiteDirectoryContents, ZipFile zipFile, string filePath) { using (var memoryStream = new MemoryStream()) { @@ -841,23 +917,39 @@ private void WriteSiteDirectoryToZipFile(IEnumerable prune /// /// The that are to be written to the /// + /// A collection of the id's (Guids) of all the thing instances to remove from reference properties before serialization + /// /// /// The target that the are written to. /// /// /// The file of the target /// - private void WriteSiteReferenceDataLibraryToZipFile(IEnumerable siteReferenceDataLibraries, ZipFile zipFile, string filePath) + private void WriteSiteReferenceDataLibraryToZipFile(IEnumerable siteReferenceDataLibraries, HashSet allExtraInstancesToRemove, ZipFile zipFile, string filePath) { foreach (var siteReferenceDataLibrary in siteReferenceDataLibraries) { var containmentPocos = siteReferenceDataLibrary.QueryContainedThingsDeep().ToList(); + if (containmentPocos.Contains(siteReferenceDataLibrary)) { containmentPocos.Remove(siteReferenceDataLibrary); } - var dtos = containmentPocos.Select(poco => poco.ToDto()).OrderBy(x => x.Iid, this.guidComparer); + var dtos = + containmentPocos + .Where(x => !allExtraInstancesToRemove.Contains(x.Iid)) + .Select(poco => poco.ToDto()) + .OrderBy(x => x.Iid, this.guidComparer) + .ToList(); + + foreach (var dto in dtos) + { + if (!dto.TryRemoveReferences(allExtraInstancesToRemove, out var errors)) + { + throw new ModelErrorException(string.Join("\n", errors)); + } + } using (var memoryStream = new MemoryStream()) { @@ -880,27 +972,44 @@ private void WriteSiteReferenceDataLibraryToZipFile(IEnumerable /// The that are to be written to the /// + /// A collection of the id's (Guids) of all the thing instances to remove from reference properties before serialization + /// /// /// The target that the are written to. /// /// /// The file of the target /// - private void WriteModelReferenceDataLibraryToZipFile(IEnumerable modelReferenceDataLibraries, ZipFile zipFile, string filePath) + private void WriteModelReferenceDataLibraryToZipFile(IEnumerable modelReferenceDataLibraries, HashSet allExtraInstancesToRemove, ZipFile zipFile, string filePath) { foreach (var modelReferenceDataLibrary in modelReferenceDataLibraries) { var containmentPocos = modelReferenceDataLibrary.QueryContainedThingsDeep().ToList(); + if (containmentPocos.Contains(modelReferenceDataLibrary)) { containmentPocos.Remove(modelReferenceDataLibrary); } - var dtos = containmentPocos.Select(poco => poco.ToDto()).OrderBy(x => x.Iid, this.guidComparer); + var dtos = + containmentPocos + .Where(x => !allExtraInstancesToRemove.Contains(x.Iid)) + .Select(poco => poco.ToDto()) + .OrderBy(x => x.Iid, this.guidComparer) + .ToList(); + + foreach (var dto in dtos) + { + if (!dto.TryRemoveReferences(allExtraInstancesToRemove, out var errors)) + { + throw new ModelErrorException(string.Join("\n", errors)); + } + } using (var memoryStream = new MemoryStream()) { this.Serializer.SerializeToStream(dtos, memoryStream); + using (var outputStream = new MemoryStream(memoryStream.ToArray())) { var modelReferenceDataLibraryFilename = $"{ModelRdlZipLocation}\\{modelReferenceDataLibrary.Iid}.json"; @@ -918,19 +1027,21 @@ private void WriteModelReferenceDataLibraryToZipFile(IEnumerable /// The that are to be written to the /// + /// A collection of the id's (Guids) of all the thing instances to remove from reference properties before serialization + /// /// /// The target that the are written to. /// /// /// The file of the target /// - private void WriteIterationsToZipFile(IEnumerable iterations, ZipFile zipFile, string filePath) + private void WriteIterationsToZipFile(IEnumerable iterations, HashSet allExtraInstancesToRemove, ZipFile zipFile, string filePath) { - var engineeringModels = new List(); + var engineeringModels = new List(); foreach (var iteration in iterations) { - var engineeringModel = (CDP4Common.EngineeringModelData.EngineeringModel)iteration.Container; + var engineeringModel = (EngineeringModel)iteration.Container; var engineeringModelDto = engineeringModel.ToDto(); if (!engineeringModels.Contains(engineeringModel)) @@ -952,7 +1063,21 @@ private void WriteIterationsToZipFile(IEnumerable poco.ToDto()).OrderBy(x => x.Iid, this.guidComparer); + + var dtos = + containmentPocos + .Where(x => !allExtraInstancesToRemove.Contains(x.Iid)) + .Select(poco => poco.ToDto()) + .OrderBy(x => x.Iid, this.guidComparer) + .ToList(); + + foreach (var dto in dtos) + { + if (!dto.TryRemoveReferences(allExtraInstancesToRemove, out var errors)) + { + throw new ModelErrorException(string.Join("\n", errors)); + } + } using (var iterationMemoryStream = new MemoryStream()) { diff --git a/CDP4JsonSerializer/CDP4JsonSerializer.csproj b/CDP4JsonSerializer/CDP4JsonSerializer.csproj index 179fb77b2..e1e7c2484 100644 --- a/CDP4JsonSerializer/CDP4JsonSerializer.csproj +++ b/CDP4JsonSerializer/CDP4JsonSerializer.csproj @@ -4,7 +4,7 @@ net462;net47;net471;net472;net48;netstandard2.0;netstandard2.1 RHEA System S.A. CDP4JsonSerializer Community Edition - 24.3.0 + 24.4.0 CDP4 JSON Serialization Library Copyright © RHEA System S.A. Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathanael @@ -20,7 +20,7 @@ CDP COMET ECSS-E-TM-10-25 JSON LGPL-3.0-only - [UPGRADE] CDP4Common 24.3.0 + [UPGRADE] CDP4Common 24.4.0 README.md diff --git a/CDP4MessagePackSerializer/CDP4MessagePackSerializer.csproj b/CDP4MessagePackSerializer/CDP4MessagePackSerializer.csproj index 382bccdfa..1dfdac6b6 100644 --- a/CDP4MessagePackSerializer/CDP4MessagePackSerializer.csproj +++ b/CDP4MessagePackSerializer/CDP4MessagePackSerializer.csproj @@ -4,7 +4,7 @@ net462;net47;net471;net472;net48;netstandard2.0;netstandard2.1 RHEA System S.A. CDP4MessagePackSerializer Community Edition - 24.3.0 + 24.4.0 CDP4 MessagePack Serialization Library Copyright © RHEA System S.A. Sam, Alex, Alexander, Nathanael, Antoine, Omar @@ -20,7 +20,7 @@ CDP COMET ECSS-E-TM-10-25 MessagePack LGPL-3.0-only - [UPGRADE] CDP4Common 24.3.0 + [UPGRADE] CDP4Common 24.4.0 README.md diff --git a/CDP4Reporting/CDP4Reporting.csproj b/CDP4Reporting/CDP4Reporting.csproj index d4cdaeb54..f912c4307 100644 --- a/CDP4Reporting/CDP4Reporting.csproj +++ b/CDP4Reporting/CDP4Reporting.csproj @@ -4,7 +4,7 @@ netstandard2.0 RHEA System S.A. CDP4Reporting Community Edition - 24.3.0 + 24.4.0 CDP4 Reporting Copyright © RHEA System S.A. Sam, Alex, Alexander @@ -20,7 +20,7 @@ CDP COMET ECSS-E-TM-10-25 LGPL-3.0-only - [UPGRADE] CDP4Common 24.3.0 + [UPGRADE] CDP4Common 24.4.0 latest README.md diff --git a/CDP4RequirementsVerification/CDP4RequirementsVerification.csproj b/CDP4RequirementsVerification/CDP4RequirementsVerification.csproj index d3c99fc36..32cfae5be 100644 --- a/CDP4RequirementsVerification/CDP4RequirementsVerification.csproj +++ b/CDP4RequirementsVerification/CDP4RequirementsVerification.csproj @@ -4,7 +4,7 @@ net462;net47;net471;net472;net48;netstandard2.0;netstandard2.1 RHEA System S.A. CDP4RequirementsVerification Community Edition - 24.3.0 + 24.4.0 CDP4 Class Library that provides requirement verification Copyright © RHEA System S.A. Sam, Alex, Alexander, Yevhen, Nathanael @@ -20,7 +20,7 @@ CDP COMET ECSS-E-TM-10-25 LGPL-3.0-only - [UPGRADE] CDP4Common 24.3.0 + [UPGRADE] CDP4Common 24.4.0 README.md diff --git a/CDP4Rules/CDP4Rules.csproj b/CDP4Rules/CDP4Rules.csproj index 7d460e2f9..8d8bd465c 100644 --- a/CDP4Rules/CDP4Rules.csproj +++ b/CDP4Rules/CDP4Rules.csproj @@ -4,7 +4,7 @@ net462;net47;net471;net472;net48;netstandard2.0;netstandard2.1 RHEA System S.A. CDP4Rules Community Edition - 24.3.0 + 24.4.0 CDP4 Class Library that provides Model Analysis and Rule Checking Copyright © RHEA System S.A. Sam, Alex, Alexander, Yevhen, Nathanael diff --git a/CDP4ServicesDal/CDP4ServicesDal.csproj b/CDP4ServicesDal/CDP4ServicesDal.csproj index fe233ea64..83af6969e 100644 --- a/CDP4ServicesDal/CDP4ServicesDal.csproj +++ b/CDP4ServicesDal/CDP4ServicesDal.csproj @@ -4,7 +4,7 @@ net462;net47;net471;net472;net48;netstandard2.0;netstandard2.1 RHEA System S.A. CDP4ServicesDal Community Edition - 24.3.0 + 24.4.0 CDP4ServicesDal Dal Plugin Copyright © RHEA System S.A. Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathanael @@ -20,7 +20,7 @@ CDP COMET ECSS-E-TM-10-25 LGPL-3.0-only - [UPGRADE] CDP4Common 24.3.0 + [UPGRADE] CDP4Common 24.4.0 README.md diff --git a/CDP4WspDal/CDP4WspDal.csproj b/CDP4WspDal/CDP4WspDal.csproj index c527501e6..6374d1147 100644 --- a/CDP4WspDal/CDP4WspDal.csproj +++ b/CDP4WspDal/CDP4WspDal.csproj @@ -4,7 +4,7 @@ net462;net47;net471;net472;net48;netstandard2.0;netstandard2.1 RHEA System S.A. CDP4WspDal Community Edition - 24.3.0 + 24.4.0 CDP4 WSP Dal Plugin Copyright © RHEA System S.A. Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathanael @@ -20,7 +20,7 @@ CDP COMET ECSS-E-TM-10-25 LGPL-3.0-only - [UPGRADE] CDP4Common 24.3.0 + [UPGRADE] CDP4Common 24.4.0 README.md