public static Dictionary <String, UmlTransition> ParserTransition(XmlNode node, String id)
        {
            Dictionary <String, UmlTransition> dicTransition = new Dictionary <string, UmlTransition>();

            foreach (XmlNode NodeTransition in node.SelectNodes("//UML:ActivityGraph[@xmi.id='" + id + "']/*/UML:Transition", ns))
            {
                if (NodeTransition.Attributes["name"] != null)
                {
                    UmlTransition t = new UmlTransition();
                    t.Name = NodeTransition.Attributes["name"].Value;
                    t.Id   = NodeTransition.Attributes["xmi.id"].Value;

                    UmlTag.ParserTag(NodeTransition, ns, t);

                    foreach (XmlNode NodeTStateVertex in NodeTransition.SelectNodes("//UML:Transition[@xmi.id='" + t.Id + "']//UML:Transition.source//UML:StateVertex", ns))
                    {
                        t.Source = NodeTStateVertex.Attributes["xmi.idref"].Value;
                    }
                    foreach (XmlNode NodeStateVertex in NodeTransition.SelectNodes("//UML:Transition[@xmi.id='" + t.Id + "']//UML:Transition.target//UML:StateVertex", ns))
                    {
                        t.Target = NodeStateVertex.Attributes["xmi.idref"].Value;
                    }

                    foreach (XmlNode NodeNodeStateMachine in NodeTransition.SelectNodes("//UML:Transition[@xmi.id='" + t.Id + "']//UML:Transition.stateMachine//UML:StateMachine", ns))
                    {
                        t.refDiagramActivity = NodeNodeStateMachine.Attributes["xmi.idref"].Value;
                    }
                    dicTransition.Add(t.Id, t);
                }
            }
            return(dicTransition);
        }
Example #2
0
        public static Dictionary <String, UmlActor> ParseActor(XmlNode node)
        {
            Dictionary <String, UmlActor> dictionaryActor = new Dictionary <string, UmlActor>();

            foreach (XmlNode actorNode in node.SelectNodes("//UML:Model/*/UML:Actor", ns))
            {
                UmlActor actor = new UmlActor();
                actor.Name = actorNode.Attributes["name"].Value;
                actor.Id   = actorNode.Attributes["xmi.id"].Value;

                UmlTag.ParserTag(actorNode, ns, actor);

                foreach (XmlNode NodeTag in actorNode.SelectNodes("//UML:Model/*/UML:Actor[@xmi.id='" + actor.Id + "']//UML:Namespace", ns))
                {
                    actor.refUseCaseDiagram = NodeTag.Attributes["xmi.idref"].Value;
                }
                dictionaryActor.Add(actor.Id, actor);
            }
            return(dictionaryActor);
        }
Example #3
0
        public static void ParseActivity(XmlNode node, String id, UmlActionStateDiagram activityDiagram)
        {
            foreach (XmlNode ActionStateNode in node.SelectNodes("//UML:ActivityGraph[@xmi.id='" + id + "']//UML:ActionState", ns))
            {
                UmlActionState activity = new UmlActionState();
                activity.Id   = ActionStateNode.Attributes["xmi.id"].Value;
                activity.Name = ActionStateNode.Attributes["name"].Value;
                activityDiagram.dicAtivities.Add(activity.Id, activity);

                UmlTag.ParserTag(ActionStateNode, ns, activity);

                foreach (XmlNode NodeStateVertex in ActionStateNode.SelectNodes("//UML:ActionState[@xmi.id='" + activity.Id + "']//UML:StateVertex.outgoing//UML:Transition", ns))
                {
                    activity.outgoing = NodeStateVertex.Attributes["xmi.idref"].Value;
                }
                foreach (XmlNode NodeStateVertex in ActionStateNode.SelectNodes("//UML:ActionState[@xmi.id='" + activity.Id + "']//UML:StateVertex.incoming//UML:Transition", ns))
                {
                    activity.incoming = NodeStateVertex.Attributes["xmi.idref"].Value;
                }
            }
        }