private static void UpdateChildNamesForFactTypeDelayedWorker(ModelElement element) { if (!element.IsDeleted) { FactType factType = (FactType)element; foreach (ConceptTypeChild child in ConceptTypeChildHasPathFactType.GetConceptTypeChild(factType)) { LinkedElementCollection <FactType> factTypePath = ConceptTypeChildHasPathFactType.GetPathFactTypeCollection(child); int pathCount; RoleBase towardsRole; RoleBase fromRole; if (0 != (pathCount = factTypePath.Count) && factType == factTypePath[pathCount - 1] && null != (towardsRole = FactTypeMapsTowardsRole.GetTowardsRole(factType)) && null != (fromRole = towardsRole.OppositeRole)) { string resolvedName = ResolveRoleName(fromRole); ConceptTypeReferencesConceptType reference; if (null != (reference = child as ConceptTypeReferencesConceptType)) { // Match original backwards pattern reference.OppositeName = resolvedName; child.Name = ResolveRoleName(towardsRole); } else { child.Name = resolvedName; } } } } }
private static void ValidateReferenceModeNamingChanged(ReferenceModeNamingCustomizesObjectType referenceModeNamingCustomizesObjectType) { if (null != referenceModeNamingCustomizesObjectType) { ORMCore.ObjectType objectType = referenceModeNamingCustomizesObjectType.ObjectType; if (objectType != null) { ConceptType conceptType = ConceptTypeIsForObjectType.GetConceptType(objectType); if (null == conceptType) { foreach (ORMCore.Role role in objectType.PlayedRoleCollection) { foreach (ConceptTypeChild conceptTypeChild in ConceptTypeChildHasPathFactType.GetConceptTypeChild(role.FactType)) { ValidateConceptTypeChildNameChanged(conceptTypeChild); } } } else { ValidateConceptTypeNameChanged(conceptType); } } } }
private static void FactTypeConstraintPatternChangedDelayed(ModelElement element) { FactType factType; ORMModel model; if (!element.IsDeleted && null != (model = (factType = (FactType)element).Model) && !ORMElementGateway.IsElementExcluded(factType)) { // If we're not previously mapped, then we will have been added at this point FactTypeMapsTowardsRole mapToRole = FactTypeMapsTowardsRole.GetLinkToTowardsRole(factType); if (mapToRole != null) { MappingMandatoryPattern startMandatoryPattern = mapToRole.MandatoryPattern; if (mapToRole.SynchronizeMappingPatterns()) { MappingMandatoryPattern endMandatoryPattern = mapToRole.MandatoryPattern; if (endMandatoryPattern != startMandatoryPattern) { foreach (ConceptTypeChild child in ConceptTypeChildHasPathFactType.GetConceptTypeChild(factType)) { ValidateMandatory(child, startMandatoryPattern, endMandatoryPattern); } } } else { AddTransactedModelElement(factType, ModelElementModification.ORMElementChanged); FrameworkDomainModel.DelayValidateElement(model, DelayValidateModel); } } } }
private static void FactTypeNamePartChanged(ORMCore.FactType factType) { bool checkPrimaryFactType = true; ORMCore.Objectification objectification = factType.Objectification; if (null != objectification) { foreach (ORMCore.FactType impliedFactType in objectification.ImpliedFactTypeCollection) { foreach (ConceptTypeChild child in ConceptTypeChildHasPathFactType.GetConceptTypeChild(impliedFactType)) { ValidateConceptTypeChildNameChanged(child); } } checkPrimaryFactType = factType.UnaryRole != null; } if (checkPrimaryFactType) { foreach (ConceptTypeChild child in ConceptTypeChildHasPathFactType.GetConceptTypeChild(factType)) { ValidateConceptTypeChildNameChanged(child); } } }