private void AddCopyClosureDirectives(ICopyClosureManager closureManager) { #region Closures for explicit relationships // Override the default embedding behavior. We only need property definitions that we're currently referencing, not the full group. closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(CustomPropertyGroupContainsCustomPropertyDefinition.CustomPropertyDefinitionDomainRoleId), new DomainRoleClosureRestriction(CustomPropertyGroupContainsCustomPropertyDefinition.CustomPropertyGroupDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(CustomPropertyHasCustomPropertyDefinition.CustomPropertyDomainRoleId), new DomainRoleClosureRestriction(CustomPropertyHasCustomPropertyDefinition.CustomPropertyDefinitionDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ORMSolutions.ORMArchitect.Core.ObjectModel.ORMModelElementHasExtensionElement.ExtendedElementDomainRoleId), new DomainRoleClosureRestriction(ORMSolutions.ORMArchitect.Core.ObjectModel.ORMModelElementHasExtensionElement.ExtensionDomainRoleId, CustomProperty.DomainClassId, false), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); #endregion // Closures for explicit relationships }
private void AddCopyClosureDirectives(ICopyClosureManager closureManager) { #region Closures for explicit relationships // Override the default embedding behavior. We only need property definitions that we're currently referencing, not the full group. closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(CustomPropertyGroupContainsCustomPropertyDefinition.CustomPropertyDefinitionDomainRoleId), new DomainRoleClosureRestriction(CustomPropertyGroupContainsCustomPropertyDefinition.CustomPropertyGroupDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(CustomPropertyHasCustomPropertyDefinition.CustomPropertyDomainRoleId), new DomainRoleClosureRestriction(CustomPropertyHasCustomPropertyDefinition.CustomPropertyDefinitionDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ORMSolutions.ORMArchitect.Core.ObjectModel.ORMModelElementHasExtensionElement.ExtendedElementDomainRoleId), new DomainRoleClosureRestriction(ORMSolutions.ORMArchitect.Core.ObjectModel.ORMModelElementHasExtensionElement.ExtensionDomainRoleId, CustomProperty.DomainClassId, false), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); #endregion // Closures for explicit relationships }
void ICopyClosureProvider.AddCopyClosureDirectives(ICopyClosureManager closureManager) { this.AddCopyClosureDirectives(closureManager); }
private void AddCopyClosureDirectives(ICopyClosureManager closureManager) { #region Automatic top-level embedding relationships closureManager.AddRootEmbeddingRelationship(ModelHasObjectType.DomainClassId); closureManager.AddRootEmbeddingRelationship(ModelHasFactType.DomainClassId); closureManager.AddRootEmbeddingRelationship(ModelHasError.DomainClassId); closureManager.AddRootEmbeddingRelationship(ModelHasReferenceModeKind.DomainClassId); closureManager.AddRootEmbeddingRelationship(ModelHasReferenceMode.DomainClassId); closureManager.AddRootEmbeddingRelationship(ModelHasSetConstraint.DomainClassId); closureManager.AddRootEmbeddingRelationship(ModelHasSetComparisonConstraint.DomainClassId); closureManager.AddRootEmbeddingRelationship(ModelHasDataType.DomainClassId); closureManager.AddRootEmbeddingRelationship(GenerationStateHasGenerationSetting.DomainClassId); closureManager.AddRootEmbeddingRelationship(ModelContainsRecognizedPhrase.DomainClassId); closureManager.AddRootEmbeddingRelationship(ModelHasDefinition.DomainClassId); closureManager.AddRootEmbeddingRelationship(ModelHasPrimaryNote.DomainClassId); closureManager.AddRootEmbeddingRelationship(ModelHasModelNote.DomainClassId); closureManager.AddRootEmbeddingRelationship(ModelHasModelErrorDisplayFilter.DomainClassId); closureManager.AddRootEmbeddingRelationship(ElementGroupingSetRelatesToORMModel.DomainClassId); closureManager.AddRootEmbeddingRelationship(ElementGroupingSetContainsElementGrouping.DomainClassId); closureManager.AddRootEmbeddingRelationship(ModelDefinesFunction.DomainClassId); #endregion // Automatic top-level embedding relationships #region Closures for standard embedding relationships closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(CalculatedPathValueHasInput.InputDomainRoleId), new DomainRoleClosureRestriction(CalculatedPathValueHasInput.CalculatedValueDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(CalculatedPathValueHasInput.CalculatedValueDomainRoleId), new DomainRoleClosureRestriction(CalculatedPathValueHasInput.InputDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(CalculatedPathValueInputBindsToPathConstant.SourceDomainRoleId), new DomainRoleClosureRestriction(CalculatedPathValueInputBindsToPathConstant.InputDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(CalculatedPathValueInputBindsToPathConstant.InputDomainRoleId), new DomainRoleClosureRestriction(CalculatedPathValueInputBindsToPathConstant.SourceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ConstraintRoleProjectedFromPathConstant.SourceDomainRoleId), new DomainRoleClosureRestriction(ConstraintRoleProjectedFromPathConstant.ConstraintRoleProjectionDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ConstraintRoleProjectedFromPathConstant.ConstraintRoleProjectionDomainRoleId), new DomainRoleClosureRestriction(ConstraintRoleProjectedFromPathConstant.SourceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ConstraintRoleSequenceHasJoinPath.JoinPathDomainRoleId), new DomainRoleClosureRestriction(ConstraintRoleSequenceHasJoinPath.RoleSequenceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ConstraintRoleSequenceHasJoinPath.RoleSequenceDomainRoleId), new DomainRoleClosureRestriction(ConstraintRoleSequenceHasJoinPath.JoinPathDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ElementGroupingHasDefinition.DefinitionDomainRoleId), new DomainRoleClosureRestriction(ElementGroupingHasDefinition.GroupingDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ElementGroupingHasDefinition.GroupingDomainRoleId), new DomainRoleClosureRestriction(ElementGroupingHasDefinition.DefinitionDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ElementGroupingHasNote.NoteDomainRoleId), new DomainRoleClosureRestriction(ElementGroupingHasNote.GroupingDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ElementGroupingHasNote.GroupingDomainRoleId), new DomainRoleClosureRestriction(ElementGroupingHasNote.NoteDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ElementGroupingIsOfElementGroupingType.GroupingTypeDomainRoleId), new DomainRoleClosureRestriction(ElementGroupingIsOfElementGroupingType.GroupingDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ElementGroupingIsOfElementGroupingType.GroupingDomainRoleId), new DomainRoleClosureRestriction(ElementGroupingIsOfElementGroupingType.GroupingTypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(EntityTypeHasEntityTypeInstance.EntityTypeInstanceDomainRoleId), new DomainRoleClosureRestriction(EntityTypeHasEntityTypeInstance.EntityTypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(EntityTypeHasEntityTypeInstance.EntityTypeDomainRoleId), new DomainRoleClosureRestriction(EntityTypeHasEntityTypeInstance.EntityTypeInstanceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(EntityTypeSubtypeHasEntityTypeSubtypeInstance.EntityTypeSubtypeInstanceDomainRoleId), new DomainRoleClosureRestriction(EntityTypeSubtypeHasEntityTypeSubtypeInstance.EntityTypeSubtypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(EntityTypeSubtypeHasEntityTypeSubtypeInstance.EntityTypeSubtypeDomainRoleId), new DomainRoleClosureRestriction(EntityTypeSubtypeHasEntityTypeSubtypeInstance.EntityTypeSubtypeInstanceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeDerivationRuleHasDerivationNote.DerivationNoteDomainRoleId), new DomainRoleClosureRestriction(FactTypeDerivationRuleHasDerivationNote.DerivationRuleDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeDerivationRuleHasDerivationNote.DerivationRuleDomainRoleId), new DomainRoleClosureRestriction(FactTypeDerivationRuleHasDerivationNote.DerivationNoteDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeHasDefinition.DefinitionDomainRoleId), new DomainRoleClosureRestriction(FactTypeHasDefinition.FactTypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeHasDefinition.FactTypeDomainRoleId), new DomainRoleClosureRestriction(FactTypeHasDefinition.DefinitionDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeHasDerivationRule.DerivationRuleDomainRoleId), new DomainRoleClosureRestriction(FactTypeHasDerivationRule.FactTypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeHasDerivationRule.FactTypeDomainRoleId), new DomainRoleClosureRestriction(FactTypeHasDerivationRule.DerivationRuleDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeHasFactTypeInstance.FactTypeInstanceDomainRoleId), new DomainRoleClosureRestriction(FactTypeHasFactTypeInstance.FactTypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeHasFactTypeInstance.FactTypeDomainRoleId), new DomainRoleClosureRestriction(FactTypeHasFactTypeInstance.FactTypeInstanceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeHasNote.NoteDomainRoleId), new DomainRoleClosureRestriction(FactTypeHasNote.FactTypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeHasNote.FactTypeDomainRoleId), new DomainRoleClosureRestriction(FactTypeHasNote.NoteDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeHasReadingOrder.ReadingOrderDomainRoleId), new DomainRoleClosureRestriction(FactTypeHasReadingOrder.FactTypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeHasReadingOrder.FactTypeDomainRoleId), new DomainRoleClosureRestriction(FactTypeHasReadingOrder.ReadingOrderDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeHasRole.RoleDomainRoleId), new DomainRoleClosureRestriction(FactTypeHasRole.FactTypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeHasRole.FactTypeDomainRoleId), new DomainRoleClosureRestriction(FactTypeHasRole.RoleDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeRoleProjectedFromPathConstant.SourceDomainRoleId), new DomainRoleClosureRestriction(FactTypeRoleProjectedFromPathConstant.RoleProjectionDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeRoleProjectedFromPathConstant.RoleProjectionDomainRoleId), new DomainRoleClosureRestriction(FactTypeRoleProjectedFromPathConstant.SourceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FunctionOperatesOnParameter.ParameterDomainRoleId), new DomainRoleClosureRestriction(FunctionOperatesOnParameter.FunctionDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FunctionOperatesOnParameter.FunctionDomainRoleId), new DomainRoleClosureRestriction(FunctionOperatesOnParameter.ParameterDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(LeadRolePathCalculatesCalculatedPathValue.CalculatedValueDomainRoleId), new DomainRoleClosureRestriction(LeadRolePathCalculatesCalculatedPathValue.LeadRolePathDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(LeadRolePathCalculatesCalculatedPathValue.LeadRolePathDomainRoleId), new DomainRoleClosureRestriction(LeadRolePathCalculatesCalculatedPathValue.CalculatedValueDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(LeadRolePathHasNote.NoteDomainRoleId), new DomainRoleClosureRestriction(LeadRolePathHasNote.LeadRolePathDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(LeadRolePathHasNote.LeadRolePathDomainRoleId), new DomainRoleClosureRestriction(LeadRolePathHasNote.NoteDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(LeadRolePathHasObjectUnifier.ObjectUnifierDomainRoleId), new DomainRoleClosureRestriction(LeadRolePathHasObjectUnifier.LeadRolePathDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(LeadRolePathHasObjectUnifier.LeadRolePathDomainRoleId), new DomainRoleClosureRestriction(LeadRolePathHasObjectUnifier.ObjectUnifierDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(NameGeneratorRefinesNameGenerator.RefinementDomainRoleId), new DomainRoleClosureRestriction(NameGeneratorRefinesNameGenerator.ParentDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(NameGeneratorRefinesNameGenerator.ParentDomainRoleId), new DomainRoleClosureRestriction(NameGeneratorRefinesNameGenerator.RefinementDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ObjectTypeHasAbbreviation.AbbreviationDomainRoleId), new DomainRoleClosureRestriction(ObjectTypeHasAbbreviation.ObjectTypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ObjectTypeHasAbbreviation.ObjectTypeDomainRoleId), new DomainRoleClosureRestriction(ObjectTypeHasAbbreviation.AbbreviationDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ObjectTypeHasDefinition.DefinitionDomainRoleId), new DomainRoleClosureRestriction(ObjectTypeHasDefinition.ObjectTypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ObjectTypeHasDefinition.ObjectTypeDomainRoleId), new DomainRoleClosureRestriction(ObjectTypeHasDefinition.DefinitionDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ObjectTypeHasNote.NoteDomainRoleId), new DomainRoleClosureRestriction(ObjectTypeHasNote.ObjectTypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ObjectTypeHasNote.ObjectTypeDomainRoleId), new DomainRoleClosureRestriction(ObjectTypeHasNote.NoteDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(PathedRoleHasValueConstraint.ValueConstraintDomainRoleId), new DomainRoleClosureRestriction(PathedRoleHasValueConstraint.PathedRoleDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(PathedRoleHasValueConstraint.PathedRoleDomainRoleId), new DomainRoleClosureRestriction(PathedRoleHasValueConstraint.ValueConstraintDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ReadingOrderHasReading.ReadingDomainRoleId), new DomainRoleClosureRestriction(ReadingOrderHasReading.ReadingOrderDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ReadingOrderHasReading.ReadingOrderDomainRoleId), new DomainRoleClosureRestriction(ReadingOrderHasReading.ReadingDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(RecognizedPhraseHasAbbreviation.AbbreviationDomainRoleId), new DomainRoleClosureRestriction(RecognizedPhraseHasAbbreviation.RecognizedPhraseDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(RecognizedPhraseHasAbbreviation.RecognizedPhraseDomainRoleId), new DomainRoleClosureRestriction(RecognizedPhraseHasAbbreviation.AbbreviationDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(RoleHasValueConstraint.ValueConstraintDomainRoleId), new DomainRoleClosureRestriction(RoleHasValueConstraint.RoleDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(RoleHasValueConstraint.RoleDomainRoleId), new DomainRoleClosureRestriction(RoleHasValueConstraint.ValueConstraintDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(RolePathOwnerOwnsLeadRolePath.RolePathDomainRoleId), new DomainRoleClosureRestriction(RolePathOwnerOwnsLeadRolePath.PathOwnerDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(RolePathOwnerOwnsLeadRolePath.PathOwnerDomainRoleId), new DomainRoleClosureRestriction(RolePathOwnerOwnsLeadRolePath.RolePathDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(RolePathRootHasValueConstraint.ValueConstraintDomainRoleId), new DomainRoleClosureRestriction(RolePathRootHasValueConstraint.PathRootDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(RolePathRootHasValueConstraint.PathRootDomainRoleId), new DomainRoleClosureRestriction(RolePathRootHasValueConstraint.ValueConstraintDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(RoleSubPathIsContinuationOfRolePath.SubPathDomainRoleId), new DomainRoleClosureRestriction(RoleSubPathIsContinuationOfRolePath.ParentRolePathDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(RoleSubPathIsContinuationOfRolePath.ParentRolePathDomainRoleId), new DomainRoleClosureRestriction(RoleSubPathIsContinuationOfRolePath.SubPathDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(SetComparisonConstraintHasDefinition.DefinitionDomainRoleId), new DomainRoleClosureRestriction(SetComparisonConstraintHasDefinition.SetComparisonConstraintDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(SetComparisonConstraintHasDefinition.SetComparisonConstraintDomainRoleId), new DomainRoleClosureRestriction(SetComparisonConstraintHasDefinition.DefinitionDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(SetComparisonConstraintHasNote.NoteDomainRoleId), new DomainRoleClosureRestriction(SetComparisonConstraintHasNote.SetComparisonConstraintDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(SetComparisonConstraintHasNote.SetComparisonConstraintDomainRoleId), new DomainRoleClosureRestriction(SetComparisonConstraintHasNote.NoteDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(SetComparisonConstraintHasRoleSequence.RoleSequenceDomainRoleId), new DomainRoleClosureRestriction(SetComparisonConstraintHasRoleSequence.ExternalConstraintDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(SetComparisonConstraintHasRoleSequence.ExternalConstraintDomainRoleId), new DomainRoleClosureRestriction(SetComparisonConstraintHasRoleSequence.RoleSequenceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(SetConstraintHasDefinition.DefinitionDomainRoleId), new DomainRoleClosureRestriction(SetConstraintHasDefinition.SetConstraintDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(SetConstraintHasDefinition.SetConstraintDomainRoleId), new DomainRoleClosureRestriction(SetConstraintHasDefinition.DefinitionDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(SetConstraintHasNote.NoteDomainRoleId), new DomainRoleClosureRestriction(SetConstraintHasNote.SetConstraintDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(SetConstraintHasNote.SetConstraintDomainRoleId), new DomainRoleClosureRestriction(SetConstraintHasNote.NoteDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(SubtypeDerivationRuleHasDerivationNote.DerivationNoteDomainRoleId), new DomainRoleClosureRestriction(SubtypeDerivationRuleHasDerivationNote.DerivationRuleDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(SubtypeDerivationRuleHasDerivationNote.DerivationRuleDomainRoleId), new DomainRoleClosureRestriction(SubtypeDerivationRuleHasDerivationNote.DerivationNoteDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(SubtypeHasDerivationRule.DerivationRuleDomainRoleId), new DomainRoleClosureRestriction(SubtypeHasDerivationRule.SubtypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(SubtypeHasDerivationRule.SubtypeDomainRoleId), new DomainRoleClosureRestriction(SubtypeHasDerivationRule.DerivationRuleDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ValueConstraintHasDefinition.DefinitionDomainRoleId), new DomainRoleClosureRestriction(ValueConstraintHasDefinition.ValueConstraintDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ValueConstraintHasDefinition.ValueConstraintDomainRoleId), new DomainRoleClosureRestriction(ValueConstraintHasDefinition.DefinitionDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ValueConstraintHasNote.NoteDomainRoleId), new DomainRoleClosureRestriction(ValueConstraintHasNote.ValueConstraintDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ValueConstraintHasNote.ValueConstraintDomainRoleId), new DomainRoleClosureRestriction(ValueConstraintHasNote.NoteDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ValueConstraintHasValueRange.ValueRangeDomainRoleId), new DomainRoleClosureRestriction(ValueConstraintHasValueRange.ValueConstraintDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ValueConstraintHasValueRange.ValueConstraintDomainRoleId), new DomainRoleClosureRestriction(ValueConstraintHasValueRange.ValueRangeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ValueTypeHasValueConstraint.ValueConstraintDomainRoleId), new DomainRoleClosureRestriction(ValueTypeHasValueConstraint.ValueTypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ValueTypeHasValueConstraint.ValueTypeDomainRoleId), new DomainRoleClosureRestriction(ValueTypeHasValueConstraint.ValueConstraintDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ContainedPart); #endregion // Closures for standard embedding relationships #region Embedded relationship ordering closureManager.AddOrderedRole(CalculatedPathValueHasInput.CalculatedValueDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddOrderedRole(EntityTypeHasEntityTypeInstance.EntityTypeDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddOrderedRole(EntityTypeSubtypeHasEntityTypeSubtypeInstance.EntityTypeSubtypeDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddOrderedRole(FactTypeHasFactTypeInstance.FactTypeDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddOrderedRole(FactTypeHasReadingOrder.FactTypeDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddOrderedRole(FactTypeHasRole.FactTypeDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddOrderedRole(FunctionOperatesOnParameter.FunctionDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddOrderedRole(LeadRolePathCalculatesCalculatedPathValue.LeadRolePathDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddOrderedRole(LeadRolePathHasObjectUnifier.LeadRolePathDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddOrderedRole(NameGeneratorRefinesNameGenerator.ParentDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddOrderedRole(ReadingOrderHasReading.ReadingOrderDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddOrderedRole(RolePathOwnerOwnsLeadRolePath.PathOwnerDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddOrderedRole(RoleSubPathIsContinuationOfRolePath.ParentRolePathDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddOrderedRole(SetComparisonConstraintHasRoleSequence.ExternalConstraintDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddOrderedRole(ValueConstraintHasValueRange.ValueConstraintDomainRoleId, MergeIntegrationOrder.AfterLeading); #endregion // Embedded relationship ordering #region Closures for explicit relationships closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(CalculatedPathValueAggregationContextIncludesPathedRole.CalculatedValueDomainRoleId), new DomainRoleClosureRestriction(CalculatedPathValueAggregationContextIncludesPathedRole.PathedRoleDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.InternalReferencedPart); closureManager.AddOrderedRole(CalculatedPathValueAggregationContextIncludesPathedRole.CalculatedValueDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(CalculatedPathValueAggregationContextIncludesRolePathRoot.CalculatedValueDomainRoleId), new DomainRoleClosureRestriction(CalculatedPathValueAggregationContextIncludesRolePathRoot.PathRootDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.InternalReferencedPart); closureManager.AddOrderedRole(CalculatedPathValueAggregationContextIncludesRolePathRoot.CalculatedValueDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(CalculatedPathValueInputBindsToCalculatedPathValue.InputDomainRoleId), new DomainRoleClosureRestriction(CalculatedPathValueInputBindsToCalculatedPathValue.SourceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.InternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(CalculatedPathValueInputBindsToPathedRole.InputDomainRoleId), new DomainRoleClosureRestriction(CalculatedPathValueInputBindsToPathedRole.SourceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.InternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(CalculatedPathValueInputBindsToRolePathRoot.InputDomainRoleId), new DomainRoleClosureRestriction(CalculatedPathValueInputBindsToRolePathRoot.SourceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.InternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(CalculatedPathValueInputCorrespondsToFunctionParameter.InputDomainRoleId), new DomainRoleClosureRestriction(CalculatedPathValueInputCorrespondsToFunctionParameter.ParameterDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(CalculatedPathValueIsCalculatedWithFunction.CalculatedValueDomainRoleId), new DomainRoleClosureRestriction(CalculatedPathValueIsCalculatedWithFunction.FunctionDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ConstraintRoleProjectedFromCalculatedPathValue.ConstraintRoleProjectionDomainRoleId), new DomainRoleClosureRestriction(ConstraintRoleProjectedFromCalculatedPathValue.SourceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ConstraintRoleProjectedFromPathedRole.ConstraintRoleProjectionDomainRoleId), new DomainRoleClosureRestriction(ConstraintRoleProjectedFromPathedRole.SourceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ConstraintRoleProjectedFromRolePathRoot.ConstraintRoleProjectionDomainRoleId), new DomainRoleClosureRestriction(ConstraintRoleProjectedFromRolePathRoot.SourceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ConstraintRoleProjection.JoinPathProjectionDomainRoleId), new DomainRoleClosureRestriction(ConstraintRoleProjection.ProjectedConstraintRoleDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.InternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ConstraintRoleSequenceHasRole.RoleDomainRoleId), new DomainRoleClosureRestriction(ConstraintRoleSequenceHasRole.ConstraintRoleSequenceDomainRoleId), CopyClosureDirectiveOptions.None, delegate(ElementLink link) { IConstraint constraint = ((ConstraintRoleSequenceHasRole)link).ConstraintRoleSequence as IConstraint; if (constraint != null && constraint.ConstraintIsInternal) { return CopyClosureBehavior.ExternalReferencedPart; } return CopyClosureBehavior.Ignored; }); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ConstraintRoleSequenceHasRole.ConstraintRoleSequenceDomainRoleId), new DomainRoleClosureRestriction(ConstraintRoleSequenceHasRole.RoleDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddOrderedRole(ConstraintRoleSequenceHasRole.ConstraintRoleSequenceDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ConstraintRoleSequenceJoinPathProjection.JoinPathDomainRoleId), new DomainRoleClosureRestriction(ConstraintRoleSequenceJoinPathProjection.RolePathDomainRoleId), CopyClosureDirectiveOptions.None, delegate(ElementLink link) { ConstraintRoleSequenceJoinPathProjection projection = (ConstraintRoleSequenceJoinPathProjection)link; if (projection.JoinPath == projection.RolePath.PathOwner) { return CopyClosureBehavior.InternalReferencedPart; } return CopyClosureBehavior.ExternalReferencedPart; }); // Make the preferred identifier a composite part instead of an external reference to enforce the 1-1 nature of the relationship. closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(EntityTypeHasPreferredIdentifier.PreferredIdentifierForDomainRoleId), new DomainRoleClosureRestriction(EntityTypeHasPreferredIdentifier.PreferredIdentifierDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalCompositePart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(EntityTypeInstanceHasRoleInstance.EntityTypeInstanceDomainRoleId), new DomainRoleClosureRestriction(EntityTypeInstanceHasRoleInstance.RoleInstanceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(EntityTypeRoleInstance.RoleDomainRoleId), new DomainRoleClosureRestriction(EntityTypeRoleInstance.ObjectTypeInstanceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(EntityTypeSubtypeInstanceHasSupertypeInstance.EntityTypeSubtypeInstanceDomainRoleId), new DomainRoleClosureRestriction(EntityTypeSubtypeInstanceHasSupertypeInstance.SupertypeInstanceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ExclusiveOrConstraintCoupler.MandatoryConstraintDomainRoleId), new DomainRoleClosureRestriction(ExclusiveOrConstraintCoupler.ExclusionConstraintDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalCompositePart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ExclusiveOrConstraintCoupler.ExclusionConstraintDomainRoleId), new DomainRoleClosureRestriction(ExclusiveOrConstraintCoupler.MandatoryConstraintDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalCompositePart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeDerivationProjection.DerivationRuleDomainRoleId), new DomainRoleClosureRestriction(FactTypeDerivationProjection.RolePathDomainRoleId), CopyClosureDirectiveOptions.None, delegate(ElementLink link) { FactTypeDerivationProjection projection = (FactTypeDerivationProjection)link; if (projection.DerivationRule == projection.RolePath.PathOwner) { return CopyClosureBehavior.InternalReferencedPart; } return CopyClosureBehavior.ExternalReferencedPart; }); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeInstanceHasRoleInstance.FactTypeInstanceDomainRoleId), new DomainRoleClosureRestriction(FactTypeInstanceHasRoleInstance.RoleInstanceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.InternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeRoleInstance.RoleDomainRoleId), new DomainRoleClosureRestriction(FactTypeRoleInstance.ObjectTypeInstanceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeRoleProjectedFromCalculatedPathValue.RoleProjectionDomainRoleId), new DomainRoleClosureRestriction(FactTypeRoleProjectedFromCalculatedPathValue.SourceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeRoleProjectedFromPathedRole.RoleProjectionDomainRoleId), new DomainRoleClosureRestriction(FactTypeRoleProjectedFromPathedRole.SourceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeRoleProjectedFromRolePathRoot.RoleProjectionDomainRoleId), new DomainRoleClosureRestriction(FactTypeRoleProjectedFromRolePathRoot.SourceDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(FactTypeRoleProjection.DerivationProjectionDomainRoleId), new DomainRoleClosureRestriction(FactTypeRoleProjection.ProjectedRoleDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.InternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(GroupingElementRelationship.GroupingDomainRoleId), new DomainRoleClosureRestriction(GroupingElementRelationship.ElementDomainRoleId), CopyClosureDirectiveOptions.RootElementOnly, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(GroupingElementRelationship.ElementDomainRoleId), new DomainRoleClosureRestriction(GroupingElementRelationship.GroupingDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(LeadRolePathSatisfiesCalculatedCondition.LeadRolePathDomainRoleId), new DomainRoleClosureRestriction(LeadRolePathSatisfiesCalculatedCondition.CalculatedConditionDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.InternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(LeadRolePathSatisfiesCalculatedCondition.LeadRolePathDomainRoleId), new DomainRoleClosureRestriction(LeadRolePathSatisfiesCalculatedCondition.CalculatedConditionDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.InternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ModelNoteReferencesModelElement.ElementDomainRoleId), new DomainRoleClosureRestriction(ModelNoteReferencesModelElement.NoteDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(Objectification.NestingTypeDomainRoleId), new DomainRoleClosureRestriction(Objectification.NestedFactTypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalCompositePart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(Objectification.NestedFactTypeDomainRoleId), new DomainRoleClosureRestriction(Objectification.NestingTypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalCompositePart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ObjectificationImpliesFactType.ImpliedFactTypeDomainRoleId), new DomainRoleClosureRestriction(ObjectificationImpliesFactType.ImpliedByObjectificationDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalCompositePart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ObjectificationImpliesFactType.ImpliedByObjectificationDomainRoleId), new DomainRoleClosureRestriction(ObjectificationImpliesFactType.ImpliedFactTypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalCompositePart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ObjectifiedUnaryRoleHasRole.ObjectifiedUnaryRoleDomainRoleId), new DomainRoleClosureRestriction(ObjectifiedUnaryRoleHasRole.TargetRoleDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalCompositePart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ObjectTypePlaysRole.RolePlayerDomainRoleId), new DomainRoleClosureRestriction(ObjectTypePlaysRole.PlayedRoleDomainRoleId, SubtypeMetaRole.DomainClassId, false), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ObjectTypePlaysRole.PlayedRoleDomainRoleId), new DomainRoleClosureRestriction(ObjectTypePlaysRole.RolePlayerDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(PathedRole.RolePathDomainRoleId), new DomainRoleClosureRestriction(PathedRole.RoleDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddOrderedRole(PathedRole.RolePathDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(PathObjectUnifierUnifiesPathedRole.ObjectUnifierDomainRoleId), new DomainRoleClosureRestriction(PathObjectUnifierUnifiesPathedRole.PathedRoleDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.InternalReferencedPart); closureManager.AddOrderedRole(PathObjectUnifierUnifiesPathedRole.ObjectUnifierDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(PathObjectUnifierUnifiesRolePathRoot.ObjectUnifierDomainRoleId), new DomainRoleClosureRestriction(PathObjectUnifierUnifiesRolePathRoot.PathRootDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.InternalReferencedPart); closureManager.AddOrderedRole(PathObjectUnifierUnifiesRolePathRoot.ObjectUnifierDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ReadingOrderHasRole.ReadingOrderDomainRoleId), new DomainRoleClosureRestriction(ReadingOrderHasRole.RoleDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.InternalReferencedPart); closureManager.AddOrderedRole(ReadingOrderHasRole.ReadingOrderDomainRoleId, MergeIntegrationOrder.AfterLeading); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ReferenceModeHasReferenceModeKind.ReferenceModeDomainRoleId), new DomainRoleClosureRestriction(ReferenceModeHasReferenceModeKind.KindDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(RolePathObjectTypeRoot.RolePathDomainRoleId), new DomainRoleClosureRestriction(RolePathObjectTypeRoot.RootObjectTypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(RolePathOwnerUsesSharedLeadRolePath.PathOwnerDomainRoleId), new DomainRoleClosureRestriction(RolePathOwnerUsesSharedLeadRolePath.RolePathDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(RoleProxyHasRole.ProxyDomainRoleId), new DomainRoleClosureRestriction(RoleProxyHasRole.TargetRoleDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalCompositePart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ValueTypeHasDataType.ValueTypeDomainRoleId), new DomainRoleClosureRestriction(ValueTypeHasDataType.DataTypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ValueTypeHasValueTypeInstance.ValueTypeInstanceDomainRoleId), new DomainRoleClosureRestriction(ValueTypeHasValueTypeInstance.ValueTypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.Container); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ValueTypeHasValueTypeInstance.ValueTypeDomainRoleId), new DomainRoleClosureRestriction(ValueTypeHasValueTypeInstance.ValueTypeInstanceDomainRoleId), CopyClosureDirectiveOptions.RootElementOnly, CopyClosureBehavior.ContainedPart); closureManager.AddOrderedRole(ValueTypeHasValueTypeInstance.ValueTypeDomainRoleId, MergeIntegrationOrder.AfterLeading); #endregion // Closures for explicit relationships #region Implied reference callbacks closureManager.AddImpliedReference(ObjectType.DomainClassId, true, delegate(ModelElement element, Action<ModelElement> notifyImpliedReference) { CustomReferenceMode referenceMode = ((ObjectType)element).ReferenceMode as CustomReferenceMode; if (referenceMode != null) { notifyImpliedReference(referenceMode); } }); #endregion // Implied reference callbacks #region Register ignored properties closureManager.AddIgnoredProperty(ElementGrouping.DefinitionTextDomainPropertyId); closureManager.AddIgnoredProperty(ElementGrouping.NoteTextDomainPropertyId); closureManager.AddIgnoredProperty(FactType.DefinitionTextDomainPropertyId); closureManager.AddIgnoredProperty(FactType.DerivationNoteDisplayDomainPropertyId); closureManager.AddIgnoredProperty(FactType.DerivationStorageDisplayDomainPropertyId); closureManager.AddIgnoredProperty(FactType.GeneratedNameDomainPropertyId); closureManager.AddIgnoredProperty(FactType.NameDomainPropertyId); closureManager.AddIgnoredProperty(FactType.NameChangedDomainPropertyId); closureManager.AddIgnoredProperty(FactType.NoteTextDomainPropertyId); closureManager.AddIgnoredProperty(FactTypeInstance.NameDomainPropertyId); closureManager.AddIgnoredProperty(FactTypeInstance.NameDomainPropertyId); closureManager.AddIgnoredProperty(FactTypeInstance.NameChangedDomainPropertyId); closureManager.AddIgnoredProperty(FactTypeInstance.NameChangedDomainPropertyId); closureManager.AddIgnoredProperty(LeadRolePath.NoteTextDomainPropertyId); closureManager.AddIgnoredProperty(ObjectType.DataTypeLengthDomainPropertyId); closureManager.AddIgnoredProperty(ObjectType.DataTypeLengthDomainPropertyId); closureManager.AddIgnoredProperty(ObjectType.DataTypeScaleDomainPropertyId); closureManager.AddIgnoredProperty(ObjectType.DataTypeScaleDomainPropertyId); closureManager.AddIgnoredProperty(ObjectType.DefinitionTextDomainPropertyId); closureManager.AddIgnoredProperty(ObjectType.DerivationNoteDisplayDomainPropertyId); closureManager.AddIgnoredProperty(ObjectType.DerivationStorageDisplayDomainPropertyId); closureManager.AddIgnoredProperty(ObjectType.IsSupertypePersonalDomainPropertyId); closureManager.AddIgnoredProperty(ObjectType.IsValueTypeDomainPropertyId); closureManager.AddIgnoredProperty(ObjectType.NoteTextDomainPropertyId); closureManager.AddIgnoredProperty(ObjectType.ReferenceModeDecoratedStringDomainPropertyId); closureManager.AddIgnoredProperty(ObjectType.ReferenceModeDisplayDomainPropertyId); closureManager.AddIgnoredProperty(ObjectType.ReferenceModeDisplayDomainPropertyId); closureManager.AddIgnoredProperty(ObjectType.ReferenceModeStringDomainPropertyId); closureManager.AddIgnoredProperty(ObjectType.TreatAsPersonalDomainPropertyId); closureManager.AddIgnoredProperty(ObjectType.ValueRangeTextDomainPropertyId); closureManager.AddIgnoredProperty(ObjectType.ValueTypeValueRangeTextDomainPropertyId); closureManager.AddIgnoredProperty(ObjectTypeInstance.IdentifierNameDomainPropertyId); closureManager.AddIgnoredProperty(ObjectTypeInstance.IdentifierNameDomainPropertyId); closureManager.AddIgnoredProperty(ObjectTypeInstance.NameDomainPropertyId); closureManager.AddIgnoredProperty(ObjectTypeInstance.NameDomainPropertyId); closureManager.AddIgnoredProperty(ObjectTypeInstance.NameChangedDomainPropertyId); closureManager.AddIgnoredProperty(ObjectTypeInstance.NameChangedDomainPropertyId); closureManager.AddIgnoredProperty(ORMModel.DefinitionTextDomainPropertyId); closureManager.AddIgnoredProperty(ORMModel.NoteTextDomainPropertyId); closureManager.AddIgnoredProperty(Reading.IsPrimaryForFactTypeDomainPropertyId); closureManager.AddIgnoredProperty(Reading.IsPrimaryForReadingOrderDomainPropertyId); closureManager.AddIgnoredProperty(ReadingOrder.ReadingTextDomainPropertyId); closureManager.AddIgnoredProperty(Role.IsMandatoryDomainPropertyId); closureManager.AddIgnoredProperty(Role.MandatoryConstraintModalityDomainPropertyId); closureManager.AddIgnoredProperty(Role.MandatoryConstraintNameDomainPropertyId); closureManager.AddIgnoredProperty(Role.MultiplicityDomainPropertyId); closureManager.AddIgnoredProperty(Role.ObjectificationOppositeRoleNameDomainPropertyId); closureManager.AddIgnoredProperty(Role.ValueRangeTextDomainPropertyId); closureManager.AddIgnoredProperty(SetComparisonConstraint.DefinitionTextDomainPropertyId); closureManager.AddIgnoredProperty(SetComparisonConstraint.NoteTextDomainPropertyId); closureManager.AddIgnoredProperty(SetConstraint.DefinitionTextDomainPropertyId); closureManager.AddIgnoredProperty(SetConstraint.NoteTextDomainPropertyId); closureManager.AddIgnoredProperty(UniquenessConstraint.IsPreferredDomainPropertyId); closureManager.AddIgnoredProperty(ValueConstraint.DefinitionTextDomainPropertyId); closureManager.AddIgnoredProperty(ValueConstraint.NoteTextDomainPropertyId); closureManager.AddIgnoredProperty(ValueConstraint.TextDomainPropertyId); closureManager.AddIgnoredProperty(ValueConstraint.TextChangedDomainPropertyId); #endregion // Register ignored properties #region Register conditional properties closureManager.AddConditionalProperty(ObjectType.IsIndependentDomainPropertyId, delegate(ModelElement sourceElement, ModelElement targetElement) { ObjectType sourceObjectType = (ObjectType)sourceElement; ObjectType targetObjectType; if (sourceObjectType.IsIndependent && null != (targetObjectType = (ObjectType)targetElement) && !targetObjectType.AllowIsIndependent()) { return false; } return true; }); closureManager.AddConditionalProperty(ORMNamedElement.NameDomainPropertyId, delegate(ModelElement sourceElement, ModelElement targetElement) { IDefaultNamePattern defaultName; string pattern; if ((defaultName = sourceElement as IDefaultNamePattern) != null && defaultName.DefaultNameResettable && Utility.IsNumberDecoratedName(((ORMNamedElement)sourceElement).Name, string.IsNullOrEmpty(pattern = defaultName.DefaultNamePattern) ? System.ComponentModel.TypeDescriptor.GetClassName(sourceElement) : pattern)) { return false; } else if (targetElement != null) { string targetName = ((ORMNamedElement)targetElement).Name; if ((defaultName = sourceElement as IDefaultNamePattern) != null && defaultName.DefaultNameResettable && Utility.IsNumberDecoratedName(targetName, string.IsNullOrEmpty(pattern = defaultName.DefaultNamePattern) ? System.ComponentModel.TypeDescriptor.GetClassName(targetElement) : pattern)) { // Use a non-generated source name over a generated target name. return true; } // Override an empty target name with a non-empty source name. return !string.IsNullOrEmpty(targetName); } return true; }); #endregion // Register conditional properties }
void ICopyClosureProvider.AddCopyClosureDirectives(ICopyClosureManager closureManager) { this.AddCopyClosureDirectives(closureManager); }