Пример #1
0
 private void addAttributes(MocaNode pkgNode)
 {
     pkgNode.appendChildAttribute(MoflonCustomPluginIDTaggedValueName, computePluginID());
     pkgNode.appendChildAttribute(MoflonExportTaggedValueName, computeExportAttribute());
     pkgNode.appendChildAttribute(MoflonValidatedTaggedValueName, computeValidatedAttribute());
     pkgNode.appendChildAttribute(MoflonWorkingSetTaggedValueName, computeRootNodeName());
 }
Пример #2
0
        public override Serialization.MocaTree.MocaNode serializeToMocaTree()
        {
            if (!isInitialized)
            {
                computeFeatures();
            }
            MocaNode eclassNode = new MocaNode("EClass");

            eclassNode.appendChildAttribute("name", this.Name);
            eclassNode.appendChildAttribute("isAbstract", this.isAbstract.ToString().ToLower());
            eclassNode.appendChildAttribute("isInterface", this.isInterface.ToString().ToLower());
            eclassNode.appendChildAttribute(Main.GuidStringName, this.EaElement.ElementGUID);
            eclassNode.appendChildAttribute("alias", this.Alias);


            MocaNode referencesNode = eclassNode.appendChildNode(EClass.ReferencesChildNodeName);
            MocaNode attributesNode = eclassNode.appendChildNode(EClass.AttributesChildNodeName);
            MocaNode operationsNode = eclassNode.appendChildNode(EClass.OperationsChildNodeName);

            foreach (EAttribute eAttribute in this.EAttributes)
            {
                MocaNode eAttributeNode = attributesNode.appendChildNode("EAttribute");
                eAttribute.serializeToMocaTree(eAttributeNode);
            }

            foreach (EOperation eOperation in this.EOperations)
            {
                MocaNode eOperationNode = operationsNode.appendChildNode("EOperation");
                eOperation.serializeToMocaTree(eOperationNode);
            }


            return(eclassNode);
        }
Пример #3
0
        public override MocaNode serializeToMocaTree()
        {
            EClass dummyEClass = new EClass(this.rule, Repository);

            dummyEClass.computeFeatures();
            MocaNode ruleNode = dummyEClass.serializeToMocaTree();

            ruleNode.Name = "Rule";

            MocaNode operationsNode = ruleNode.getChildNodeWithName(EClass.OperationsChildNodeName);
            MocaNode toDelete       = null;

            if (operationsNode != null)
            {
                foreach (MocaNode node in operationsNode.Children)
                {
                    MocaAttribute nameAttr = node.getAttributeOrCreate("name");
                    if (nameAttr != null && nameAttr.Value == this.Name)
                    {
                        toDelete = node;
                    }
                }
            }
            if (toDelete != null)
            {
                operationsNode.Children.Remove(toDelete);
            }

            ruleNode.appendChildAttribute(TGGRule.CspSpecAttributeName, "");
            ruleNode.appendChildAttribute("refines", "");
            ruleNode.appendChildAttribute("baseClasses", "");
            ruleNode.appendChildNode(StoryPattern.ObjectVariablesChildNodeName);

            return(ruleNode);
        }
Пример #4
0
        public override void addAttributesDuringExport(MocaNode activityEdgeNode)
        {
            SQLElement target = Repository.GetElementByID(this.EaConnector.SupplierID);
            SQLElement client = Repository.GetElementByID(this.EaConnector.ClientID);

            activityEdgeNode.appendChildAttribute("sourceGuid", client.ElementGUID);
            activityEdgeNode.appendChildAttribute("targetGuid", target.ElementGUID);
        }
Пример #5
0
        private void addAttributes(MocaNode pkgNode)
        {
            pkgNode.appendChildAttribute(MoflonCustomNameTaggedValueName, computeName());
            pkgNode.appendChildAttribute(MoflonCustomNsPrefixTaggedValueName, computeNsPrefix());
            pkgNode.appendChildAttribute(MoflonCustomNsUriTaggedValueName, computeNsUri());

            removeObsoleteAttributes(pkgNode);
        }
Пример #6
0
        public override Serialization.MocaTree.MocaNode serializeToMocaTree(MocaNode actNode)
        {
            MocaNode node = base.serializeToMocaTree(actNode);

            node.appendChildAttribute("objectVariableGuid", this.ObjectVariableGUID);
            node.appendChildAttribute("objectVariableName", this.ObjectVariableName);
            return(node);
        }
Пример #7
0
 public override Serialization.MocaTree.MocaNode serializeToMocaTree(MocaNode actNode)
 {
     actNode.appendChildAttribute("type", this.parameterType);
     actNode.appendChildAttribute("name", this.Name);
     actNode.appendChildAttribute("typeGuid", this.typeGuid);
     actNode.appendChildAttribute(Main.GuidStringName, this.EaParameter.ParameterGUID);
     return(actNode);
 }
Пример #8
0
        public override Serialization.MocaTree.MocaNode serializeToMocaTree(MocaNode actNode)
        {
            MocaNode node = base.serializeToMocaTree(actNode);

            node.appendChildAttribute("parameterGuid", this.ParameterGUID);
            node.appendChildAttribute("parameterName", this.ParameterName);
            return(node);
        }
Пример #9
0
        public override Serialization.MocaTree.MocaNode serializeToMocaTree(MocaNode actNode)
        {
            actNode.appendChildAttribute("attributeName", this.AttributeName);
            actNode.appendChildAttribute("attributeGuid", this.AttributeGUID);
            MocaNode valueExpNode = actNode.appendChildNode("valueExpression");

            this.ValueExpression.serializeToMocaTree(valueExpNode);
            return(actNode);
        }
Пример #10
0
        public override MocaNode serializeToMocaTree()
        {
            MocaNode node = new MocaNode("ActivityNode");

            node.appendChildAttribute("name", this.Name);
            node.appendChildAttribute(Main.GuidStringName, this.ActivityNodeEAElement.ElementGUID);
            node.appendChildNode(ActivityNode.OutgoingTransitionsNodeName);
            return(node);
        }
Пример #11
0
        public override Serialization.MocaTree.MocaNode serializeToMocaTree()
        {
            MocaNode actNode = base.serializeToMocaTree();

            actNode.appendChildAttribute("forEach", this.ForEach.ToString().ToLower());
            actNode.appendChildAttribute("type", "story");
            actNode.appendChildNode(StoryPattern.ObjectVariablesChildNodeName);
            return(actNode);
        }
Пример #12
0
        public override Serialization.MocaTree.MocaNode serializeToMocaTree(MocaNode actNode)
        {
            MocaNode literalExpressionNode = base.serializeToMocaTree(actNode);

            literalExpressionNode.appendChildAttribute("value", this.Value);
            literalExpressionNode.appendChildAttribute("datatype", this.Datatype);

            return(literalExpressionNode);
        }
Пример #13
0
        public override Serialization.MocaTree.MocaNode serializeToMocaTree()
        {
            MocaNode ePackageNode = new MocaNode(ECOREModelingMain.EPackageStereotype);

            ePackageNode.appendChildAttribute(ChangesTreeConstants.ATTRIBUTE_KEY_NAME, this.name);
            ePackageNode.appendChildAttribute(ChangesTreeConstants.ATTRIBUTE_KEY_PREVIOUS_NAME, this.previousName);
            ePackageNode.appendChildAttribute(ChangesTreeConstants.ATTRIBUTE_KEY_PACKAGE_NAME, this.packageName);
            ePackageNode.appendChildAttribute(ChangesTreeConstants.ATTRIBUTE_KEY_PROJECT_NAME, this.projectName);
            return(ePackageNode);
        }
Пример #14
0
        public override Serialization.MocaTree.MocaNode serializeToMocaTree()
        {
            MocaNode eDataTypeNode = new MocaNode();

            eDataTypeNode.Name = "EDatatype";
            eDataTypeNode.appendChildAttribute("name", this.Name);
            eDataTypeNode.appendChildAttribute(Main.GuidStringName, this.Guid);
            eDataTypeNode.appendChildAttribute("instanceTypeName", this.InstanceTypeName);
            return(eDataTypeNode);
        }
Пример #15
0
        public override Serialization.MocaTree.MocaNode serializeToMocaTree()
        {
            this.domain = TGGModelingUtil.getDomainOfObjectVariable(Repository, this);

            MocaNode ovNode = base.serializeToMocaTree();

            ovNode.appendChildAttribute("metamodelGuid", this.metamodelGuid);
            ovNode.appendChildAttribute("domain", this.domain.ToString().ToLower());
            ovNode.Name = "TGGObjectVariable";
            return(ovNode);
        }
Пример #16
0
        public override Serialization.MocaTree.MocaNode serializeToMocaTree()
        {
            MocaNode activityEdgeNode = new MocaNode("ActivityEdge");

            activityEdgeNode.appendChildAttribute(SourceGuidAttributeName, this.sourceGuid);
            activityEdgeNode.appendChildAttribute(TargetGuidAttributeName, this.targetGuid);
            activityEdgeNode.appendChildAttribute(EdgeGuardAttributeName, this.GuardType.ToString().ToLower());
            activityEdgeNode.appendChildAttribute(Main.GuidStringName, EaConnector.ConnectorGUID);

            return(activityEdgeNode);
        }
Пример #17
0
        public void additionalAttributesDuringExport(MocaNode currentNode)
        {
            currentNode.getAttributeOrCreate(TGGRule.CspSpecAttributeName).Value = "";

            String refinesString = computeRefinementString();

            currentNode.appendChildAttribute("refines", refinesString);

            String kernelString = computeKernelString();

            currentNode.appendChildAttribute("kernel", kernelString);
        }
Пример #18
0
        public override Serialization.MocaTree.MocaNode serializeToMocaTree(MocaNode actNode)
        {
            MocaNode valueExpressionNode = actNode.appendChildNode("valueExpression");

            if (this.ValueExpression != null)
            {
                this.ValueExpression.serializeToMocaTree(valueExpressionNode);
            }

            actNode.appendChildAttribute("parameterGuid", this.ParameterGuid);
            actNode.appendChildAttribute("parameterType", this.ParameterType);

            return(actNode);
        }
Пример #19
0
        public void addChangesAttributesDuringExport(MocaNode pkgNode, SQLTaggedValue changesTreeTag)
        {
            MocaNode ePackageMocaNode = MocaTreeUtil.mocaNodeFromXmlString(changesTreeTag.Notes);

            string[] expectedAttributes = { ChangesTreeConstants.ATTRIBUTE_KEY_NAME, ChangesTreeConstants.ATTRIBUTE_KEY_PREVIOUS_NAME, ChangesTreeConstants.ATTRIBUTE_KEY_PACKAGE_NAME, ChangesTreeConstants.ATTRIBUTE_KEY_PROJECT_NAME };
            if (ePackageMocaNode.hasAllAttributes(new List <string>(expectedAttributes)))
            {
                pkgNode.appendChildAttribute("Changes::Name", ePackageMocaNode.getAttribute(ChangesTreeConstants.ATTRIBUTE_KEY_NAME).Value);
                pkgNode.appendChildAttribute("Changes::PreviousName", ePackageMocaNode.getAttribute(ChangesTreeConstants.ATTRIBUTE_KEY_PREVIOUS_NAME).Value);
                pkgNode.appendChildAttribute("Changes::PackageName", ePackageMocaNode.getAttribute(ChangesTreeConstants.ATTRIBUTE_KEY_PACKAGE_NAME).Value);
                pkgNode.appendChildAttribute("Changes::ProjectName", ePackageMocaNode.getAttribute(ChangesTreeConstants.ATTRIBUTE_KEY_PROJECT_NAME).Value);
                //pkgNode.appendChildAttribute("Changes::IsTLP", ePackageMocaNode.getAttribute("isTLP").Value);
            }
        }
Пример #20
0
        public override MocaNode serializeToMocaTree(MocaNode actNode)
        {
            MocaNode dummyNode = null;

            EcoreUtil.computeLowerUpperBound(ConnectorEnd.getRealConnectorEnd().Cardinality, ref lowerBound, ref upperBound);

            if (ConnectorEnd.getRealConnectorEnd().End == "Client")
            {
                dummyNode = actNode.appendChildNode("ClientReference");

                SQLElement clientEClass = Repository.GetElementByID(this.EaConnector.getRealConnector().ClientID);
                typeGUID = clientEClass.ElementGUID;
                refGUID  = this.EaConnector.getRealConnector().ConnectorGUID + "Client";
                if (this.EaConnector.getRealConnector().SupplierEnd.Role != "")
                {
                    oppositeGUID = this.EaConnector.getRealConnector().ConnectorGUID + "Supplier";
                }


                containment = this.EaConnector.getRealConnector().SupplierEnd.Aggregation == 2;
            }

            else if (ConnectorEnd.getRealConnectorEnd().End == "Supplier")
            {
                dummyNode = actNode.appendChildNode("SupplierReference");
                SQLElement supplierEClass = Repository.GetElementByID(this.EaConnector.getRealConnector().SupplierID);
                typeGUID = supplierEClass.ElementGUID;
                refGUID  = this.EaConnector.getRealConnector().ConnectorGUID + "Supplier";
                if (this.EaConnector.getRealConnector().ClientEnd.Role != "")
                {
                    oppositeGUID = this.EaConnector.getRealConnector().ConnectorGUID + "Client";
                }


                containment = this.EaConnector.getRealConnector().ClientEnd.Aggregation == 2;
            }

            if (Navigable)
            {
                MocaNode ereferenceNode = dummyNode.appendChildNode("EReference");
                ereferenceNode.appendChildAttribute("typeGuid", typeGUID);
                if ((ConnectorEnd.Role == "" || ConnectorEnd.getRealConnectorEnd().Role == null))
                {
                    ereferenceNode.appendChildAttribute("name", this.Name);
                }
                else
                {
                    ereferenceNode.appendChildAttribute("name", ConnectorEnd.getRealConnectorEnd().Role);
                }
                ereferenceNode.appendChildAttribute(Main.GuidStringName, refGUID);
                ereferenceNode.appendChildAttribute("lowerBound", lowerBound);
                ereferenceNode.appendChildAttribute("upperBound", upperBound);
                ereferenceNode.appendChildAttribute("containment", (containment + "").ToLower());
                if (oppositeGUID != "")
                {
                    ereferenceNode.appendChildAttribute("oppositeGuid", oppositeGUID);
                }
            }
            return(dummyNode);
        }
Пример #21
0
        public override Serialization.MocaTree.MocaNode serializeToMocaTree(MocaNode actNode)
        {
            actNode.appendChildAttribute("name", this.Name);
            MocaNode parametersNode = actNode.appendChildNode(EOperation.ParametersChildNodeName);

            foreach (EParameter eParameter in this.EParameters)
            {
                MocaNode eParameterNode = parametersNode.appendChildNode("EParameter");
                eParameter.serializeToMocaTree(eParameterNode);
            }
            actNode.appendChildAttribute(Main.GuidStringName, this.EaMethod.MethodGUID);
            actNode.appendChildAttribute("typeGuid", this.typeGuid);
            actNode.appendChildAttribute("returnType", this.returnType);

            return(actNode);
        }
Пример #22
0
        public override Serialization.MocaTree.MocaNode serializeToMocaTree(MocaNode actNode)
        {
            MocaNode exp = actNode;

            exp.appendChildAttribute("type", this.Type);
            return(exp);
        }
Пример #23
0
        public override Serialization.MocaTree.MocaNode serializeToMocaTree(MocaNode actNode)
        {
            MocaNode node = base.serializeToMocaTree(actNode);

            node.appendChildAttribute("expressionText", this.ExpressionText);
            return(node);
        }
Пример #24
0
        public override Serialization.MocaTree.MocaNode serializeToMocaTree()
        {
            MocaNode activityNode = new MocaNode("Activity");

            activityNode.appendChildAttribute(Main.GuidStringName, SdmContainer.ElementGUID);
            return(activityNode);
        }
Пример #25
0
        public override Serialization.MocaTree.MocaNode serializeToMocaTree()
        {
            Name = this.ActivityNodeEAElement.Name;
            MocaNode startNodeNode = base.serializeToMocaTree();

            startNodeNode.appendChildAttribute("type", "start");
            return(startNodeNode);
        }
Пример #26
0
        internal virtual void serializeToMocaTree(MocaNode pkgNode)
        {
            pkgNode.appendChildNode(ClassesChildNodeName);
            pkgNode.appendChildNode(PackagesChildNodeName);
            pkgNode.appendChildAttribute(Main.GuidStringName, package.EaPackage.PackageGUID);

            addAttributes(pkgNode);
        }
        public override Serialization.MocaTree.MocaNode serializeToMocaTree(MocaNode actNode)
        {
            base.serializeToMocaTree(actNode);
            MocaNode targetNode = actNode.appendChildNode("target");

            actNode.appendChildAttribute("methodGuid", this.MethodGuid);
            actNode.appendChildAttribute("methodName", this.MethodName);
            actNode.appendChildAttribute("methodReturnType", this.MethodName);
            this.Target.serializeToMocaTree(targetNode);
            foreach (ParameterBinding parameterBinding in this.OwnedParameterBinding)
            {
                MocaNode pbNode = actNode.appendChildNode("ownedParameterBinding");
                parameterBinding.serializeToMocaTree(pbNode);
            }

            return(actNode);
        }
Пример #28
0
        public override Serialization.MocaTree.MocaNode serializeToMocaTree()
        {
            MocaNode eEnumNode = new MocaNode("EEnum");

            eEnumNode.appendChildAttribute("name", this.eaEEnumElement.Name);
            eEnumNode.appendChildAttribute(Main.GuidStringName, this.eaEEnumElement.ElementGUID);

            MocaNode eLiteralsNode = eEnumNode.appendChildNode("literals");

            foreach (EEnumLiteral literal in this.Literals)
            {
                MocaNode eLiteralNode = eLiteralsNode.appendChildNode("EEnumLiteral");
                literal.serializeToMocaTree(eLiteralNode);
            }

            return(eEnumNode);
        }
Пример #29
0
        public override Serialization.MocaTree.MocaNode serializeToMocaTree()
        {
            this.domain = TGGModelingUtil.getDomainOfLinkVariable(Repository, this.LinkVariableEA);
            MocaNode lvNode = base.serializeToMocaTree();

            lvNode.appendChildAttribute("domain", this.domain.ToString().ToLower());
            lvNode.Name = TGGModelingMain.TggLinkVariableStereotype;
            return(lvNode);
        }
Пример #30
0
        public override MocaNode serializeToMocaTree(MocaNode actNode)
        {
            actNode.appendChildAttribute("type", this.attributeType);
            actNode.appendChildAttribute("typeGuid", this.typeGuid);
            actNode.appendChildAttribute("name", this.Name);
            actNode.appendChildAttribute(Main.GuidStringName, this.EaAttribute.AttributeGUID);
            if (this.EaAttribute.Default != "")
            {
                actNode.appendChildAttribute("defaultValueLiteral", this.EaAttribute.Default);
            }
            actNode.appendChildAttribute("ordered", this.ordered);
            actNode.appendChildAttribute("lowerBound", this.lowerBound);
            actNode.appendChildAttribute("upperBound", this.upperBound);
            actNode.appendChildAttribute("isId", this.isId);
            actNode.appendChildAttribute("isDerived", this.isDerived);

            return(actNode);
        }