Exemplo n.º 1
0
        internal void Enforce(ISet <CheckResultBlockProperty2StructureElement> result, LL.MDE.DataModels.XML.Tag structureElements)
        {
            foreach (CheckResultBlockProperty2StructureElement match in result)
            {
                // Extracting variables binded in source domains
                LL.MDE.DataModels.EnAr.Element parentEl = match.matchDomainParentEl.parentEl;
                long sid = match.matchDomainParentEl.sid;
                LL.MDE.DataModels.EnAr.Connector aggregation = match.matchDomainParentEl.aggregation;
                int cid = match.matchDomainParentEl.cid;
                LL.MDE.DataModels.EnAr.Element childEl = match.matchDomainParentEl.childEl;
                string id     = match.matchDomainParentEl.id;
                string elName = match.matchDomainParentEl.elName;
                LL.MDE.DataModels.EnAr.Element classifierEl = match.matchDomainParentEl.classifierEl;
                string classifierName = match.matchDomainParentEl.classifierName;
                LL.MDE.DataModels.XML.Tag parentSeDecomposition = match.matchDomainParentSeDecomposition.parentSeDecomposition;

                // Assigning variables binded in the where clause
                string name = elName + ':' + classifierName;

                // Enforcing each enforced domain
                MatchDomainStructureElements targetMatchDomainStructureElements = EnforceStructureElements(name, id, structureElements);

                // Retrieving variables binded in the enforced domains
                LL.MDE.DataModels.XML.Tag       fmStructureelement = targetMatchDomainStructureElements.fmStructureelement;
                LL.MDE.DataModels.XML.Tag       fmSeDecomposition  = targetMatchDomainStructureElements.fmSeDecomposition;
                LL.MDE.DataModels.XML.Tag       longName1          = targetMatchDomainStructureElements.longName1;
                LL.MDE.DataModels.XML.Tag       l41         = targetMatchDomainStructureElements.l41;
                LL.MDE.DataModels.XML.Attribute lAttr1      = targetMatchDomainStructureElements.lAttr1;
                LL.MDE.DataModels.XML.Attribute structureId = targetMatchDomainStructureElements.structureId;

                // Calling other relations as defined in the where clause
                new RelationCreateDecompositionLink(editor, transformation).CheckAndEnforce(structureId, parentSeDecomposition); new RelationBlockProperty2StructureElement(editor, transformation).CheckAndEnforce(childEl, fmSeDecomposition, structureElements);
            }
        }
        internal void Enforce(ISet <CheckResultAddStructureRoot> result, LL.MDE.DataModels.XML.Tag structureElements)
        {
            foreach (CheckResultAddStructureRoot match in result)
            {
                // Extracting variables binded in source domains
                LL.MDE.DataModels.EnAr.Package abstractionLevelP = match.matchDomainAbstractionLevelP.abstractionLevelP;
                string alpName = match.matchDomainAbstractionLevelP.alpName;
                LL.MDE.DataModels.EnAr.Package fctsysP = match.matchDomainAbstractionLevelP.fctsysP;
                string fctsysName = match.matchDomainAbstractionLevelP.fctsysName;
                LL.MDE.DataModels.XML.Tag structure = match.matchDomainStructure.structure;

                // Assigning variables binded in the where clause
                string elementName = fctsysName + ' ' + alpName;

                // Enforcing each enforced domain
                MatchDomainStructureElements targetMatchDomainStructureElements = EnforceStructureElements(elementName, structureElements);

                // Retrieving variables binded in the enforced domains
                LL.MDE.DataModels.XML.Tag       fmStructureelement = targetMatchDomainStructureElements.fmStructureelement;
                LL.MDE.DataModels.XML.Tag       longName1          = targetMatchDomainStructureElements.longName1;
                LL.MDE.DataModels.XML.Tag       l41               = targetMatchDomainStructureElements.l41;
                LL.MDE.DataModels.XML.Attribute lAttr1            = targetMatchDomainStructureElements.lAttr1;
                LL.MDE.DataModels.XML.Tag       fmSeDecomposition = targetMatchDomainStructureElements.fmSeDecomposition;
                LL.MDE.DataModels.XML.Attribute structureId       = targetMatchDomainStructureElements.structureId;

                // Calling other relations as defined in the where clause
                new RelationCreateStructureRootLink(editor, transformation).CheckAndEnforce(structureId, structure); new RelationRootProperty2StructureElement(editor, transformation).CheckAndEnforce(abstractionLevelP, fmSeDecomposition, structure, structureElements);
            }
        }
Exemplo n.º 3
0
        internal MatchDomainStructureElements EnforceStructureElements(string name, string id, LL.MDE.DataModels.XML.Tag structureElements)
        {
            MatchDomainStructureElements match = new MatchDomainStructureElements();

            // Contructing structureElements
            LL.MDE.DataModels.XML.Tag fmStructureelement = null;
            fmStructureelement = (LL.MDE.DataModels.XML.Tag)editor.CreateNewObjectInField(structureElements, "childTags");

            // Contructing fmStructureelement
            editor.AddOrSetInField(fmStructureelement, "tagname", "FM-STRUCTURE-ELEMENT");
            LL.MDE.DataModels.XML.Tag fmSeDecomposition = null;
            fmSeDecomposition = (LL.MDE.DataModels.XML.Tag)editor.CreateNewObjectInField(fmStructureelement, "childTags");

            LL.MDE.DataModels.XML.Tag longName1 = null;
            longName1 = (LL.MDE.DataModels.XML.Tag)editor.CreateNewObjectInField(fmStructureelement, "childTags");

            LL.MDE.DataModels.XML.Attribute structureId = null;
            structureId = (LL.MDE.DataModels.XML.Attribute)editor.CreateNewObjectInField(fmStructureelement, "attributes");

            // Contructing fmSeDecomposition
            editor.AddOrSetInField(fmSeDecomposition, "tagname", "FM-SE-DECOMPOSITION");

            // Contructing longName1
            editor.AddOrSetInField(longName1, "tagname", "LONG-NAME");
            LL.MDE.DataModels.XML.Tag l41 = null;
            l41 = (LL.MDE.DataModels.XML.Tag)editor.CreateNewObjectInField(longName1, "childTags");

            // Contructing l41
            editor.AddOrSetInField(l41, "tagname", "L-4");
            editor.AddOrSetInField(l41, "value", name);
            LL.MDE.DataModels.XML.Attribute lAttr1 = null;
            lAttr1 = (LL.MDE.DataModels.XML.Attribute)editor.CreateNewObjectInField(l41, "attributes");

            // Contructing lAttr1
            editor.AddOrSetInField(lAttr1, "name", "L");
            editor.AddOrSetInField(lAttr1, "value", "bp2se");

            // Contructing structureId
            editor.AddOrSetInField(structureId, "name", "ID");
            editor.AddOrSetInField(structureId, "value", id);

            // Return newly binded variables
            match.structureElements  = structureElements;
            match.fmStructureelement = fmStructureelement;
            match.fmSeDecomposition  = fmSeDecomposition;
            match.longName1          = longName1;
            match.l41         = l41;
            match.lAttr1      = lAttr1;
            match.structureId = structureId;
            return(match);
        }