示例#1
0
        public override IEnumerable <MP.Mapping> getOwnedMappings(MP.MappingNode targetRootNode)
        {
            var foundMappings = new List <MP.Mapping>();

            //get the mappings using trace relations
            //TODO: is this fast enough?
            foreach (var trace in this.sourceElement.getRelationships <TSF_EA.Abstraction>().Where(x => x.target is TSF_EA.Element && x.stereotypes.Any(y => y.name == "trace")))
            {
                //get the mappings based on traces
                var mapping = MappingFactory.getMapping(this, trace, (MappingNode)targetRootNode);
                if (mapping != null)
                {
                    foundMappings.Add(mapping);
                }
            }
            //also add the base mappings
            foundMappings.AddRange(base.getOwnedMappings(targetRootNode));
            return(foundMappings);
        }
示例#2
0
        public override IEnumerable <MP.Mapping> getOwnedMappings(MP.MappingNode targetRootNode)
        {
            //the mappings are stored in a tagged value
            var foundMappings = new List <MP.Mapping>();

            //Mappings are stored in tagged values
            foreach (var mappingTag in this.sourceAssociation.taggedValues.Where(x => x.name == this.settings.linkedAttributeTagName))
            {
                var mapping = MappingFactory.getMapping(this, (TSF_EA.TaggedValue)mappingTag, (MappingNode)targetRootNode);
                if (mapping != null)
                {
                    foundMappings.Add(mapping);
                }
            }
            //loop subNodes
            foreach (MappingNode childNode in this.allChildNodes)
            {
                foundMappings.AddRange(childNode.getOwnedMappings(targetRootNode));
            }
            return(foundMappings);
        }
        public override IEnumerable <MP.Mapping> getOwnedMappings(MP.MappingNode targetRootNode)
        {
            var foundMappings = new List <MP.Mapping>();

            //TODO: is this fast enough?
            foreach (var trace in this.sourceElement.relationships.OfType <TSF_EA.Abstraction>().Where(x => x.target is TSF_EA.Element && x.stereotypes.Any(y => y.name == "trace")))
            {
                //check if this trace represents a mappingNode to somewhere in in the targetNode
                //get the mapping path
                var mapping = MappingFactory.getMapping(this, trace, (MappingNode)targetRootNode);
                if (mapping != null)
                {
                    foundMappings.Add(mapping);
                }
            }
            //loop subNodes
            foreach (MappingNode childNode in this.allChildNodes)
            {
                foundMappings.AddRange(childNode.getOwnedMappings(targetRootNode));
            }
            return(foundMappings);
        }