public override void setChildNodes()
 {
     if (sourceElement == null)
     {
         return;
     }
     //create child nodes for each attribute
     foreach (TSF_EA.Attribute ownedAttribute in sourceElement.ownedAttributes)
     {
         if (!this.allChildNodes.Any(x => x.source?.uniqueID == ownedAttribute.uniqueID))
         {
             var childNode = new AttributeMappingNode(ownedAttribute, this, this.settings, this.structure);
         }
     }
     //create child nodes for each owned classifier
     foreach (TSF_EA.ElementWrapper ownedClassifier in sourceElement.ownedElements.OfType <UML.Classes.Kernel.Namespace>())
     {
         if (!this.allChildNodes.Any(x => x.source?.uniqueID == ownedClassifier.uniqueID))
         {
             var childNode = new ClassifierMappingNode(ownedClassifier, this, this.settings, this.structure);
         }
     }
     //create child nodes for each owned association
     foreach (var ownedAssociation in this.sourceElement.getRelationships <TSF_EA.Association>())
     {
         if ((ownedAssociation.targetEnd.isNavigable && ownedAssociation.sourceElement.uniqueID == this.sourceElement.uniqueID ||
              ownedAssociation.sourceEnd.isNavigable && ownedAssociation.targetElement.uniqueID == this.sourceElement.uniqueID) &&
             !this.allChildNodes.Any(x => x.source?.uniqueID == ownedAssociation.uniqueID))
         {
             var childNode = new AssociationMappingNode(ownedAssociation, this, this.settings, this.structure);
         }
     }
 }
Exemple #2
0
        public override void setChildNodes()
        {
            //the type of the attribute should be set as type
            var attributeType = this.sourceAttribute.type as TSF_EA.ElementWrapper;

            if (attributeType != null && !this.allChildNodes.Any(x => x.source?.uniqueID == attributeType.uniqueID))
            {
                var childNode = new ClassifierMappingNode(attributeType, this, this.settings, this.structure);
            }
        }
Exemple #3
0
        private void addElementPropertiesToChildNodes(TSF_EA.ElementWrapper virtualElement)
        {
            //figure out the if we have virtual element
            var element = virtualElement != null ? virtualElement : this.sourceElement;

            if (element == null)
            {
                return;                  //failsafe
            }
            //create child nodes for each attribute
            foreach (TSF_EA.Attribute ownedAttribute in element.ownedAttributes)
            {
                if (!this.allChildNodes.Any(x => x.source?.uniqueID == ownedAttribute.uniqueID))
                {
                    var childNode = new AttributeMappingNode(ownedAttribute, this, this.settings, this.structure, virtualElement);
                }
            }
            //create child nodes for all enum values
            var sourceEnum = element as TSF_EA.Enumeration;

            if (sourceEnum != null)
            {
                foreach (var enumLiteral in sourceEnum.ownedLiterals)
                {
                    if (!this.allChildNodes.Any(x => x.source?.uniqueID == enumLiteral.uniqueID))
                    {
                        var childNode = new AttributeMappingNode((TSF_EA.AttributeWrapper)enumLiteral, this, this.settings, this.structure, virtualElement);
                    }
                }
            }
            //create child nodes for each owned classifier
            foreach (TSF_EA.ElementWrapper ownedClassifier in element.ownedElements.OfType <UML.Classes.Kernel.Namespace>())
            {
                if (!this.allChildNodes.Any(x => x.source?.uniqueID == ownedClassifier.uniqueID))
                {
                    var childNode = new ClassifierMappingNode(ownedClassifier, this, this.settings, this.structure, virtualElement);
                }
            }
            //create child nodes for each owned association
            foreach (var ownedAssociation in element.getRelationships <TSF_EA.Association>())
            {
                if ((ownedAssociation.targetEnd.isNavigable && ownedAssociation.sourceElement.uniqueID == element.uniqueID ||
                     ownedAssociation.sourceEnd.isNavigable && ownedAssociation.targetElement.uniqueID == element.uniqueID) &&
                    !this.allChildNodes.Any(x => x.source?.uniqueID == ownedAssociation.uniqueID))
                {
                    var childNode = new AssociationMappingNode(ownedAssociation, this, this.settings, this.structure, virtualElement);
                }
            }
            //do the same for all superclasses
            foreach (var superClass in element.superClasses)
            {
                addElementPropertiesToChildNodes((TSF_EA.ElementWrapper)superClass);
            }
        }
Exemple #4
0
 public override void setChildNodes()
 {
     //we only traverse associations in case of message structrure
     if (this.structure == MP.ModelStructure.Message)
     {
         //create mapping node for target element
         var targetElement = this.sourceAssociation.targetElement as TSF_EA.ElementWrapper;
         if (targetElement != null && !this.allChildNodes.Any(x => x.source?.uniqueID == targetElement.uniqueID))
         {
             var childNode = new ClassifierMappingNode(targetElement, this, this.settings, this.structure);
         }
     }
 }
Exemple #5
0
 public AssociationMappingNode(TSF_EA.Association sourceAssociation, ClassifierMappingNode parent, MappingSettings settings, MP.ModelStructure structure, UML.Classes.Kernel.NamedElement virtualOwner) : base(sourceAssociation, parent, settings, structure, virtualOwner)
 {
 }
Exemple #6
0
 public AssociationMappingNode(TSF_EA.Association sourceAssociation, ClassifierMappingNode parent, MappingSettings settings, MP.ModelStructure structure) : this(sourceAssociation, parent, settings, structure, null)
 {
 }
Exemple #7
0
 public AttributeMappingNode(TSF_EA.AttributeWrapper sourceAttribute, ClassifierMappingNode parent, MappingSettings settings, MP.ModelStructure structure, UML.Classes.Kernel.NamedElement virtualOwner) : base((UML.Classes.Kernel.NamedElement)sourceAttribute, parent, settings, structure, virtualOwner)
 {
 }
Exemple #8
0
 public AttributeMappingNode(TSF_EA.AttributeWrapper sourceAttribute, ClassifierMappingNode parent, MappingSettings settings, MP.ModelStructure structure) : this(sourceAttribute, parent, settings, structure, null)
 {
 }
Exemple #9
0
 public AttributeMappingNode(TSF_EA.Attribute sourceAttribute, ClassifierMappingNode parent, MappingSettings settings, MP.ModelStructure structure) : base(sourceAttribute, parent, settings, structure)
 {
 }